diff --git a/tests/test_wellsmanager.cpp b/tests/test_wellsmanager.cpp index ff1d21001..9b0a87189 100644 --- a/tests/test_wellsmanager.cpp +++ b/tests/test_wellsmanager.cpp @@ -172,6 +172,23 @@ void check_controls_epoch1( struct WellControls ** ctrls) { } } + +void check_controls_epoch3( struct WellControls ** ctrls) { + // The new producer + const struct WellControls * ctrls1 = ctrls[1]; + const struct WellControls * ctrls2 = ctrls[2]; + + + BOOST_CHECK_EQUAL( 0 , well_controls_get_num(ctrls1)); + BOOST_CHECK( well_controls_well_is_shut( ctrls1)); + + BOOST_CHECK_EQUAL( 0 , well_controls_get_num(ctrls2)); + BOOST_CHECK( well_controls_well_is_shut(ctrls2)); +} + + + + BOOST_AUTO_TEST_CASE(New_Constructor_Works) { const std::string filename = "wells_manager_data.data"; @@ -192,6 +209,20 @@ BOOST_AUTO_TEST_CASE(New_Constructor_Works) { wells_static_check( wellsManager.c_wells() ); check_controls_epoch1( wellsManager.c_wells()->ctrls ); } + + + { + Opm::WellsManager wellsManager(eclipseState, 3, *gridManager.c_grid(), NULL); + const Wells* wells = wellsManager.c_wells(); + + BOOST_CHECK_EQUAL(3 , wells->number_of_wells); + BOOST_CHECK_EQUAL( wells->name[0] , "INJ1"); + BOOST_CHECK_EQUAL( wells->name[1] , "PROD1"); + BOOST_CHECK_EQUAL( wells->name[2] , "NEW"); + + check_controls_epoch3( wellsManager.c_wells()->ctrls ); + } + } diff --git a/tests/wells_manager_data.data b/tests/wells_manager_data.data index 3eb03594f..320d6e997 100755 --- a/tests/wells_manager_data.data +++ b/tests/wells_manager_data.data @@ -43,7 +43,7 @@ WCONINJE / -DATES +DATES -- Step1 1 'FEB' 2000 / / @@ -56,15 +56,50 @@ WCONINJE / -DATES +DATES -- Step2 1 'MAR' 2000 / / WCONPROD - 'PROD1' 'SHUT' 15* / + 'PROD1' 'SHUT' / / +DATES -- Step3 + 1 'APR' 2000 / +/ + +WELSPECS + 'NEW' 'G' 2 2 1* 'OIL' 2* 'STOP' 4* / +/ + +COMPDAT + 'NEW' 2 2 2 2 'OPEN' 1 10.6092 0.5 / +/ + + +WCONHIST + 'NEW' 'OPEN' 'ORAT' 0.000 0.000 0.000 5* / +/ + + + +WCONPROD + 'NEW' 'SHUT' / +/ + + + + + +WCONPROD + 'PROD1' 'SHUT' / +/ + + + + + END