From f3a4029195af7332e160dd0e58722fd56946ad10 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Tue, 7 Feb 2017 14:40:11 +0100 Subject: [PATCH] Added test of require3D functionality from Summary --- tests/test_Summary.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/test_Summary.cpp b/tests/test_Summary.cpp index 763a645af..61c12c772 100644 --- a/tests/test_Summary.cpp +++ b/tests/test_Summary.cpp @@ -814,3 +814,40 @@ BOOST_AUTO_TEST_CASE(BLOCK_VARIABLES) { // Cell is not active BOOST_CHECK( !ecl_sum_has_general_var( resp , "BPR:2,1,10")); } + + + +/* + The SummaryConfig.require3DField( ) implementation is slightly ugly: + + 1. Which 3D fields are required is implicitly given by the + implementation of the Summary() class here in opm-output. + + 2. The implementation of the SummaryConfig.require3DField( ) is + based on a hardcoded list in SummaryConfig.cpp - i.e. there is a + inverse dependency between the opm-parser and opm-output modules. + + The test here just to ensure that *something* breaks if the + opm-parser implementation is changed/removed. +*/ + + + +BOOST_AUTO_TEST_CASE( require3D ) +{ + setup cfg( "XXXX" ); + const auto summaryConfig = cfg.es.getSummaryConfig( ); + + BOOST_CHECK( summaryConfig.require3DField( "PRESSURE" )); + BOOST_CHECK( summaryConfig.require3DField( "SGAS" )); + BOOST_CHECK( summaryConfig.require3DField( "SWAT" )); + BOOST_CHECK( summaryConfig.require3DField( "WIP" )); + BOOST_CHECK( summaryConfig.require3DField( "GIP" )); + BOOST_CHECK( summaryConfig.require3DField( "OIP" )); + BOOST_CHECK( summaryConfig.require3DField( "OIPL" )); + BOOST_CHECK( summaryConfig.require3DField( "OIPG" )); + BOOST_CHECK( summaryConfig.require3DField( "GIPL" )); + BOOST_CHECK( summaryConfig.require3DField( "GIPG" )); + + BOOST_CHECK( summaryConfig.requireFIPNUM( )); +}