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

Function assert_parse_string

tests/parse_string.c:46–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46static void assert_parse_string(const char *string, const char *expected)
47{
48 parse_buffer buffer = { 0, 0, 0, 0, { 0, 0, 0 } };
49 buffer.content = (const unsigned char*)string;
50 buffer.length = strlen(string) + sizeof("");
51 buffer.hooks = global_hooks;
52
53 TEST_ASSERT_TRUE_MESSAGE(parse_string(item, &buffer), "Couldn't parse string.");
54 assert_is_string(item);
55 TEST_ASSERT_EQUAL_STRING_MESSAGE(expected, item->valuestring, "The parsed result isn't as expected.");
56 global_hooks.deallocate(item->valuestring);
57 item->valuestring = NULL;
58}
59
60static void assert_not_parse_string(const char * const string)
61{

Calls 2

parse_stringFunction · 0.85
assert_is_stringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…