get rid of the 'strict parsing' concept

this is the 'Joakim-style' variant of the patch, i.e., an exception
will always be thrown if an unknown keyword is encountered.
This commit is contained in:
Andreas Lauser
2014-09-01 20:35:40 +02:00
parent 994932738d
commit c1988ad8a3
11 changed files with 26 additions and 80 deletions

View File

@@ -101,33 +101,4 @@ BOOST_AUTO_TEST_CASE( KeywordInCorrectSection ) {
// this fails because of the incorrect BOX keyword
BOOST_CHECK(!Opm::checkDeck(deck, parserLog, Opm::SectionTopology | Opm::KeywordSection));
}
{
// deck contains an unknown keyword "FOO"
const char *incorrectDeckString =
"RUNSPEC\n"
"FOO\n"
"DIMENS\n"
"3 3 3 /\n"
"GRID\n"
"DXV\n"
"1 1 1 /\n"
"DYV\n"
"1 1 1 /\n"
"DZV\n"
"1 1 1 /\n"
"TOPS\n"
"9*100 /\n"
"PROPS\n"
"SOLUTION\n"
"SCHEDULE\n";
auto deck = parser->parseString(incorrectDeckString, /*strict=*/false);
Opm::ParserLogPtr parserLog(new Opm::ParserLog());
BOOST_CHECK(!Opm::checkDeck(deck, parserLog));
// this is supposed to succeed as we ensure everything except that all keywords
// are known
BOOST_CHECK(Opm::checkDeck(deck, parserLog, ~Opm::UnknownKeywords));
}
}