fix in unit test

This commit is contained in:
Paul
2023-05-22 17:27:20 +02:00
parent d6e73df9cf
commit d0be00d59e
2 changed files with 29 additions and 0 deletions

View File

@@ -264,6 +264,7 @@ BOOST_AUTO_TEST_CASE(createDeckWithGCONPROD) {
GCONPROD
'G1' 'ORAT' 10000 3* 'CON' /
'G2' 'RESV' 10000 3* 'CON' /
'G3' 'ORAT' 10000 3* 1* /
/)";
auto schedule = create_schedule(input);
@@ -271,12 +272,15 @@ BOOST_AUTO_TEST_CASE(createDeckWithGCONPROD) {
const auto& group1 = schedule.getGroup("G1", 0);
const auto& group2 = schedule.getGroup("G2", 0);
const auto& group3 = schedule.getGroup("G3", 0);
auto ctrl1 = group1.productionControls(st);
auto ctrl2 = group2.productionControls(st);
auto ctrl3 = group3.productionControls(st);
BOOST_CHECK(ctrl1.exceed_action == Group::ExceedAction::RATE);
BOOST_CHECK(ctrl2.exceed_action == Group::ExceedAction::CON);
BOOST_CHECK(ctrl3.exceed_action == Group::ExceedAction::NONE);
}

View File

@@ -1509,6 +1509,18 @@ BOOST_AUTO_TEST_CASE(createDeckModifyMultipleGCONPROD) {
GCONPROD
'G*' 'ORAT' 2000 0 0 0 'NONE' 'YES' 148 'OIL'/
/
DATES -- 3
10 DEC 2008 /
/
GCONPROD
'G*' 'ORAT' 2000 1000 0 0 'NONE' 'YES' 148 'OIL'/
/
DATES -- 4
10 JAN 2009 /
/
GCONPROD
'G*' 'ORAT' 2000 1000 0 0 'RATE' 'YES' 148 'OIL'/
/
)";
const auto& schedule = make_schedule(input);
@@ -1530,6 +1542,19 @@ BOOST_AUTO_TEST_CASE(createDeckModifyMultipleGCONPROD) {
BOOST_CHECK_EQUAL(g.productionControls(st).guide_rate, 148);
BOOST_CHECK_EQUAL(true, g.productionControls(st).guide_rate_def == Group::GuideRateProdTarget::OIL);
}
{
auto g = schedule.getGroup("G1", 3);
BOOST_CHECK_CLOSE(g.productionControls(st).oil_target, 2000 * siFactorL, 1e-13);
BOOST_CHECK(g.has_control(Group::ProductionCMode::ORAT));
BOOST_CHECK(!g.has_control(Group::ProductionCMode::WRAT));
}
{
auto g = schedule.getGroup("G1", 4);
BOOST_CHECK_CLOSE(g.productionControls(st).oil_target, 2000 * siFactorL, 1e-13);
BOOST_CHECK(g.has_control(Group::ProductionCMode::ORAT));
BOOST_CHECK_CLOSE(g.productionControls(st).water_target, 1000 * siFactorL, 1e-13);
BOOST_CHECK(g.has_control(Group::ProductionCMode::WRAT));
}
auto g2 = schedule.getGroup("G2", 2);
BOOST_CHECK_CLOSE(g2.productionControls(st).oil_target, 2000 * siFactorL, 1e-13);