Added parser error for 'random text'.

Previously random text in the input deck which was not formatted as a
valid keyword header was simply ignored; i.e. this

   DIMENS
     10 10 10 /

   Mohaha random gibbersih - not according to any Spec.

   GRID

Would suprisingly parse just fine. This will now be handled according
to the ParseMode::randomText setting. Observe that as a side effect of
this it turned out that many of the test datasets had additional
terminating slashes which were now detected as 'ranomdText'.
This commit is contained in:
Joakim Hove
2015-07-24 22:43:00 +02:00
parent 733af54777
commit 5e64d0f147
14 changed files with 199 additions and 84 deletions

View File

@@ -31,60 +31,55 @@
using namespace Opm;
const std::string& deckStr =
"RUNSPEC\n"
"DIMENS\n"
" 10 10 10 /\n"
"SOLUTION\n"
"RESTART\n"
"BASE 5\n"
"/\n"
"GRID\n"
"START -- 0 \n"
"19 JUN 2007 / \n"
"SCHEDULE\n"
"SKIPREST \n"
"/\n";
"RUNSPEC\n"
"DIMENS\n"
" 10 10 10 /\n"
"SOLUTION\n"
"RESTART\n"
"BASE 5\n"
"/\n"
"GRID\n"
"START -- 0 \n"
"19 JUN 2007 / \n"
"SCHEDULE\n"
"SKIPREST \n";
const std::string& deckStr2 =
"RUNSPEC\n"
"DIMENS\n"
" 10 10 10 /\n"
"SOLUTION\n"
"/\n"
"GRID\n"
"START -- 0 \n"
"19 JUN 2007 / \n"
"SCHEDULE\n"
"/\n";
"RUNSPEC\n"
"DIMENS\n"
" 10 10 10 /\n"
"SOLUTION\n"
"GRID\n"
"START -- 0 \n"
"19 JUN 2007 / \n"
"SCHEDULE\n";
const std::string& deckStr3 =
"RUNSPEC\n"
"DIMENS\n"
" 10 10 10 /\n"
"SOLUTION\n"
"RESTART\n"
"BASE 5 SAVE UNFORMATTED\n"
"/\n"
"GRID\n"
"START -- 0 \n"
"19 JUN 2007 / \n"
"SCHEDULE\n"
"SKIPREST \n"
"/\n";
"RUNSPEC\n"
"DIMENS\n"
" 10 10 10 /\n"
"SOLUTION\n"
"RESTART\n"
"BASE 5 SAVE UNFORMATTED /\n"
"GRID\n"
"START -- 0 \n"
"19 JUN 2007 / \n"
"SCHEDULE\n"
"SKIPREST \n";
const std::string& deckStr4 =
"RUNSPEC\n"
"DIMENS\n"
" 10 10 10 /\n"
"SOLUTION\n"
"RESTART\n"
"BASE 5\n"
"/\n"
"GRID\n"
"START -- 0 \n"
"19 JUN 2007 / \n"
"SCHEDULE\n"
"/\n";
"RUNSPEC\n"
"DIMENS\n"
" 10 10 10 /\n"
"SOLUTION\n"
"RESTART\n"
"BASE 5 /\n"
"GRID\n"
"START -- 0 \n"
"19 JUN 2007 / \n"
"SCHEDULE\n";
static DeckPtr createDeck(const std::string& input) {
Opm::Parser parser;