X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Fungetc.c;h=9003a1c98fa1c9099996f470182d67a65d432ff5;hb=462b4f35652098e26c677f89df6990428a4aad6a;hp=230b327e3f953e98f4188401f232285868378c57;hpb=80371a77c4d6978e786ab2322161c4f8e299e891;p=libc-test diff --git a/src/stdio/ungetc.c b/src/stdio/ungetc.c index 230b327..9003a1c 100644 --- a/src/stdio/ungetc.c +++ b/src/stdio/ungetc.c @@ -13,14 +13,15 @@ !strcmp((s),(x)) || \ (error("[%s] != [%s] (%s)\n", s, x, m), 0) ) -void test_ungetc(void) { +int main(void) +{ int i; char a[100]; FILE *f; TEST(i, !(f = tmpfile()), 0, "failed to create temp file %d!=%d (%s)"); - if (!f) return; + if (!f) return test_status; TEST(i, fprintf(f, "hello, world\n"), 13, "%d != %d (%m)"); TEST(i, fseek(f, 0, SEEK_SET), 0, "%d != %d (%m)"); @@ -48,4 +49,5 @@ void test_ungetc(void) { TEST(i, fgetc(f), 'h', "'%c' != '%c'"); fclose(f); + return test_status; }