#1312 Initial infrastructure for test

This commit is contained in:
Stein Inge Dale 2017-03-13 12:23:03 +01:00
parent 8175ae8efe
commit 8c8de5269f
2 changed files with 47 additions and 0 deletions

View File

@ -24,6 +24,7 @@ ${CEE_CURRENT_LIST_DIR}WellPathAsciiFileReader-Test.cpp
${CEE_CURRENT_LIST_DIR}opm-parser-Test.cpp
${CEE_CURRENT_LIST_DIR}opm-parser-Performance-Test.cpp
${CEE_CURRENT_LIST_DIR}opm-flowdiagnostics-Test.cpp
${CEE_CURRENT_LIST_DIR}HDF5FileReader-Test.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@ -0,0 +1,46 @@
#include "gtest/gtest.h"
#include "H5Cpp.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
/*
TEST(RimWellPathAsciiFileReaderTest, TestWellNameNoColon)
{
QTemporaryFile file;
if (file.open())
{
QString wellName = "My test Wellname";
{
QTextStream out(&file);
out << "name " << wellName << "\n";
out << "1 2 3";
}
RifWellPathAsciiFileReader reader;
RifWellPathAsciiFileReader::WellData wpData = reader.readWellData(file.fileName(), 0);
EXPECT_TRUE(wpData.m_name == wellName);
}
}
*/
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST(HDFTests, BasicFileRead)
{
std::string file_path;
// Check file exists
H5::H5File file(file_path, H5F_ACC_RDONLY);
H5::Group group = H5::Group(file.openGroup("name"));
/*
Group group = Group(file.openGroup(GROUP_NAME_FLOW_TRANSPORT));
auto dataset_exists = H5Lexists(group.getId(), "GRIDPROPTIME", H5F_ACC_RDONLY);
std::vector<std::vector<double>> sgas, soil, swat;
*/
}