mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 08:25:03 -05:00
#4169 Saturation-Pressure plot : Add more tests
This commit is contained in:
1 parent
6440d8106b
commit
11ae710be9
2 files changed
+86
-12
No files matched your search
@@ -200,12 +200,12 @@ TEST(RifEclipseInputFileToolsTest, EquilData)
|
|||||||
includeStatementAbsolutePathPrefix);
|
includeStatementAbsolutePathPrefix);
|
||||||
EXPECT_EQ((int)10, keywordContent.size());
|
EXPECT_EQ((int)10, keywordContent.size());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
for (const auto& s : keywordContent)
|
for (const auto& s : keywordContent)
|
||||||
{
|
{
|
||||||
qDebug() << s;
|
qDebug() << s;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,11 +248,73 @@ TEST(RifEclipseInputFileToolsTest, FaultData)
|
|||||||
|
|
||||||
EXPECT_EQ((int)1041, keywordContent.size());
|
EXPECT_EQ((int)1041, keywordContent.size());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
for (const auto& s : keywordContent)
|
for (const auto& s : keywordContent)
|
||||||
{
|
{
|
||||||
qDebug() << s;
|
qDebug() << s;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
TEST(RifEclipseInputFileToolsTest, StopAtKeyword)
|
||||||
|
{
|
||||||
|
static const QString testDataRootFolder = QString("%1/ParsingOfDataKeywords/").arg(TEST_DATA_DIR);
|
||||||
|
QString fileName = testDataRootFolder + "simulation/MY_CASE_2.DATA";
|
||||||
|
|
||||||
|
QFile data(fileName);
|
||||||
|
if (!data.open(QFile::ReadOnly))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const QString keyword("FAULTS");
|
||||||
|
const QString keywordToStopParsing("EDIT");
|
||||||
|
const qint64 startPositionInFile = 0;
|
||||||
|
std::vector<std::pair<QString, QString>> pathAliasDefinitions;
|
||||||
|
QStringList keywordContent;
|
||||||
|
std::vector<QString> fileNamesContainingKeyword;
|
||||||
|
bool isStopParsingKeywordDetected = false;
|
||||||
|
const QString includeStatementAbsolutePathPrefix;
|
||||||
|
|
||||||
|
RifEclipseInputFileTools::readKeywordAndParseIncludeStatementsRecursively(keyword,
|
||||||
|
keywordToStopParsing,
|
||||||
|
data,
|
||||||
|
startPositionInFile,
|
||||||
|
pathAliasDefinitions,
|
||||||
|
&keywordContent,
|
||||||
|
&fileNamesContainingKeyword,
|
||||||
|
&isStopParsingKeywordDetected,
|
||||||
|
includeStatementAbsolutePathPrefix);
|
||||||
|
|
||||||
|
EXPECT_TRUE(isStopParsingKeywordDetected);
|
||||||
|
EXPECT_TRUE(keywordContent.isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const QString keyword("EQUIL");
|
||||||
|
const QString keywordToStopParsing("SCHEDULE");
|
||||||
|
const qint64 startPositionInFile = 0;
|
||||||
|
std::vector<std::pair<QString, QString>> pathAliasDefinitions;
|
||||||
|
QStringList keywordContent;
|
||||||
|
std::vector<QString> fileNamesContainingKeyword;
|
||||||
|
bool isStopParsingKeywordDetected = false;
|
||||||
|
const QString includeStatementAbsolutePathPrefix;
|
||||||
|
|
||||||
|
RifEclipseInputFileTools::readKeywordAndParseIncludeStatementsRecursively(keyword,
|
||||||
|
keywordToStopParsing,
|
||||||
|
data,
|
||||||
|
startPositionInFile,
|
||||||
|
pathAliasDefinitions,
|
||||||
|
&keywordContent,
|
||||||
|
&fileNamesContainingKeyword,
|
||||||
|
&isStopParsingKeywordDetected,
|
||||||
|
includeStatementAbsolutePathPrefix);
|
||||||
|
EXPECT_TRUE(isStopParsingKeywordDetected);
|
||||||
|
EXPECT_TRUE(keywordContent.isEmpty());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
EDIT
|
||||||
|
-- searching for faults stops when EDIT keyword is detected
|
||||||
|
INCLUDE
|
||||||
|
'../include/grid/FAULT_JUN_05.INC'/
|
||||||
|
|
||||||
|
SCHEDULE
|
||||||
|
|
||||||
|
-- searching for EQUIL stops when SCHEDULE keyword is detected
|
||||||
|
INCLUDE
|
||||||
|
'../include/solution/equilibiration.inc' /
|
||||||
Reference in new issue
Block a user