summaryrefslogtreecommitdiffstats
path: root/test/bioprinttest.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-06-05 17:05:07 +0200
committerRichard Levitte <levitte@openssl.org>2020-06-06 19:18:30 +0200
commitc4683009ad6e8d64e80112fd689921f6c169bd20 (patch)
treec1413ea5ed3377e6d9a4dd7958e2f41fca17588d /test/bioprinttest.c
parent66d8bd4b37c759e2db51324f5614438bf3db1dbd (diff)
TEST: Adjust test/bioprinttest.c to behave like the testutil routines
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12057)
Diffstat (limited to 'test/bioprinttest.c')
-rw-r--r--test/bioprinttest.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/test/bioprinttest.c b/test/bioprinttest.c
index 18c00e09b6..04d1613c6c 100644
--- a/test/bioprinttest.c
+++ b/test/bioprinttest.c
@@ -297,10 +297,20 @@ int setup_tests(void)
* Replace testutil output routines. We do this to eliminate possible sources
* of BIO error
*/
+BIO *bio_out = NULL;
+BIO *bio_err = NULL;
+
+static int tap_level = 0;
+
void test_open_streams(void)
{
}
+void test_adjust_streams_tap_level(int level)
+{
+ tap_level = level;
+}
+
void test_close_streams(void)
{
}
@@ -312,12 +322,12 @@ void test_close_streams(void)
*/
int test_vprintf_stdout(const char *fmt, va_list ap)
{
- return vfprintf(stdout, fmt, ap);
+ return fprintf(stdout, "%*s# ", tap_level, "") + vfprintf(stdout, fmt, ap);
}
int test_vprintf_stderr(const char *fmt, va_list ap)
{
- return vfprintf(stderr, fmt, ap);
+ return fprintf(stderr, "%*s# ", tap_level, "") + vfprintf(stderr, fmt, ap);
}
int test_flush_stdout(void)
@@ -330,3 +340,23 @@ int test_flush_stderr(void)
return fflush(stderr);
}
+int test_vprintf_tapout(const char *fmt, va_list ap)
+{
+ return fprintf(stdout, "%*s", tap_level, "") + vfprintf(stdout, fmt, ap);
+}
+
+int test_vprintf_taperr(const char *fmt, va_list ap)
+{
+ return fprintf(stderr, "%*s", tap_level, "") + vfprintf(stderr, fmt, ap);
+}
+
+int test_flush_tapout(void)
+{
+ return fflush(stdout);
+}
+
+int test_flush_taperr(void)
+{
+ return fflush(stderr);
+}
+