9 static void setUp(
void) {
13 static void tearDown(
void) {
22 static void test_BinReturnAddressMatchesGivenAddress(
void) {
25 TEST_ASSERT_EQUAL_PTR(
string, return_addr);
28 static void test_BinZero(
void) {
30 TEST_ASSERT_EQUAL_STRING(
"0000",
Numbers::Bin(0b0000, 4,
string));
33 static void test_BinPositiveNumber(
void) {
35 TEST_ASSERT_EQUAL_STRING(
"10100101",
Numbers::Bin(0b10100101, 8,
string));
38 static void test_Bin32BitNumber(
void) {
40 TEST_ASSERT_EQUAL_STRING(
"10101010000000001111111111001100",
41 Numbers::Bin(0b10101010000000001111111111001100, 32,
string));
44 static void test_BinNoMoreDigitsThanSpecified(
void) {
46 TEST_ASSERT_EQUAL_STRING(
"1111",
Numbers::Bin(0b11111111, 4,
string));
49 static void test_BinInternalBuffer(
void) {
50 TEST_ASSERT_EQUAL_STRING(
"01010",
Numbers::Bin(0b01010, 5));
60 static void test_HexReturnAddressMatchesGivenAddress(
void) {
63 TEST_ASSERT_EQUAL_PTR(
string, return_addr);
66 static void test_HexZero(
void) {
68 TEST_ASSERT_EQUAL_STRING(
"00",
Numbers::Hex(0x0, 2,
string));
72 static void test_HexPositiveNumber(
void) {
74 TEST_ASSERT_EQUAL_STRING(
"FA467",
Numbers::Hex(0xFA467, 5,
string));
77 static void test_Hex32BitNumber(
void) {
79 TEST_ASSERT_EQUAL_STRING(
"FEDCBA98",
Numbers::Hex(0xFEDCBA98, 8,
string));
82 static void test_HexNoMoreDigitsThanSpecified(
void) {
84 TEST_ASSERT_EQUAL_STRING(
"250F",
Numbers::Hex(0x90250F, 4,
string));
87 static void test_HexEachDigit(
void) {
89 TEST_ASSERT_EQUAL_STRING(
"01234567",
Numbers::Hex(0x01234567, 8,
string));
90 TEST_ASSERT_EQUAL_STRING(
"89ABCDEF",
Numbers::Hex(0x89ABCDEF, 8,
string));
93 static void test_HexInternalBuffer(
void) {
101 static void test_DecReturnAddressMatchesGivenAddress(
void) {
104 TEST_ASSERT_EQUAL_PTR(
string, return_addr);
107 static void test_DecZero(
void) {
112 static void test_DecPositiveNumber(
void) {
114 TEST_ASSERT_EQUAL_STRING(
"542",
Numbers::Dec(542,
string));
117 static void test_DecNegativeNumber(
void) {
125 printf(
"Total CNT==%d ", end_cnt - start_cnt);
127 TEST_ASSERT_EQUAL_STRING(
"-3258656",
string);
131 static void test_DecVeryLargeNumber(
void) {
133 TEST_ASSERT_EQUAL_STRING(
"2000000001",
Numbers::Dec(2000000001,
string));
136 static void test_DecInternalBuffer(
void) {
137 TEST_ASSERT_EQUAL_STRING(
"123456",
Numbers::Dec(123456));
144 static void test_DecBasic(
void) {
148 static void test_DecNegativeBasic(
void) {
152 static void test_DecBigNumber(
void) {
153 TEST_ASSERT_EQUAL_INT(9864753,
Numbers::Dec(
"9864753"));
156 static void test_DecNonZeroTerminator(
void) {
157 char number [] = {
'3',
'1',
'\n'};
161 static void test_DecZeroNumbers(
void) {
166 static void test_DecLeadingZeros(
void) {
170 static void test_DecEmptyString(
void) {
174 static void test_DecCharArray(
void) {
175 char string[] = {
'4',
'2', 0};
183 static void test_ReverseReturnAddressMatchesGivenAddress(
void) {
186 TEST_ASSERT_EQUAL_PTR(
string, return_addr);
189 static void test_ReverseEmptyString(
void) {
195 static void test_ReverseSimpleString(
void) {
196 char string [] =
"abcdef";
204 static void test_DecToDec(
void) {
208 static void test_DecToDec2(
void) {
216 static void test_DecDigitsZero(
void) {
220 static void test_DecDigits1(
void) {
224 static void test_DecDigits2(
void) {
228 static void test_DecDigits3(
void) {
232 static void test_DecDigits4(
void) {
236 static void test_DecDigits5(
void) {
240 static void test_DecDigits6(
void) {
244 static void test_DecDigits7(
void) {
248 static void test_DecDigits8(
void) {
252 static void test_DecDigits9(
void) {
256 static void test_DecDigits10(
void) {
260 static void test_DecDigitsNegative1(
void) {
264 static void test_DecDigitsNegative2(
void) {
268 static void test_DecDigitsNegative3(
void) {
272 static void test_DecDigitsNegative4(
void) {
276 static void test_DecDigitsNegative5(
void) {
280 static void test_DecDigitsNegative6(
void) {
284 static void test_DecDigitsNegative7(
void) {
288 static void test_DecDigitsNegative8(
void) {
292 static void test_DecDigitsNegative9(
void) {
296 static void test_DecDigitsNegative10(
void) {
302 static void test_HexDigitsZero(
void) {
306 static void test_HexDigits1(
void) {
310 static void test_HexDigits2(
void) {
314 static void test_HexDigits3(
void) {
318 static void test_HexDigits4(
void) {
322 static void test_HexDigits5(
void) {
326 static void test_HexDigits6(
void) {
330 static void test_HexDigits7(
void) {
334 static void test_HexDigits8(
void) {