| 29 | #include "common.h" |
| 30 | |
| 31 | static 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 | |
| 47 | static void parse_hex4_should_parse_mixed_case(void) |
| 48 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…