diff options
author | Richard Levitte <levitte@openssl.org> | 2017-04-28 14:37:19 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2017-04-28 15:59:46 +0200 |
commit | 579d0fabcddb4a0ec4307be420f0bc7c2eea6b7c (patch) | |
tree | 727c517e198f387031b228b4154cbb02e9c18cae | |
parent | 36b2cfb191f4a3f3a49b7c4d865308b7021daa42 (diff) |
testutil: Move printing function declarations to "internal" header
These functions aren't meant to be used directly by the test programs,
reflect that by making the declarations a little harder to reach, but
still available enough if there's a need to override them.
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3345)
-rw-r--r-- | test/bioprinttest.c | 1 | ||||
-rw-r--r-- | test/testutil.h | 18 | ||||
-rw-r--r-- | test/testutil/basic_output.c | 1 | ||||
-rw-r--r-- | test/testutil/driver.c | 1 | ||||
-rw-r--r-- | test/testutil/output.h | 30 | ||||
-rw-r--r-- | test/testutil/test_main.c | 1 | ||||
-rw-r--r-- | test/testutil/tests.c | 1 |
7 files changed, 36 insertions, 17 deletions
diff --git a/test/bioprinttest.c b/test/bioprinttest.c index 2c2dc8c5d9..8ae0a5a04b 100644 --- a/test/bioprinttest.c +++ b/test/bioprinttest.c @@ -14,6 +14,7 @@ #include <openssl/bio.h> #include "internal/numbers.h" #include "testutil.h" +#include "testutil/output.h" #define nelem(x) (int)(sizeof(x) / sizeof((x)[0])) diff --git a/test/testutil.h b/test/testutil.h index ecf993445d..66b9e814ee 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -355,25 +355,9 @@ void test_info_c90(const char *desc, ...) PRINTF_FORMAT(1, 2); OPENSSL_assert(!#condition); \ } \ } while (0) -#endif /* HEADER_TESTUTIL_H */ - - -/* - * The basic I/O functions used by the test framework. These can be - * overriden when needed. Note that if one is, then all must be. - */ -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 */ -int test_flush_stdout(void); -int test_flush_stderr(void); extern BIO *bio_out; extern BIO *bio_err; int subtest_level(void); +#endif /* HEADER_TESTUTIL_H */ diff --git a/test/testutil/basic_output.c b/test/testutil/basic_output.c index 9080aaec37..8cf5def714 100644 --- a/test/testutil/basic_output.c +++ b/test/testutil/basic_output.c @@ -8,6 +8,7 @@ */ #include "../testutil.h" +#include "output.h" #include <openssl/crypto.h> #include <openssl/bio.h> diff --git a/test/testutil/driver.c b/test/testutil/driver.c index 29c97a9912..7914ea5201 100644 --- a/test/testutil/driver.c +++ b/test/testutil/driver.c @@ -8,6 +8,7 @@ */ #include "../testutil.h" +#include "output.h" #include <string.h> #include <assert.h> diff --git a/test/testutil/output.h b/test/testutil/output.h new file mode 100644 index 0000000000..5e7d8c0954 --- /dev/null +++ b/test/testutil/output.h @@ -0,0 +1,30 @@ +/* + * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef HEADER_TU_OUTPUT_H +# define HEADER_TU_OUTPUT_H + +#include <stdarg.h> + +/* + * The basic I/O functions used internally by the test framework. These + * can be overriden when needed. Note that if one is, then all must be. + */ +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 */ +int test_flush_stdout(void); +int test_flush_stderr(void); + +#endif /* HEADER_TU_OUTPUT_H */ diff --git a/test/testutil/test_main.c b/test/testutil/test_main.c index 0152421fe1..7c9843c01c 100644 --- a/test/testutil/test_main.c +++ b/test/testutil/test_main.c @@ -8,6 +8,7 @@ */ #include "../testutil.h" +#include "output.h" #include <stdio.h> diff --git a/test/testutil/tests.c b/test/testutil/tests.c index 67b20a572c..b7f5bfb2a1 100644 --- a/test/testutil/tests.c +++ b/test/testutil/tests.c @@ -8,6 +8,7 @@ */ #include "../testutil.h" +#include "output.h" #include <string.h> #include "../../e_os.h" |