MCPcopy Create free account
hub / github.com/JuliaStrings/utf8proc / check_compare

Function check_compare

test/tests.c:84–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84void check_compare(const char *transformation,
85 const utf8proc_uint8_t *input, const utf8proc_uint8_t *expected,
86 utf8proc_uint8_t *received, int free_received) {
87 int passed = !strcmp((const char *) received, (const char *) expected);
88 FILE *f = passed ? stdout : stderr;
89 fprintf(f, "%s: %s ", passed ? "PASSED" : "FAILED", transformation);
90 print_string_and_escaped(f, input);
91 fprintf(f, " -> ");
92 print_string_and_escaped(f, received);
93 if (!passed) {
94 fprintf(f, " != expected ");
95 print_string_and_escaped(f, expected);
96 }
97 fprintf(f, "\n");
98 if (free_received) free(received);
99 if (!passed) exit(1);
100}

Callers 4

mainFunction · 0.85
issue128Function · 0.85
issue102Function · 0.85
issue317Function · 0.85

Calls 1

print_string_and_escapedFunction · 0.85

Tested by

no test coverage detected