testutil: Move printing function declarations to "internal" header
authorRichard Levitte <levitte@openssl.org>
Fri, 28 Apr 2017 12:37:19 +0000 (14:37 +0200)
committerRichard Levitte <levitte@openssl.org>
Fri, 28 Apr 2017 13:59:46 +0000 (15:59 +0200)
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)

test/bioprinttest.c
test/testutil.h
test/testutil/basic_output.c
test/testutil/driver.c
test/testutil/output.h [new file with mode: 0644]
test/testutil/test_main.c
test/testutil/tests.c

index 2c2dc8c5d9f533676c0e0c90dc3bd6b0b8431275..8ae0a5a04b9dff3c79428980746f775aa6030750 100644 (file)
@@ -14,6 +14,7 @@
 #include <openssl/bio.h>
 #include "internal/numbers.h"
 #include "testutil.h"
 #include <openssl/bio.h>
 #include "internal/numbers.h"
 #include "testutil.h"
+#include "testutil/output.h"
 
 #define nelem(x) (int)(sizeof(x) / sizeof((x)[0]))
 
 
 #define nelem(x) (int)(sizeof(x) / sizeof((x)[0]))
 
index ecf993445de11a916cf9295166b816caed57f68a..66b9e814ee9669188b7aee92292d3ee82566887d 100644 (file)
@@ -355,25 +355,9 @@ void test_info_c90(const char *desc, ...) PRINTF_FORMAT(1, 2);
             OPENSSL_assert(!#condition);        \
         }                                       \
     } while (0)
             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);
 
 extern BIO *bio_out;
 extern BIO *bio_err;
 
 int subtest_level(void);
+#endif                          /* HEADER_TESTUTIL_H */
index 9080aaec3706c20313d7dacde0dc339553c52379..8cf5def7140055615110f07b790d2ebfefbed7f3 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include "../testutil.h"
  */
 
 #include "../testutil.h"
+#include "output.h"
 
 #include <openssl/crypto.h>
 #include <openssl/bio.h>
 
 #include <openssl/crypto.h>
 #include <openssl/bio.h>
index 29c97a99120aeeff55d27dd4720a6ca0c3aab16f..7914ea52012039203da5a0b2d08d3b0fd182c4d8 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include "../testutil.h"
  */
 
 #include "../testutil.h"
+#include "output.h"
 
 #include <string.h>
 #include <assert.h>
 
 #include <string.h>
 #include <assert.h>
diff --git a/test/testutil/output.h b/test/testutil/output.h
new file mode 100644 (file)
index 0000000..5e7d8c0
--- /dev/null
@@ -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 */
index 0152421fe1fc8b49eadfcd0aa6c1ecf9a9e36646..7c9843c01c582d62c7ff75813e881fe64f6948d2 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include "../testutil.h"
  */
 
 #include "../testutil.h"
+#include "output.h"
 
 #include <stdio.h>
 
 
 #include <stdio.h>
 
index 67b20a572c6a877fc411532c48ddfe708864318a..b7f5bfb2a1f4839981c699673829d235e86e9e1b 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include "../testutil.h"
  */
 
 #include "../testutil.h"
+#include "output.h"
 
 #include <string.h>
 #include "../../e_os.h"
 
 #include <string.h>
 #include "../../e_os.h"