Prevent std::exit(1) in tests due to ErrorGuard's destructor.
If ErrorGuard's lists have not been cleared, then it's destructor will call std::exit(1). As that is quite unfortunate in a test, we clear it's message stack at the end of the tests.
This commit is contained in:
@@ -253,6 +253,9 @@ BOOST_AUTO_TEST_CASE(Section_ValidDecks) {
|
||||
"TEST8\n";
|
||||
|
||||
BOOST_CHECK(Opm::DeckSection::checkSectionTopology( parser.parseString( with_opt, mode, errors ), parser, errors));
|
||||
// prevent std::exit(1) in ErrorGuard's destructor!
|
||||
errors.dump();
|
||||
errors.clear();
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Section_InvalidDecks) {
|
||||
@@ -390,4 +393,7 @@ BOOST_AUTO_TEST_CASE(Section_InvalidDecks) {
|
||||
"TEST4\n";
|
||||
|
||||
BOOST_CHECK(!Opm::DeckSection::checkSectionTopology( parser.parseString( missing_SCHEDULE, mode, errors ), parser, errors));
|
||||
// prevent std::exit(1) in ErrorGuard's destructor!
|
||||
errors.dump();
|
||||
errors.clear();
|
||||
}
|
||||
|
||||
@@ -102,4 +102,7 @@ BOOST_AUTO_TEST_CASE( KeywordInCorrectSection ) {
|
||||
// this fails because of the incorrect BOX keyword
|
||||
BOOST_CHECK(!Opm::checkDeck(deck, parser, parseContext, errorGuard, Opm::SectionTopology | Opm::KeywordSection));
|
||||
}
|
||||
// prevent std::exit(1) in ErrorGuard's destructor!
|
||||
errorGuard.dump();
|
||||
errorGuard.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user