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

Function assert_print_string

tests/print_string.c:27–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25#include "common.h"
26
27static void assert_print_string(const char *expected, const char *input)
28{
29 unsigned char printed[1024];
30 printbuffer buffer = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } };
31 buffer.buffer = printed;
32 buffer.length = sizeof(printed);
33 buffer.offset = 0;
34 buffer.noalloc = true;
35 buffer.hooks = global_hooks;
36
37 TEST_ASSERT_TRUE_MESSAGE(print_string_ptr((const unsigned char*)input, &buffer), "Failed to print string.");
38 TEST_ASSERT_EQUAL_STRING_MESSAGE(expected, printed, "The printed string isn't as expected.");
39}
40
41static void print_string_should_print_empty_strings(void)
42{

Calls 1

print_string_ptrFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…