Improve detection of special *FIP* property names

Make sure RFIP* and SFIP* are not treated as category results
This commit is contained in:
Magne Sjaastad
2024-09-24 08:43:22 +02:00
parent de573a83cc
commit 12ae4dbaaa
3 changed files with 63 additions and 4 deletions

View File

@@ -0,0 +1,56 @@
#include "gtest/gtest.h"
#include "RiaResultNames.h"
TEST( RiaResultNames, TestIsCategoryResult )
{
// Test for non-category result names
{
QString resultVariable = "FIPOIL";
bool result = RiaResultNames::isCategoryResult( resultVariable );
EXPECT_FALSE( result );
}
{
QString resultVariable = "FIPWAT";
bool result = RiaResultNames::isCategoryResult( resultVariable );
EXPECT_FALSE( result );
}
{
QString resultVariable = "FIPGAS";
bool result = RiaResultNames::isCategoryResult( resultVariable );
EXPECT_FALSE( result );
}
{
QString resultVariable = "SFIPGAS";
bool result = RiaResultNames::isCategoryResult( resultVariable );
EXPECT_FALSE( result );
}
{
QString resultVariable = "RFIPGAS";
bool result = RiaResultNames::isCategoryResult( resultVariable );
EXPECT_FALSE( result );
}
{
QString resultVariable = "RFIPGAS_P90";
bool result = RiaResultNames::isCategoryResult( resultVariable );
EXPECT_FALSE( result );
}
// Test for category result names
{
QString resultVariable = "MYNUM";
bool result = RiaResultNames::isCategoryResult( resultVariable );
EXPECT_TRUE( result );
}
{
QString resultVariable = "FIPMYPROP";
bool result = RiaResultNames::isCategoryResult( resultVariable );
EXPECT_TRUE( result );
}
}