diff --git a/test/bioprinttest.c b/test/bioprinttest.c index 8ae0a5a04b9dff3c79428980746f775aa6030750..3034cda6ec9e4f8b3db5741d6510a6ed758d7ab0 100644 --- a/test/bioprinttest.c +++ b/test/bioprinttest.c @@ -261,18 +261,6 @@ void test_close_streams(void) { } -int test_puts_stdout(const char *str) -{ - return fputs(str, stdout); -} - -int test_puts_stderr(const char *str) -{ - return fputs(str, stderr); -} - -static char vprint_buf[10240]; - /* * This works out as long as caller doesn't use any "fancy" formats. * But we are caller's caller, and test_str_eq is the only one called, @@ -280,20 +268,12 @@ static char vprint_buf[10240]; */ int test_vprintf_stdout(const char *fmt, va_list ap) { - size_t len = vsnprintf(vprint_buf, sizeof(vprint_buf), fmt, ap); - - if (len >= sizeof(vprint_buf)) - return -1; - return test_puts_stdout(vprint_buf); + return vfprintf(stdout, fmt, ap); } int test_vprintf_stderr(const char *fmt, va_list ap) { - size_t len = vsnprintf(vprint_buf, sizeof(vprint_buf), fmt, ap); - - if (len >= sizeof(vprint_buf)) - return -1; - return test_puts_stderr(vprint_buf); + return vfprintf(stderr, fmt, ap); } int test_flush_stdout(void) diff --git a/test/testutil/basic_output.c b/test/testutil/basic_output.c index 8cf5def7140055615110f07b790d2ebfefbed7f3..6e1f99a5adbdac167a42c7193513e2fcd6df90d3 100644 --- a/test/testutil/basic_output.c +++ b/test/testutil/basic_output.c @@ -31,16 +31,6 @@ void test_close_streams(void) BIO_free(bio_err); } -int test_puts_stdout(const char *str) -{ - return BIO_puts(bio_out, str); -} - -int test_puts_stderr(const char *str) -{ - return BIO_puts(bio_err, str); -} - int test_vprintf_stdout(const char *fmt, va_list ap) { return BIO_vprintf(bio_out, fmt, ap); diff --git a/test/testutil/output.h b/test/testutil/output.h index 1ca12d289fc0f57e514a53ebc5e8c96a30be3c75..7c03affcc830d319ab83c31e320f408f288dd5e2 100644 --- a/test/testutil/output.h +++ b/test/testutil/output.h @@ -19,8 +19,6 @@ void test_open_streams(void); void test_close_streams(void); /* The following ALL return the number of characters written */ -int test_puts_stdout(const char *str); -int test_puts_stderr(const char *str); int test_vprintf_stdout(const char *fmt, va_list ap); int test_vprintf_stderr(const char *fmt, va_list ap); /* These return failure or success */ diff --git a/test/testutil/test_main.c b/test/testutil/test_main.c index 7c9843c01c582d62c7ff75813e881fe64f6948d2..3fa08b6402061c85e48722611d73528fd0e2815c 100644 --- a/test/testutil/test_main.c +++ b/test/testutil/test_main.c @@ -15,7 +15,7 @@ int test_main(int argc, char *argv[]) { if (argc > 1) - test_puts_stderr("Warning: ignoring extra command-line arguments.\n"); + test_printf_stderr("Warning: ignoring extra command-line arguments.\n"); register_tests(); return run_tests(argv[0]); diff --git a/test/testutil/tests.c b/test/testutil/tests.c index 0efaa064b6fab265937a6db38be4b1211e9c0676..19a366f34c1d73a091c9ae63882e162ae5fb0188 100644 --- a/test/testutil/tests.c +++ b/test/testutil/tests.c @@ -49,19 +49,17 @@ static void test_fail_message(const char *prefix, const char *file, int line, static void test_fail_message_va(const char *prefix, const char *file, int line, const char *type, const char *fmt, va_list ap) { - test_printf_stderr("%*s# ", subtest_level(), ""); - test_puts_stderr(prefix != NULL ? prefix : "ERROR"); - test_puts_stderr(":"); + test_printf_stderr("%*s# %s: ", subtest_level(), "", + prefix != NULL ? prefix : "ERROR"); if (type) - test_printf_stderr(" (%s)", type); + test_printf_stderr("(%s)", type); if (fmt != NULL) { - test_puts_stderr(" "); test_vprintf_stderr(fmt, ap); } if (file != NULL) { test_printf_stderr(" @ %s:%d", file, line); } - test_puts_stderr("\n"); + test_printf_stderr("\n"); test_flush_stderr(); }