mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-21 22:13:25 -06:00
#4169 Saturation-Pressure plot : Whitespace
This commit is contained in:
parent
42f93d3a5a
commit
6440d8106b
@ -8,38 +8,20 @@
|
||||
#include <QFile>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/*
|
||||
TEST(RifEclipseInputFileToolsTest, PathsKeyword)
|
||||
{
|
||||
QString filename = "d:/Models/Statoil/troll_Ref2014/T07-4A-W2014-06.DATA";
|
||||
//QString filename = "d:/Models/Statoil/!myTestWithWellLog/TEST10K_FLT_LGR_NNC.DATA";
|
||||
|
||||
std::vector<std::pair<QString, QString>> pathEntries;
|
||||
|
||||
RifEclipseInputFileTools::parseAndReadPathAliasKeyword(filename, &pathEntries);
|
||||
|
||||
for (auto entry : pathEntries)
|
||||
{
|
||||
qDebug() << entry.first << " " << entry.second;
|
||||
}
|
||||
|
||||
std::vector<QString> filenamesWithFaults;
|
||||
cvf::Collection<RigFault> faults;
|
||||
RifEclipseInputFileTools::readFaultsInGridSection(filename, &faults, &filenamesWithFaults);
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST(RifEclipseInputFileToolsTest, FaultFaces)
|
||||
{
|
||||
{
|
||||
QStringList faceTexts;
|
||||
faceTexts << "X" << "X+" << "I" << "I+" << "x" << "x+" << "i" << "i+";
|
||||
faceTexts << "X"
|
||||
<< "X+"
|
||||
<< "I"
|
||||
<< "I+"
|
||||
<< "x"
|
||||
<< "x+"
|
||||
<< "i"
|
||||
<< "i+";
|
||||
|
||||
cvf::StructGridInterface::FaceEnum faceType;
|
||||
foreach (QString text, faceTexts)
|
||||
@ -51,10 +33,13 @@ TEST(RifEclipseInputFileToolsTest, FaultFaces)
|
||||
|
||||
{
|
||||
QStringList faceTexts;
|
||||
faceTexts << "X-" << "I-" << "x-" << "i-";
|
||||
faceTexts << "X-"
|
||||
<< "I-"
|
||||
<< "x-"
|
||||
<< "i-";
|
||||
|
||||
cvf::StructGridInterface::FaceEnum faceType;
|
||||
foreach(QString text, faceTexts)
|
||||
foreach (QString text, faceTexts)
|
||||
{
|
||||
faceType = RifEclipseInputFileTools::faceEnumFromText(text);
|
||||
EXPECT_EQ(cvf::StructGridInterface::NEG_I, faceType);
|
||||
@ -63,10 +48,17 @@ TEST(RifEclipseInputFileToolsTest, FaultFaces)
|
||||
|
||||
{
|
||||
QStringList faceTexts;
|
||||
faceTexts << "Y" << "Y+" << "J" << "J+" << "y" << "y+" << "j" << "j+";
|
||||
faceTexts << "Y"
|
||||
<< "Y+"
|
||||
<< "J"
|
||||
<< "J+"
|
||||
<< "y"
|
||||
<< "y+"
|
||||
<< "j"
|
||||
<< "j+";
|
||||
|
||||
cvf::StructGridInterface::FaceEnum faceType;
|
||||
foreach(QString text, faceTexts)
|
||||
foreach (QString text, faceTexts)
|
||||
{
|
||||
faceType = RifEclipseInputFileTools::faceEnumFromText(text);
|
||||
EXPECT_EQ(cvf::StructGridInterface::POS_J, faceType);
|
||||
@ -75,10 +67,13 @@ TEST(RifEclipseInputFileToolsTest, FaultFaces)
|
||||
|
||||
{
|
||||
QStringList faceTexts;
|
||||
faceTexts << "Y-" << "J-" << "y-" << "j-";
|
||||
faceTexts << "Y-"
|
||||
<< "J-"
|
||||
<< "y-"
|
||||
<< "j-";
|
||||
|
||||
cvf::StructGridInterface::FaceEnum faceType;
|
||||
foreach(QString text, faceTexts)
|
||||
foreach (QString text, faceTexts)
|
||||
{
|
||||
faceType = RifEclipseInputFileTools::faceEnumFromText(text);
|
||||
EXPECT_EQ(cvf::StructGridInterface::NEG_J, faceType);
|
||||
@ -87,10 +82,17 @@ TEST(RifEclipseInputFileToolsTest, FaultFaces)
|
||||
|
||||
{
|
||||
QStringList faceTexts;
|
||||
faceTexts << "Z" << "Z+" << "K" << "k+" << "z" << "z+" << "k" << "k+";
|
||||
faceTexts << "Z"
|
||||
<< "Z+"
|
||||
<< "K"
|
||||
<< "k+"
|
||||
<< "z"
|
||||
<< "z+"
|
||||
<< "k"
|
||||
<< "k+";
|
||||
|
||||
cvf::StructGridInterface::FaceEnum faceType;
|
||||
foreach(QString text, faceTexts)
|
||||
foreach (QString text, faceTexts)
|
||||
{
|
||||
faceType = RifEclipseInputFileTools::faceEnumFromText(text);
|
||||
EXPECT_EQ(cvf::StructGridInterface::POS_K, faceType);
|
||||
@ -99,37 +101,44 @@ TEST(RifEclipseInputFileToolsTest, FaultFaces)
|
||||
|
||||
{
|
||||
QStringList faceTexts;
|
||||
faceTexts << "Z-" << "K-" << "z-" << "k-";
|
||||
faceTexts << "Z-"
|
||||
<< "K-"
|
||||
<< "z-"
|
||||
<< "k-";
|
||||
|
||||
cvf::StructGridInterface::FaceEnum faceType;
|
||||
foreach(QString text, faceTexts)
|
||||
foreach (QString text, faceTexts)
|
||||
{
|
||||
faceType = RifEclipseInputFileTools::faceEnumFromText(text);
|
||||
EXPECT_EQ(cvf::StructGridInterface::NEG_K, faceType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Improved parsing handling some special cases
|
||||
{
|
||||
QStringList faceTexts;
|
||||
faceTexts << "Z--" << "z--" << "z/" << " y /";
|
||||
faceTexts << "Z--"
|
||||
<< "z--"
|
||||
<< "z/"
|
||||
<< " y /";
|
||||
|
||||
cvf::StructGridInterface::FaceEnum faceType;
|
||||
foreach(QString text, faceTexts)
|
||||
foreach (QString text, faceTexts)
|
||||
{
|
||||
faceType = RifEclipseInputFileTools::faceEnumFromText(text);
|
||||
EXPECT_NE(cvf::StructGridInterface::NO_FACE, faceType);
|
||||
}
|
||||
}
|
||||
|
||||
//Invalid faces
|
||||
// Invalid faces
|
||||
{
|
||||
QStringList faceTexts;
|
||||
faceTexts << "-k-" << " -k " << " +k- ";
|
||||
faceTexts << "-k-"
|
||||
<< " -k "
|
||||
<< " +k- ";
|
||||
|
||||
cvf::StructGridInterface::FaceEnum faceType;
|
||||
foreach(QString text, faceTexts)
|
||||
foreach (QString text, faceTexts)
|
||||
{
|
||||
faceType = RifEclipseInputFileTools::faceEnumFromText(text);
|
||||
EXPECT_EQ(cvf::StructGridInterface::NO_FACE, faceType);
|
||||
@ -139,16 +148,18 @@ TEST(RifEclipseInputFileToolsTest, FaultFaces)
|
||||
// Valid cases with whitespace
|
||||
{
|
||||
QStringList faceTexts;
|
||||
faceTexts << " X" << " X+ " << " I " << " i+ ";
|
||||
faceTexts << " X"
|
||||
<< " X+ "
|
||||
<< " I "
|
||||
<< " i+ ";
|
||||
|
||||
cvf::StructGridInterface::FaceEnum faceType;
|
||||
foreach(QString text, faceTexts)
|
||||
foreach (QString text, faceTexts)
|
||||
{
|
||||
faceType = RifEclipseInputFileTools::faceEnumFromText(text);
|
||||
EXPECT_EQ(cvf::StructGridInterface::POS_I, faceType);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -187,11 +198,14 @@ TEST(RifEclipseInputFileToolsTest, EquilData)
|
||||
&fileNamesContainingKeyword,
|
||||
&isEditKeywordDetected,
|
||||
includeStatementAbsolutePathPrefix);
|
||||
EXPECT_EQ((int)10, keywordContent.size());
|
||||
|
||||
/*
|
||||
for (const auto& s : keywordContent)
|
||||
{
|
||||
qDebug() << s;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -231,9 +245,14 @@ TEST(RifEclipseInputFileToolsTest, FaultData)
|
||||
&fileNamesContainingKeyword,
|
||||
&isEditKeywordDetected,
|
||||
includeStatementAbsolutePathPrefix);
|
||||
|
||||
EXPECT_EQ((int)1041, keywordContent.size());
|
||||
|
||||
/*
|
||||
for (const auto& s : keywordContent)
|
||||
{
|
||||
qDebug() << s;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user