mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3588 Intersect : Add support for import of Intersect data
This commit is contained in:
43
ApplicationCode/UnitTests/Intersect-Test.cpp
Normal file
43
ApplicationCode/UnitTests/Intersect-Test.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "RifEclipseOutputFileTools.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include "ert/ecl/ecl_file.h"
|
||||
#include "ert/ecl/ecl_kw_magic.h"
|
||||
#include "ert/ecl/ecl_kw.hpp"
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST(IntersectDataImport, DISABLED_TestImportPORV)
|
||||
{
|
||||
QString baseFolder = "d:/Models/Statoil/IX_output_files/";
|
||||
QString filename = baseFolder + "NORNE_IX2.INIT";
|
||||
|
||||
std::string porv_kw("PORV");
|
||||
|
||||
ecl_file_type* ecl_file = ecl_file_open(filename.toStdString().data(), ECL_FILE_CLOSE_STREAM);
|
||||
|
||||
bool isIntersect = RifEclipseOutputFileTools::isExportedFromIntersect(ecl_file);
|
||||
EXPECT_TRUE(isIntersect);
|
||||
|
||||
if (ecl_file_has_kw(ecl_file, porv_kw.data()))
|
||||
{
|
||||
ecl_file_load_all(ecl_file);
|
||||
|
||||
int keywordCount = ecl_file_get_num_named_kw(ecl_file, porv_kw.data());
|
||||
for (int index = 0; index < keywordCount; index++)
|
||||
{
|
||||
auto fileKeyword = ecl_file_iget_named_file_kw(ecl_file, porv_kw.data(), index);
|
||||
|
||||
float porvThreshold = 0.0f;
|
||||
auto actnumFromPorv = ecl_kw_alloc_actnum(ecl_file_kw_get_kw_ptr(fileKeyword), porvThreshold);
|
||||
|
||||
EXPECT_TRUE(actnumFromPorv != nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user