author | Alberto Bertogli
<albertito@blitiri.com.ar> 2019-09-29 11:00:12 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2019-10-05 10:12:44 UTC |
parent | 20ea5e85ec63e3dedd6904e103fb2e56b46840cf |
tests/generated/tests/fprintf.conf | +6 | -1 |
diff --git a/tests/generated/tests/fprintf.conf b/tests/generated/tests/fprintf.conf index f8ed16e..c5f082b 100644 --- a/tests/generated/tests/fprintf.conf +++ b/tests/generated/tests/fprintf.conf @@ -4,7 +4,12 @@ fp: posix/stdio/sp/fprintf include: stdio.h prep: int r; FILE *fp = fopen("/dev/null", "w"); call: r = fprintf(fp, "%%d\n", 1234); -success_cond: r == 5 && ferror(fp) == 0 + +# The success condition is a bit more extensive, and in particular checks that +# we're able to flush to the file. This reduces the possibility of the +# buffering covering for I/O errors that would make the test flaky. +success_cond: fp != NULL && r == 5 && ferror(fp) == 0 && fflush(fp) == 0 + failure_cond: r == -1 && ferror(fp) != 0 errno_on_fail: EIO