Skip to content

Commit 99f85b4

Browse files
author
Blake Gross
committed
Fixed Eror in unit tests wher exception did not throw correclty
1 parent 343e6a3 commit 99f85b4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Release/tests/functional/json/parsing_tests.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,26 @@ TEST(non_default_locale)
613613
}
614614
}
615615

616+
TEST(parse_overload_success)
617+
{
618+
std::error_code err;
619+
utility::string_t str(U("/JSONString/"));
620+
json::value parsedObject = json::value::parse(str, err);
621+
622+
VERIFY_IS_TRUE(err.value() == 0);
623+
VERIFY_IS_TRUE(!parsedObject.is_null());
624+
}
625+
626+
TEST(parse_overload_failed)
627+
{
628+
std::error_code err;
629+
utility::string_t str(U("JSONString"));
630+
json::value parsedObject = json::value::parse(str, err);
631+
632+
VERIFY_IS_TRUE(err.value() > 0);
633+
VERIFY_IS_TRUE(parsedObject.is_null());
634+
}
635+
616636
} // SUITE(parsing_tests)
617637

618638
}}}

0 commit comments

Comments
 (0)