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

Function parse_hex4_should_parse_all_combinations

tests/parse_hex4.c:31–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29#include "common.h"
30
31static void parse_hex4_should_parse_all_combinations(void)
32{
33 unsigned int number = 0;
34 unsigned char digits_lower[6];
35 unsigned char digits_upper[6];
36 /* test all combinations */
37 for (number = 0; number <= 0xFFFF; number++)
38 {
39 TEST_ASSERT_EQUAL_INT_MESSAGE(4, sprintf((char*)digits_lower, "%.4x", number), "sprintf failed.");
40 TEST_ASSERT_EQUAL_INT_MESSAGE(4, sprintf((char*)digits_upper, "%.4X", number), "sprintf failed.");
41
42 TEST_ASSERT_EQUAL_INT_MESSAGE(number, parse_hex4(digits_lower), "Failed to parse lowercase digits.");
43 TEST_ASSERT_EQUAL_INT_MESSAGE(number, parse_hex4(digits_upper), "Failed to parse uppercase digits.");
44 }
45}
46
47static void parse_hex4_should_parse_mixed_case(void)
48{

Callers

nothing calls this directly

Calls 1

parse_hex4Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…