mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7912 Summary Data Import : Map from eclAdr to keyword
This commit is contained in:
@@ -79,6 +79,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler-Test.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator-Test.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/StructGridInterface-Test.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/opm-summary-Test.cpp
|
||||
)
|
||||
|
||||
if(RESINSIGHT_ENABLE_GRPC)
|
||||
|
||||
53
ApplicationLibCode/UnitTests/opm-summary-Test.cpp
Normal file
53
ApplicationLibCode/UnitTests/opm-summary-Test.cpp
Normal file
@@ -0,0 +1,53 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "RiaTestDataDirectory.h"
|
||||
#include "RifOpmCommonSummary.h"
|
||||
|
||||
#include "opm/io/eclipse/ESmry.hpp"
|
||||
#include "opm/io/eclipse/ExtESmry.hpp"
|
||||
|
||||
static const QString H5_TEST_DATA_DIRECTORY = QString( "%1/h5-file/" ).arg( TEST_DATA_DIR );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST( DISABLED_OpmSummaryTests, ReadOpmSummaryDataListContent )
|
||||
{
|
||||
std::vector<std::string> esmryKeywords;
|
||||
{
|
||||
QString filePath = H5_TEST_DATA_DIRECTORY + "NORNE_ATW2013_RFTPLT_V2.SMSPEC";
|
||||
|
||||
Opm::EclIO::ESmry eSmry( filePath.toStdString() );
|
||||
|
||||
esmryKeywords = eSmry.keywordList();
|
||||
eSmry.make_esmry_file();
|
||||
}
|
||||
|
||||
std::vector<std::string> extEsmryKeywords;
|
||||
{
|
||||
QString filePath = H5_TEST_DATA_DIRECTORY + "NORNE_ATW2013_RFTPLT_V2.ESMRY";
|
||||
|
||||
Opm::EclIO::ExtESmry extEsmry( filePath.toStdString() );
|
||||
|
||||
extEsmryKeywords = extEsmry.keywordList();
|
||||
}
|
||||
|
||||
EXPECT_EQ( esmryKeywords.size(), extEsmryKeywords.size() );
|
||||
for ( size_t i = 0; i < esmryKeywords.size(); i++ )
|
||||
{
|
||||
auto s1 = esmryKeywords[i];
|
||||
auto s2 = extEsmryKeywords[i];
|
||||
EXPECT_STREQ( s1.c_str(), s2.c_str() );
|
||||
|
||||
RifEclipseSummaryAddress eclAdr = RifEclipseSummaryAddress::fromEclipseTextAddress( s1 );
|
||||
EXPECT_TRUE( eclAdr.isValid() );
|
||||
}
|
||||
|
||||
/*
|
||||
auto keywords = eSmry.keywordList();
|
||||
for ( auto k : keywords )
|
||||
{
|
||||
std::cout << k << "\n";
|
||||
}
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user