diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-08-05 14:00:16 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-08-05 14:00:16 -0700 |
commit | 1b7122c6aaa19cb6e2a62598dca8e0fd9e3cc7a7 (patch) | |
tree | 659d33c0fcfa4f6ae3afaae9808649e4021979b7 /tests/stdio/test_fgetc_ungetc.c | |
parent | 6039aea9a13ea217301c2c19eca3e857dc2dace7 (diff) | |
parent | a0c6ab57cb11258df23dd670aebdc260d9e16da3 (diff) |
Merge branch 'incoming'
Diffstat (limited to 'tests/stdio/test_fgetc_ungetc.c')
-rw-r--r-- | tests/stdio/test_fgetc_ungetc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/stdio/test_fgetc_ungetc.c b/tests/stdio/test_fgetc_ungetc.c index c69a3d1a..0eea4007 100644 --- a/tests/stdio/test_fgetc_ungetc.c +++ b/tests/stdio/test_fgetc_ungetc.c @@ -1,5 +1,6 @@ #include <assert.h> #include <fcntl.h> +#include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -47,7 +48,9 @@ void test() { ungetc('a', file); err = fgetc(file); assert(err == (int)'a'); - fread(buffer, sizeof(char), sizeof(buffer), file); + int r = fread(buffer, sizeof(char), sizeof(buffer), file); + assert(r == 3); + buffer[3] = 0; assert(!strcmp(buffer, "bcd")); // rewind and fseek should reset anything that's been @@ -84,4 +87,4 @@ int main() { setup(); test(); return EXIT_SUCCESS; -}
\ No newline at end of file +} |