MCPcopy Create free account
hub / github.com/boostorg/json / testFreeFunctions

Method testFreeFunctions

test/stream_parser.cpp:974–1044  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

972 //------------------------------------------------------
973
974 void
975 testFreeFunctions()
976 {
977 string_view const js =
978 "{\"1\":{},\"2\":[],\"3\":\"x\",\"4\":1,"
979 "\"5\":-1,\"6\":1.0,\"7\":false,\"8\":null}";
980
981 // parse(string_view, system::error_code)
982 {
983 {
984 system::error_code ec;
985 auto jv = parse(js, ec);
986 BOOST_TEST(! ec);
987 check_round_trip(jv);
988 }
989 {
990 system::error_code ec;
991 auto jv = parse("xxx", ec);
992 BOOST_TEST(ec);
993 BOOST_TEST(ec.has_location());
994 BOOST_TEST(jv.is_null());
995 }
996 }
997
998 // parse(string_view, storage_ptr, system::error_code)
999 {
1000 {
1001 system::error_code ec;
1002 monotonic_resource mr;
1003 auto jv = parse(js, ec, &mr);
1004 BOOST_TEST(! ec);
1005 //check_round_trip(jv);
1006 }
1007
1008 {
1009 system::error_code ec;
1010 monotonic_resource mr;
1011 auto jv = parse("xxx", ec, &mr);
1012 BOOST_TEST(ec);
1013 BOOST_TEST(ec.has_location());
1014 BOOST_TEST(jv.is_null());
1015 }
1016 }
1017
1018 // parse(string_view)
1019 {
1020 {
1021 check_round_trip(
1022 parse(js));
1023 }
1024
1025 {
1026 value jv;
1027 BOOST_TEST_THROWS_WITH_LOCATION( jv = parse("{,") );
1028 }
1029 }
1030
1031 // parse(string_view, storage_ptr)

Callers

nothing calls this directly

Calls 1

is_nullMethod · 0.80

Tested by

no test coverage detected