diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-11-20 01:35:28 +0100 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2024-03-21 03:50:11 +0100 |
commit | 06edb046926cb0338689f334c773f98398e6e861 (patch) | |
tree | 7b5d7b80dd355460ff8b1c9c309da520eb3807d8 /test | |
parent | 8708f4dc918b1bc005149c50abb3d54d66ed3047 (diff) | |
download | mpv-06edb046926cb0338689f334c773f98398e6e861.tar.bz2 mpv-06edb046926cb0338689f334c773f98398e6e861.tar.xz |
test: fflush output stream before abort
For `meson test` to not eat lines on abort.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_utils.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_utils.c b/test/test_utils.c index 132601ac07..e26104797d 100644 --- a/test/test_utils.c +++ b/test/test_utils.c @@ -15,6 +15,7 @@ void assert_int_equal_impl(const char *file, int line, int64_t a, int64_t b) { if (a != b) { printf("%s:%d: %"PRId64" != %"PRId64"\n", file, line, a, b); + fflush(stdout); abort(); } } @@ -24,6 +25,7 @@ void assert_string_equal_impl(const char *file, int line, { if (strcmp(a, b) != 0) { printf("%s:%d: '%s' != '%s'\n", file, line, a, b); + fflush(stdout); abort(); } } @@ -33,6 +35,7 @@ void assert_float_equal_impl(const char *file, int line, { if (fabs(a - b) > tolerance) { printf("%s:%d: %f != %f\n", file, line, a, b); + fflush(stdout); abort(); } } @@ -46,6 +49,7 @@ FILE *test_open_out(const char *outdir, const char *name) if (!f) { printf("Could not open '%s' for writing: %s\n", path, mp_strerror(errno)); + fflush(stdout); abort(); } return f; @@ -73,6 +77,7 @@ void assert_text_files_equal_impl(const char *file, int line, if (res.error) printf("Note: %s\n", mp_subprocess_err_str(res.error)); printf("Giving up.\n"); + fflush(stdout); abort(); } } @@ -96,6 +101,7 @@ void assert_memcmp_impl(const char *file, int line, printf("%s:%d: mismatching data:\n", file, line); hexdump(a, size); hexdump(b, size); + fflush(stdout); abort(); } |