make default error_mode Bool

This commit is contained in:
ado
2020-12-27 17:00:06 +01:00
parent 5a1e5b3877
commit 918023496e
4 changed files with 9 additions and 8 deletions

View File

@@ -328,10 +328,10 @@ TEST_CASE("testing error mode") {
c.convert<int>("junk");
CHECK(!c.valid());
CHECK(!c.error_msg().empty());
CHECK(c.error_msg().empty());
c.set_error_mode(ss::error_mode::Bool);
c.set_error_mode(ss::error_mode::String);
c.convert<int>("junk");
CHECK(!c.valid());
CHECK(c.error_msg().empty());
CHECK(!c.error_msg().empty());
}

View File

@@ -186,6 +186,7 @@ TEST_CASE("testing composite conversion") {
}
ss::parser p{f.name, ","};
p.set_error_mode(ss::error_mode::String);
auto fail = [] { FAIL(""); };
auto expect_error = [](auto error) { CHECK(!error.empty()); };
@@ -452,12 +453,12 @@ TEST_CASE("testing error mode") {
REQUIRE(!p.eof());
p.get_next<int>();
CHECK(!p.valid());
CHECK(!p.error_msg().empty());
CHECK(p.error_msg().empty());
p.set_error_mode(ss::error_mode::Bool);
p.set_error_mode(ss::error_mode::String);
REQUIRE(!p.eof());
p.get_next<int>();
CHECK(!p.valid());
CHECK(p.error_msg().empty());
CHECK(!p.error_msg().empty());
}