Can parse one isolated WCONHIST keyword

This commit is contained in:
Joakim Hove
2013-08-01 10:05:13 +02:00
parent a8d4a22894
commit 3bd3c7a306
4 changed files with 25 additions and 3 deletions

View File

@@ -5,6 +5,10 @@ target_link_libraries(runIntegrationTests Parser ${Boost_LIBRARIES})
add_test(NAME runIntegrationTests WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} COMMAND runIntegrationTests)
set_property(SOURCE IntegrationTests.cpp PROPERTY COMPILE_FLAGS "-Wno-error")
add_executable(runParseWCONHIST ParseWCONHIST.cpp)
target_link_libraries(runParseWCONHIST Parser ${Boost_LIBRARIES})
add_test(NAME runParseWCONHIST WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} COMMAND runParseWCONHIST)
add_executable(runIntegrationTestsInternalData IntegrationTestsInternalData.cpp)
target_link_libraries(runIntegrationTestsInternalData Parser ${Boost_LIBRARIES})
add_test(NAME runIntegrationTestsInternalData WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} COMMAND ${EXECUTABLE_OUTPUT_PATH}/runIntegrationTestsInternalData )

View File

@@ -36,4 +36,23 @@ BOOST_AUTO_TEST_CASE( parse_WCHONHIST_OK ) {
ParserPtr parser(new Parser(JSON_CONFIG_FILE));
boost::filesystem::path wconhistFile("testdata/WCONHIST/WCONHIST1");
DeckPtr deck = parser->parse(wconhistFile.string());
DeckKeywordConstPtr kw1 = deck->getKeyword("WCONHIST");
BOOST_CHECK_EQUAL( 3U , kw1->size() );
DeckRecordConstPtr rec1 = kw1->getRecord(0);
BOOST_CHECK_EQUAL( 11U , rec1->size() );
DeckRecordConstPtr rec3 = kw1->getRecord(2);
BOOST_CHECK_EQUAL( 11U , rec3->size() );
DeckItemConstPtr item1 = rec1->getItem("WellName");
DeckItemConstPtr item1_index = rec1->getItem(0);
BOOST_CHECK_EQUAL( item1 , item1_index );
BOOST_CHECK_EQUAL( "OP_1" , item1->getString(0));
item1 = rec3->getItem("WellName");
BOOST_CHECK_EQUAL( "OP_3" , item1->getString(0));
}

View File

@@ -22,7 +22,6 @@
{"name" : "Lift" , "size_type" : "SINGLE" , "value_type" : "FLOAT" , "default" : 0.0 , "comment":"The default is a state variable"},
{"name" : "THP" , "size_type" : "SINGLE" , "value_type" : "FLOAT" , "default" : 0.0},
{"name" : "BHP" , "size_type" : "SINGLE" , "value_type" : "FLOAT" , "default" : 0.0},
{"name" : "WGRAT" , "size_type" : "SINGLE" , "value_type" : "FLOAT" , "default" : 0.0},
{"name" : "NGLRAT" , "size_type" : "SINGLE" , "value_type" : "FLOAT" , "default" : 0.0}]},
{"name" : "START", "size" : 1},
{"name" : "GRIDOPTS", "size" : 1},

View File

@@ -1,5 +1,5 @@
WCONHIST
'OP_1' 'OPEN' 'ORAT' 4000.000 4.000 1.46402E+006 5* /
'OP_2' 'OPEN' 'ORAT' 7998.000 2.000 1461075.000 5* /
'OP_3' 'OPEN' 'ORAT' 7999.000 1.000 1471824.000 5* /
'OP_2' 'OPEN' 'ORAT' 7998.000 2.000 1461075.000 5* /
'OP_3' 'OPEN' 'ORAT' 7999.000 1.000 1471824.000 1 0.25 0.25 0.25 1* /
/