| 44 | } |
| 45 | |
| 46 | static 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 | |
| 60 | static void assert_not_parse_string(const char * const string) |
| 61 | { |
no test coverage detected
searching dependent graphs…