• R/O
  • SSH
  • HTTPS

cstl: Commit


Commit MetaInfo

Revision405 (tree)
Time2010-08-26 19:59:12
Authorkatono

Log Message

s/PRINTF/PRINTF0/

Change Summary

Incremental Difference

--- branches/try-vfunc/unittest/UnitTest.c (revision 404)
+++ branches/try-vfunc/unittest/UnitTest.c (revision 405)
@@ -45,16 +45,16 @@
4545
4646 static void print_result(void)
4747 {
48- PRINTF("Type Total Ran Passed Failed\n");
48+ PRINTF0("Type Total Ran Passed Failed\n");
4949 PRINTF3("suites %8d %8d n/a %8d", suites_total, suites_ran, suites_failed);
5050 if (setup_failed || teardown_failed) {
5151 PRINTF2("(setup:%d/teardown:%d)\n", setup_failed, teardown_failed);
5252 } else {
53- PRINTF("\n");
53+ PRINTF0("\n");
5454 }
5555 PRINTF4("tests %8d %8d %8d %8d\n", tests_total, tests_ran, tests_ran - tests_failed, tests_failed);
5656 PRINTF4("asserts %8d %8d %8d %8d\n", asserts_total, asserts_ran, asserts_ran - asserts_failed, asserts_failed);
57- PRINTF("\n");
57+ PRINTF0("\n");
5858 }
5959
6060 static void run_all(const TestSuite *suites)
@@ -132,23 +132,23 @@
132132 static void show_list_tests(const TestCase *cases)
133133 {
134134 size_t i;
135- PRINTF("List Tests\n");
136- PRINTF(" Number Name\n");
135+ PRINTF0("List Tests\n");
136+ PRINTF0(" Number Name\n");
137137 for (i = 0; cases[i].name != 0; i++) {
138138 PRINTF2(" %-6d %s\n", i + 1, cases[i].name);
139139 }
140- PRINTF("\n");
140+ PRINTF0("\n");
141141 }
142142
143143 static void show_list_suites(const TestSuite *suites)
144144 {
145145 size_t i;
146- PRINTF("List Suites\n");
147- PRINTF(" Number Name\n");
146+ PRINTF0("List Suites\n");
147+ PRINTF0(" Number Name\n");
148148 for (i = 0; suites[i].name != 0; i++) {
149149 PRINTF2(" %-6d %s\n", i + 1, suites[i].name);
150150 }
151- PRINTF("\n");
151+ PRINTF0("\n");
152152 }
153153
154154 static int find_test_name(const TestCase *cases, const char *input_str)
@@ -184,7 +184,7 @@
184184 int idx;
185185 char *p;
186186 const TestSuite *suite = &suites[suite_idx];
187- PRINTF("Enter Test's Number or Name : ");
187+ PRINTF0("Enter Test's Number or Name : ");
188188 FGETS(input_buf, sizeof input_buf, stdin);
189189 p = strpbrk(input_buf, "\r\n");
190190 if (p) *p = '\0';
@@ -193,11 +193,11 @@
193193 if (idx == -1) {
194194 idx = find_test_name(suite->test_cases, input_buf);
195195 if (idx == -1) {
196- PRINTF("\nTest not found.\n");
196+ PRINTF0("\nTest not found.\n");
197197 return;
198198 }
199199 }
200- PRINTF("\n");
200+ PRINTF0("\n");
201201
202202 run_suite_selected(suites, suite_idx, idx);
203203 }
@@ -235,7 +235,7 @@
235235 int idx;
236236 char *p;
237237 const TestSuite *selected_suite;
238- PRINTF("Enter Suite's Number or Name : ");
238+ PRINTF0("Enter Suite's Number or Name : ");
239239 FGETS(input_buf, sizeof input_buf, stdin);
240240 p = strpbrk(input_buf, "\r\n");
241241 if (p) *p = '\0';
@@ -244,7 +244,7 @@
244244 if (idx == -1) {
245245 idx = find_suite_name(suites, input_buf);
246246 if (idx == -1) {
247- PRINTF("\nSuite not found.\n");
247+ PRINTF0("\nSuite not found.\n");
248248 return;
249249 }
250250 }
@@ -251,13 +251,13 @@
251251
252252 selected_suite = &suites[idx];
253253
254- PRINTF("\n");
254+ PRINTF0("\n");
255255 while (1) {
256256 PRINTF1("================== Suite : %s ==================\n", selected_suite->name);
257- PRINTF("(R)un all, (S)elect test, (L)ist tests, (M)ove up, (Q)uit\n");
258- PRINTF("Enter Command : ");
257+ PRINTF0("(R)un all, (S)elect test, (L)ist tests, (M)ove up, (Q)uit\n");
258+ PRINTF0("Enter Command : ");
259259 FGETS(input_buf, sizeof input_buf, stdin);
260- PRINTF("\n");
260+ PRINTF0("\n");
261261 switch (input_buf[0]) {
262262 case 'r':
263263 case 'R':
@@ -281,7 +281,7 @@
281281 default:
282282 break;
283283 }
284- PRINTF("\n");
284+ PRINTF0("\n");
285285 }
286286 }
287287
@@ -293,11 +293,11 @@
293293 return;
294294 }
295295 while (1) {
296- PRINTF("****************** Unit Test ******************\n");
297- PRINTF("(R)un all, (S)elect suite, (L)ist suites, (Q)uit\n");
298- PRINTF("Enter Command : ");
296+ PRINTF0("****************** Unit Test ******************\n");
297+ PRINTF0("(R)un all, (S)elect suite, (L)ist suites, (Q)uit\n");
298+ PRINTF0("Enter Command : ");
299299 FGETS(input_buf, sizeof input_buf, stdin);
300- PRINTF("\n");
300+ PRINTF0("\n");
301301 switch (input_buf[0]) {
302302 case 'r':
303303 case 'R':
@@ -317,7 +317,7 @@
317317 default:
318318 break;
319319 }
320- PRINTF("\n");
320+ PRINTF0("\n");
321321 }
322322 }
323323
@@ -324,8 +324,8 @@
324324
325325 void unittest_run_all(const TestSuite *suites)
326326 {
327- PRINTF("****************** Unit Test ******************\n");
328- PRINTF("\n");
327+ PRINTF0("****************** Unit Test ******************\n");
328+ PRINTF0("\n");
329329 init(suites);
330330 run_all(suites);
331331 }
--- branches/try-vfunc/unittest/LibcImpl.h (revision 404)
+++ branches/try-vfunc/unittest/LibcImpl.h (revision 405)
@@ -4,7 +4,7 @@
44
55 #ifndef NO_STD_PRINTF
66 # include <stdio.h>
7-# define PRINTF printf
7+# define PRINTF0 printf
88 # define PRINTF1 printf
99 # define PRINTF2 printf
1010 # define PRINTF3 printf
@@ -18,7 +18,7 @@
1818 # define FGETS LibcImpl_fgets
1919 char *LibcImpl_fgets(char *s, int size, void *stream);
2020 # ifdef STD_VSPRINTF
21-# define PRINTF LibcImpl_printf
21+# define PRINTF0 LibcImpl_printf
2222 # define PRINTF1 LibcImpl_printf
2323 # define PRINTF2 LibcImpl_printf
2424 # define PRINTF3 LibcImpl_printf
@@ -25,7 +25,7 @@
2525 # define PRINTF4 LibcImpl_printf
2626 int LibcImpl_printf(const char *format, ...);
2727 # else
28-# define PRINTF(f) LibcImpl_printf(f, 0, 0, 0, 0)
28+# define PRINTF0(f) LibcImpl_printf(f, 0, 0, 0, 0)
2929 # define PRINTF1(f, a1) LibcImpl_printf(f, (void *)(a1), 0, 0, 0)
3030 # define PRINTF2(f, a1, a2) LibcImpl_printf(f, (void *)(a1), (void *)(a2), 0, 0)
3131 # define PRINTF3(f, a1, a2, a3) LibcImpl_printf(f, (void *)(a1), (void *)(a2), (void *)(a3), 0)
--- branches/try-vfunc/unittest/TestSuite.c (revision 404)
+++ branches/try-vfunc/unittest/TestSuite.c (revision 405)
@@ -49,7 +49,7 @@
4949 err = TestSuite_setup(self);
5050 if (err) {
5151 PRINTF1(" SETUP FAILED: error[%d]\n", err);
52- PRINTF("\n");
52+ PRINTF0("\n");
5353 return SETUP_NG;
5454 }
5555 for (i = 0; self->test_cases[i].name != 0; i++) {
@@ -65,10 +65,10 @@
6565 err = TestSuite_teardown(self);
6666 if (err) {
6767 PRINTF1(" TEARDOWN FAILED: error[%d]\n", err);
68- PRINTF("\n");
68+ PRINTF0("\n");
6969 return TEARDOWN_NG;
7070 }
71- PRINTF("\n");
71+ PRINTF0("\n");
7272 return SUITE_OK;
7373 }
7474
@@ -81,7 +81,7 @@
8181 err = TestSuite_setup(self);
8282 if (err) {
8383 PRINTF1(" SETUP FAILED: error[%d]\n", err);
84- PRINTF("\n");
84+ PRINTF0("\n");
8585 return SETUP_NG;
8686 }
8787 TestCase_test(&self->test_cases[case_idx], nasserts, nasserts_failed);
@@ -92,10 +92,10 @@
9292 err = TestSuite_teardown(self);
9393 if (err) {
9494 PRINTF1(" TEARDOWN FAILED: error[%d]\n", err);
95- PRINTF("\n");
95+ PRINTF0("\n");
9696 return TEARDOWN_NG;
9797 }
98- PRINTF("\n");
98+ PRINTF0("\n");
9999 return SUITE_OK;
100100 }
101101
--- branches/try-vfunc/unittest/TestCase.c (revision 404)
+++ branches/try-vfunc/unittest/TestCase.c (revision 405)
@@ -47,7 +47,7 @@
4747 (*nasserts_failed)++;
4848 if (!failed_flag) {
4949 failed_flag = 1;
50- PRINTF("FAILED\n");
50+ PRINTF0("FAILED\n");
5151 }
5252 PRINTF4(" %d. %s(%d) %s\n", n, pos->file, pos->line, pos->expr);
5353 n++;
@@ -54,7 +54,7 @@
5454 }
5555 }
5656 if (!failed_flag) {
57- PRINTF("passed\n");
57+ PRINTF0("passed\n");
5858 }
5959 }
6060
@@ -74,7 +74,7 @@
7474 {
7575 TestAssertion *self = (TestAssertion *) MALLOC(sizeof(TestAssertion));
7676 if (!self) {
77- PRINTF("malloc failed!!\n");
77+ PRINTF0("malloc failed!!\n");
7878 return 0;
7979 }
8080 self->passed_flag = passed_flag;
Show on old repository browser