Added one-argument ParseContext constructor.

This commit is contained in:
Joakim Hove
2017-12-03 08:30:04 +01:00
parent adb017aec4
commit 22074a46bf
3 changed files with 24 additions and 0 deletions

View File

@@ -18,6 +18,7 @@
*/
#include <stdexcept>
#include <stdlib.h>
#include <iostream>
#include <boost/filesystem.hpp>
#define BOOST_TEST_MODULE ParseContextTests
@@ -406,3 +407,13 @@ BOOST_AUTO_TEST_CASE( test_too_much_data ) {
parseContext.update(ParseContext::PARSE_EXTRA_DATA , InputError::IGNORE );
auto deck = parser.parseString( deckString , parseContext );
}
BOOST_AUTO_TEST_CASE(test_1arg_constructor) {
setenv("OPM_ERRORS_IGNORE", "PARSE_RANDOM_SLASH", 1);
{
ParseContext ctx(InputError::WARN);
BOOST_CHECK_EQUAL(ctx.get(ParseContext::UNSUPPORTED_COMPORD_TYPE), InputError::WARN);
BOOST_CHECK_EQUAL(ctx.get(ParseContext::PARSE_RANDOM_SLASH), InputError::IGNORE);
}
}