53 stdimpl_strcpy(buffer,
"expected: ");
54 stdimpl_strncat(buffer, (base==16)?
"0x":
"", 2);
56 { stdimpl_itoa(expected, numbuf, base);
57 stdimpl_strncat(buffer, numbuf, 11); }
59 stdimpl_strcat(buffer,
" actual: ");
60 stdimpl_strncat(buffer, (base==16)?
"0x":
"", 2);
62 { stdimpl_itoa(actual, numbuf, base);
63 stdimpl_strncat(buffer, numbuf, 11); }
65 addFailure(buffer, line, file);
77 void assertImplementationUInt(
unsigned long expected,
unsigned long actual,
unsigned char base,
unsigned long line,
const char *file)
83 stdimpl_strcpy(buffer,
"expected: ");
84 stdimpl_strncat(buffer, (base==16)?
"0x":
"", 2);
86 { stdimpl_utoa(expected, numbuf, base);
87 stdimpl_strncat(buffer, numbuf, 11); }
89 stdimpl_strcat(buffer,
" actual: ");
90 stdimpl_strncat(buffer, (base==16)?
"0x":
"", 2);
92 { stdimpl_utoa(actual, numbuf, base);
93 stdimpl_strncat(buffer, numbuf, 11); }
95 addFailure(buffer, line, file);
108 char buffer[ASSERT_STRING_BUFFER_MAX];
109 #define exp_act_limit_cstr ((ASSERT_STRING_BUFFER_MAX-11-1)/2) 114 el = stdimpl_strlen(expected);
121 al = stdimpl_strlen(actual);
126 if (el > exp_act_limit_cstr) {
127 if (al > exp_act_limit_cstr) {
128 al = exp_act_limit_cstr;
129 el = exp_act_limit_cstr;
131 int w = exp_act_limit_cstr + (exp_act_limit_cstr - al);
137 int w = exp_act_limit_cstr + (exp_act_limit_cstr - el);
142 stdimpl_strcpy(buffer,
"exp \"");
143 stdimpl_strncat(buffer, expected, el);
144 stdimpl_strcat(buffer,
"\" was \"");
145 stdimpl_strncat(buffer, actual, al);
146 stdimpl_strcat(buffer,
"\"");
148 addFailure(buffer, line, file);
162 const char* expected = (
char*)exp;
163 const char* actual = (
char*)act;
164 char buffer[ASSERT_MEMORY_BUFFER_MAX];
166 #define exp_act_limit_mem ((ASSERT_MEMORY_BUFFER_MAX-11-1)/2) 184 if (el > exp_act_limit_mem) {
185 if (al > exp_act_limit_mem) {
186 al = exp_act_limit_mem;
187 el = exp_act_limit_mem;
189 int w = exp_act_limit_mem + (exp_act_limit_mem - al);
195 int w = exp_act_limit_mem + (exp_act_limit_mem - el);
200 stdimpl_strcpy(buffer,
"exp \"");
203 stdimpl_itoa(expected[it], numbuf, 16);
204 stdimpl_strncat(buffer, numbuf, 2);
205 stdimpl_strncat(buffer,
" ", 1);
209 stdimpl_strcat(buffer,
"\" was \"");
212 stdimpl_itoa(actual[it], numbuf, 16);
213 stdimpl_strncat(buffer, numbuf, 2);
214 stdimpl_strncat(buffer,
" ", 1);
218 stdimpl_strcat(buffer,
"\"");
220 addFailure(buffer, line, file);
void assertImplementationUInt(unsigned long expected, unsigned long actual, unsigned char base, unsigned long line, const char *file)
void assertImplementationMem(const void *exp, const void *act, int size, unsigned long line, const char *file)
void assertImplementationCStr(const char *expected, const char *actual, unsigned long line, const char *file)
void assertImplementationInt(long expected, long actual, unsigned char base, unsigned long line, const char *file)