diff --git a/tests/test_RFT.cpp b/tests/test_RFT.cpp index 8cde5764b..18be6a3e0 100644 --- a/tests/test_RFT.cpp +++ b/tests/test_RFT.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include @@ -104,8 +104,8 @@ data::Solution createBlackoilState( int timeStepIdx, int numCells ) { BOOST_AUTO_TEST_CASE(test_RFT) { ParseContext parse_context; std::string eclipse_data_filename = "testrft.DATA"; - ERT::TestArea test_area("test_RFT"); - test_area.copyFile( eclipse_data_filename ); + test_work_area_type * test_area = test_work_area_alloc("test_RFT"); + test_work_area_copy_file( test_area, eclipse_data_filename.c_str() ); auto deck = Parser().parseFile( eclipse_data_filename, parse_context ); auto eclipseState = Parser::parse( deck ); @@ -162,6 +162,7 @@ BOOST_AUTO_TEST_CASE(test_RFT) { } verifyRFTFile("TESTRFT.RFT"); + test_work_area_free( test_area ); } namespace { @@ -191,8 +192,8 @@ void verifyRFTFile2(const std::string& rft_filename) { BOOST_AUTO_TEST_CASE(test_RFT2) { ParseContext parse_context; std::string eclipse_data_filename = "testrft.DATA"; - ERT::TestArea test_area("test_RFT"); - test_area.copyFile( eclipse_data_filename ); + test_work_area_type * test_area = test_work_area_alloc("test_RFT"); + test_work_area_copy_file( test_area, eclipse_data_filename.c_str()); auto deck = Parser().parseFile( eclipse_data_filename, parse_context ); auto eclipseState = Parser::parse( deck ); @@ -253,4 +254,5 @@ BOOST_AUTO_TEST_CASE(test_RFT2) { verifyRFTFile2("TESTRFT.RFT"); } } + test_work_area_free( test_area ); } diff --git a/tests/test_Restart.cpp b/tests/test_Restart.cpp index aeefc2518..9e1c3bd13 100644 --- a/tests/test_Restart.cpp +++ b/tests/test_Restart.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include using namespace Opm; @@ -418,8 +418,8 @@ BOOST_AUTO_TEST_CASE(EclipseReadWriteWellStateData) { {"SWAT" , UnitSystem::measure::identity}, {"SGAS" , UnitSystem::measure::identity}, {"TEMP" , UnitSystem::measure::temperature}}; - ERT::TestArea testArea("test_Restart"); - testArea.copyFile( "FIRST_SIM.DATA" ); + test_work_area_type * test_area = test_work_area_alloc("test_restart"); + test_work_area_copy_file( test_area, "FIRST_SIM.DATA"); Setup setup("FIRST_SIM.DATA"); EclipseIO eclWriter( setup.es, setup.grid, setup.schedule, setup.summary_config); @@ -429,6 +429,7 @@ BOOST_AUTO_TEST_CASE(EclipseReadWriteWellStateData) { BOOST_CHECK_THROW( second_sim( eclWriter, {{"SOIL", UnitSystem::measure::pressure}} ) , std::runtime_error ); BOOST_CHECK_THROW( second_sim( eclWriter, {{"SOIL", UnitSystem::measure::pressure, true}}) , std::runtime_error ); + test_work_area_free( test_area ); } @@ -462,21 +463,22 @@ BOOST_AUTO_TEST_CASE(EclipseReadWriteWellStateData_double) { std::vector solution_keys {RestartKey("SWAT", UnitSystem::measure::identity), RestartKey("SGAS", UnitSystem::measure::identity)}; - ERT::TestArea testArea("test_Restart"); - testArea.copyFile( "FIRST_SIM.DATA" ); - + test_work_area_type * test_area = test_work_area_alloc("test_Restart"); + test_work_area_copy_file( test_area, "FIRST_SIM.DATA"); Setup setup("FIRST_SIM.DATA"); EclipseIO eclWriter( setup.es, setup.grid, setup.schedule, setup.summary_config); auto state1 = first_sim( setup.es , eclWriter , true); auto state2 = second_sim( eclWriter , solution_keys ); compare_equal( state1 , state2 , solution_keys); + test_work_area_free( test_area ); } + BOOST_AUTO_TEST_CASE(WriteWrongSOlutionSize) { Setup setup("FIRST_SIM.DATA"); + test_work_area_type * test_area = test_work_area_alloc("test_Restart"); { - ERT::TestArea testArea("test_Restart"); auto num_cells = setup.grid.getNumActive( ) + 1; auto cells = mkSolution( num_cells ); auto wells = mkWells(); @@ -489,6 +491,7 @@ BOOST_AUTO_TEST_CASE(WriteWrongSOlutionSize) { setup.schedule), std::runtime_error); } + test_work_area_free(test_area); } @@ -514,8 +517,8 @@ BOOST_AUTO_TEST_CASE(ExtraData_KEYS) { BOOST_AUTO_TEST_CASE(ExtraData_content) { Setup setup("FIRST_SIM.DATA"); + test_work_area_type * test_area = test_work_area_alloc("test_Restart"); { - ERT::TestArea testArea("test_Restart"); auto num_cells = setup.grid.getNumActive( ); auto cells = mkSolution( num_cells ); auto wells = mkWells(); @@ -566,13 +569,14 @@ BOOST_AUTO_TEST_CASE(ExtraData_content) { } } } + test_work_area_free(test_area); } BOOST_AUTO_TEST_CASE(STORE_THPRES) { Setup setup("FIRST_SIM_THPRES.DATA"); + test_work_area_type * test_area = test_work_area_alloc("test_Restart_THPRES"); { - ERT::TestArea testArea("test_Restart_THPRES"); auto num_cells = setup.grid.getNumActive( ); auto cells = mkSolution( num_cells ); auto wells = mkWells(); @@ -632,6 +636,7 @@ BOOST_AUTO_TEST_CASE(STORE_THPRES) { } } + test_work_area_free(test_area); } diff --git a/tests/test_Summary.cpp b/tests/test_Summary.cpp index 2dd5c21c6..aef2efd50 100644 --- a/tests/test_Summary.cpp +++ b/tests/test_Summary.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include @@ -181,7 +181,7 @@ struct setup { SummaryConfig config; data::Wells wells; std::string name; - ERT::TestArea ta; + test_work_area_type * ta; /*-----------------------------------------------------------------*/ @@ -193,10 +193,14 @@ struct setup { config( deck, schedule, es.getTableManager(), parseContext ), wells( result_wells() ), name( fname ), - ta( ERT::TestArea("test_summary") ) + ta( test_work_area_alloc("summary_test")) { } + ~setup() { + test_work_area_free(this->ta); + } + }; BOOST_AUTO_TEST_SUITE(Summary)