diff --git a/opm/parser/eclipse/IntegrationTests/CMakeLists.txt b/opm/parser/eclipse/IntegrationTests/CMakeLists.txt index a50ca5b71..a9cd825a2 100644 --- a/opm/parser/eclipse/IntegrationTests/CMakeLists.txt +++ b/opm/parser/eclipse/IntegrationTests/CMakeLists.txt @@ -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 ) diff --git a/opm/parser/eclipse/IntegrationTests/ParseWCONHIST.cpp b/opm/parser/eclipse/IntegrationTests/ParseWCONHIST.cpp index 82de921c5..633937535 100644 --- a/opm/parser/eclipse/IntegrationTests/ParseWCONHIST.cpp +++ b/opm/parser/eclipse/IntegrationTests/ParseWCONHIST.cpp @@ -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)); } diff --git a/opm/parser/share/parser_config.json b/opm/parser/share/parser_config.json index 28ab769e0..3667c8891 100644 --- a/opm/parser/share/parser_config.json +++ b/opm/parser/share/parser_config.json @@ -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}, diff --git a/testdata/WCONHIST/WCONHIST1 b/testdata/WCONHIST/WCONHIST1 index cec6e6f29..e6ee8881f 100644 --- a/testdata/WCONHIST/WCONHIST1 +++ b/testdata/WCONHIST/WCONHIST1 @@ -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* / /