2 * Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 #include "../testutil.h"
14 #include <openssl/crypto.h>
15 #include <openssl/bio.h>
20 void test_open_streams(void)
22 bio_out = BIO_new_fp(stdout, BIO_NOCLOSE | BIO_FP_TEXT);
23 bio_err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
24 bio_err = BIO_push(BIO_new(BIO_f_tap()), bio_err);
26 OPENSSL_assert(bio_out != NULL);
27 OPENSSL_assert(bio_err != NULL);
30 void test_close_streams(void)
33 BIO_free_all(bio_err);
36 int test_vprintf_stdout(const char *fmt, va_list ap)
38 return BIO_vprintf(bio_out, fmt, ap);
41 int test_vprintf_stderr(const char *fmt, va_list ap)
43 return BIO_vprintf(bio_err, fmt, ap);
46 int test_flush_stdout(void)
48 return BIO_flush(bio_out);
51 int test_flush_stderr(void)
53 return BIO_flush(bio_err);