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

Method testHash

test/value.cpp:2499–2547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2497 }
2498
2499 void
2500 testHash()
2501 {
2502 BOOST_TEST(check_hash_equal(value(nullptr), value(nullptr)));
2503 BOOST_TEST(check_hash_equal(value(nullptr), value()));
2504 BOOST_TEST(check_hash_equal(value(nullptr), value{}));
2505 BOOST_TEST(expect_hash_not_equal(value(nullptr), value({})));
2506 BOOST_TEST(expect_hash_not_equal(value(nullptr), value({object()})));
2507 BOOST_TEST(expect_hash_not_equal(value(nullptr), value(true)));
2508 BOOST_TEST(expect_hash_not_equal(value(nullptr), value(false)));
2509 BOOST_TEST(expect_hash_not_equal(value(nullptr), value(0)));
2510 BOOST_TEST(expect_hash_not_equal(value(nullptr), value(0UL)));
2511 BOOST_TEST(expect_hash_not_equal(value(nullptr), value(0.0)));
2512 BOOST_TEST(expect_hash_not_equal(value(nullptr), value("")));
2513
2514 BOOST_TEST(check_hash_equal(value(true), value(true)));
2515 BOOST_TEST(check_hash_equal(value(false), value(false)));
2516 BOOST_TEST(expect_hash_not_equal(value(false), value(true)));
2517 BOOST_TEST(expect_hash_not_equal(value(false), value(0)));
2518 BOOST_TEST(expect_hash_not_equal(value(false), value(0UL)));
2519 BOOST_TEST(expect_hash_not_equal(value(false), value(0.0)));
2520 BOOST_TEST(expect_hash_not_equal(value(true), value(1)));
2521 BOOST_TEST(expect_hash_not_equal(value(true), value(1UL)));
2522 BOOST_TEST(expect_hash_not_equal(value(true), value(1.0)));
2523
2524 BOOST_TEST(check_hash_equal(value(2021), value(2021UL)));
2525 BOOST_TEST(expect_hash_not_equal(value(2021U), value(-2021)));
2526 BOOST_TEST(expect_hash_not_equal(value(2021UL), value(2021.0)));
2527
2528 BOOST_TEST(expect_hash_not_equal(value({}), value({object()})));
2529 BOOST_TEST(expect_hash_not_equal(value({}), value("")));
2530 BOOST_TEST(expect_hash_not_equal(value({object()}), value("")));
2531
2532 BOOST_TEST(check_hash_equal(
2533 value({{"a",1}, {"b",2}, {"c",3}}),
2534 value({{"b",2}, {"c",3}, {"a",1}})));
2535 BOOST_TEST(expect_hash_not_equal(
2536 value({{"a",1}, {"b",2}, {"c",3}}),
2537 value({{"b",2}, {"c",3}})));
2538 BOOST_TEST(check_hash_equal(
2539 value({"a", "b", 17}),
2540 value({"a", "b", 17U})));
2541 BOOST_TEST(expect_hash_not_equal(
2542 value({"a", "b", 17}),
2543 value({17, "a", "b"})));
2544 BOOST_TEST(expect_hash_not_equal(
2545 value({"a", "b"}),
2546 value({{"a", "b"}})));
2547 }
2548
2549 void
2550 testIstream()

Callers

nothing calls this directly

Calls 4

check_hash_equalFunction · 0.85
expect_hash_not_equalFunction · 0.85
valueClass · 0.70
objectClass · 0.50

Tested by

no test coverage detected