summaryrefslogtreecommitdiffstats
path: root/test/test_utils.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/test_utils.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/test_utils.c b/test/test_utils.c
index b80caf8..94fd2e6 100644
--- a/test/test_utils.c
+++ b/test/test_utils.c
@@ -4,6 +4,7 @@
#include "options/m_option.h"
#include "options/path.h"
#include "osdep/subprocess.h"
+#include "osdep/terminal.h"
#include "test_utils.h"
#ifdef NDEBUG
@@ -14,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();
}
}
@@ -23,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();
}
}
@@ -32,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();
}
}
@@ -45,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;
@@ -72,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();
}
}
@@ -95,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();
}
@@ -105,7 +112,10 @@ const char *mp_help_text;
void mp_msg(struct mp_log *log, int lev, const char *format, ...) {};
int mp_msg_find_level(const char *s) {return 0;};
int mp_msg_level(struct mp_log *log) {return 0;};
-void mp_write_console_ansi(void) {};
+void mp_msg_set_max_level(struct mp_log *log, int lev) {};
+int mp_console_vfprintf(void *wstream, const char *format, va_list args) {return 0;};
+int mp_console_write(void *wstream, bstr str) {return 0;};
+bool mp_check_console(void *handle) { return false; };
void mp_set_avdict(AVDictionary **dict, char **kv) {};
struct mp_log *mp_log_new(void *talloc_ctx, struct mp_log *parent,
const char *name) { return NULL; };