Add test for unsupported keyword in FieldProps operations
This commit is contained in:
committed by
Williham Williham Totland
parent
3af6fac35d
commit
0f21752a7e
@@ -31,6 +31,7 @@
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <opm/common/utility/OpmInputError.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
|
||||
@@ -2219,3 +2220,76 @@ ADDREG
|
||||
BOOST_CHECK_THROW( FieldPropsManager(deck, Phases{true, true, true}, grid, TableManager()), std::logic_error );
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(OPERATION_VALID_KEYWORD) {
|
||||
std::string deck_string1 = R"(
|
||||
GRID
|
||||
|
||||
PORO
|
||||
200*0.15 /
|
||||
|
||||
REGIONS
|
||||
|
||||
FIPNUM
|
||||
200*1 /
|
||||
|
||||
MAXVALUE
|
||||
POROX 0.25 /
|
||||
/
|
||||
|
||||
)";
|
||||
|
||||
|
||||
std::string deck_string2 = R"(
|
||||
GRID
|
||||
|
||||
PORO
|
||||
200*0.15 /
|
||||
|
||||
REGIONS
|
||||
|
||||
FIPNUM
|
||||
200*1 /
|
||||
|
||||
MAXVALUE
|
||||
TRANX 0.25 /
|
||||
TRANY 0.25 /
|
||||
TRANZ 0.25 /
|
||||
/
|
||||
|
||||
)";
|
||||
|
||||
std::string deck_string3 = R"(
|
||||
GRID
|
||||
|
||||
PORO
|
||||
200*0.15 /
|
||||
|
||||
REGIONS
|
||||
|
||||
FIPXYZ
|
||||
200*1 /
|
||||
|
||||
MAXVALUE
|
||||
FIPXYZ 5 /
|
||||
/
|
||||
|
||||
)";
|
||||
EclipseGrid grid(10,10, 2);
|
||||
Deck deck1 = Parser{}.parseString(deck_string1);
|
||||
Deck deck2 = Parser{}.parseString(deck_string2);
|
||||
Deck deck3 = Parser{}.parseString(deck_string3);
|
||||
|
||||
// This case should throw because we refer to unsupported keyword POROX
|
||||
BOOST_CHECK_THROW( FieldPropsManager(deck1, Phases{true, true, true}, grid, TableManager()), OpmInputError );
|
||||
|
||||
// This is legitimate and should not throw; however the keywords TRANX,
|
||||
// TRANY and TRANZ are not supported in the normal sense and some special
|
||||
// casing will be required.
|
||||
BOOST_CHECK_NO_THROW( FieldPropsManager(deck2, Phases{true, true, true}, grid, TableManager()));
|
||||
|
||||
// This is legitimate and should not throw; however the FIPXYZ is an
|
||||
// autogenerated keyword and (maybe ??) not supported in the normal sense
|
||||
// and some special casing might be required.
|
||||
BOOST_CHECK_NO_THROW( FieldPropsManager(deck3, Phases{true, true, true}, grid, TableManager()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user