MCPcopy Create free account
hub / github.com/DaveGamble/cJSON / cjson_compare_should_compare_numbers

Function cjson_compare_should_compare_numbers

tests/compare_tests.c:61–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61static void cjson_compare_should_compare_numbers(void)
62{
63 TEST_ASSERT_TRUE(compare_from_string("1", "1", true));
64 TEST_ASSERT_TRUE(compare_from_string("1", "1", false));
65 TEST_ASSERT_TRUE(compare_from_string("0.0001", "0.0001", true));
66 TEST_ASSERT_TRUE(compare_from_string("0.0001", "0.0001", false));
67 TEST_ASSERT_TRUE(compare_from_string("1E100", "10E99", false));
68
69 TEST_ASSERT_FALSE(compare_from_string("0.5E-100", "0.5E-101", false));
70
71 TEST_ASSERT_FALSE(compare_from_string("1", "2", true));
72 TEST_ASSERT_FALSE(compare_from_string("1", "2", false));
73}
74
75static void cjson_compare_should_compare_booleans(void)
76{

Callers

nothing calls this directly

Calls 1

compare_from_stringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…