X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Ffunctional%2Fsnprintf.c;h=2c94d02b69d8240d64d44bc37640201c31fd4656;hb=f9ba40bcb2e9cf0e51368d1144a000d1cc15ab9f;hp=fefe814bbfddbe3bd2b4d0ca36b54cf2905ddae8;hpb=2cf89517c5b25c2524fe0c0c01ed277d7307a852;p=libc-test diff --git a/src/functional/snprintf.c b/src/functional/snprintf.c index fefe814..2c94d02 100644 --- a/src/functional/snprintf.c +++ b/src/functional/snprintf.c @@ -12,11 +12,11 @@ #define TEST(r, f, x, m) ( \ ((r) = (f)) == (x) || \ - (error("%s failed (" m ")\n", #f, r, x), 0) ) + (t_error("%s failed (" m ")\n", #f, r, x), 0) ) #define TEST_S(s, x, m) ( \ !strcmp((s),(x)) || \ - (error("[%s] != [%s] (%s)\n", s, x, m), 0) ) + (t_error("[%s] != [%s] (%s)\n", s, x, m), 0) ) static const struct { const char *fmt; @@ -162,23 +162,23 @@ int main(void) for (j=0; int_tests[j].fmt; j++) { i = snprintf(b, sizeof b, int_tests[j].fmt, int_tests[j].i); if (i != strlen(int_tests[j].expect)) { - error("snprintf(b, sizeof b, \"%s\", %d) returned %d wanted %d\n", + t_error("snprintf(b, sizeof b, \"%s\", %d) returned %d wanted %d\n", int_tests[j].fmt, int_tests[j].i, i, strlen(int_tests[j].expect)); } if (strcmp(b, int_tests[j].expect) != 0) - error("bad integer conversion: got \"%s\", want \"%s\"\n", b, int_tests[j].expect); + t_error("bad integer conversion: got \"%s\", want \"%s\"\n", b, int_tests[j].expect); } for (j=0; fp_tests[j].fmt; j++) { i = snprintf(b, sizeof b, fp_tests[j].fmt, fp_tests[j].f); if (i != strlen(fp_tests[j].expect)) { - error("snprintf(b, sizeof b, \"%s\", %f) returned %d wanted %d\n", + t_error("snprintf(b, sizeof b, \"%s\", %f) returned %d wanted %d\n", fp_tests[j].fmt, fp_tests[j].f, i, strlen(fp_tests[j].expect)); } if (strcmp(b, fp_tests[j].expect) != 0) - error("bad floating-point conversion: got \"%s\", want \"%s\"\n", b, fp_tests[j].expect); + t_error("bad floating-point conversion: got \"%s\", want \"%s\"\n", b, fp_tests[j].expect); } TEST(i, snprintf(0, 0, "%.4a", 1.0), 11, "%d != %d"); - return test_status; + return t_status; }