diff options
author | David Benjamin <davidben@chromium.org> | 2015-05-27 21:51:51 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-05-28 20:25:41 +0300 |
commit | 15eaafb18ad2f685ba77e71c3635e5d3943ba714 (patch) | |
tree | 9a881a3d8504aea0d13ac4bdef03ec779a25b5cb /crypto/test | |
parent | efd8eb3226febefd520925ee589b154efd418827 (diff) |
Fix bn_test's bc output and shut it up a little.
bn_test's output is meant to be piped to bc, but this got broken somewhat:
- OpenSSL uses uppercase hex rather than BoringSSL's lowercase. bc only accepts
uppercase. Document that this needs some shell pipeline until we replace
them with better tests because this is all ridiculous.
- Some stderr outputs moved to stdout to avoid cluttering stdout. Just remove
them. The operations are fast enough to not need progress.
- To cut down on noise, only write the bc transcript given a command-line flag.
Also remove the -results flag since it's pointless. (It writes only the
results and not the inputs.)
Change-Id: I08f87cac1e03fab461f0dc40b9d4285bd877807d
Reviewed-on: https://boringssl-review.googlesource.com/4896
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/test')
-rw-r--r-- | crypto/test/scoped_types.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/test/scoped_types.h b/crypto/test/scoped_types.h index 1064b574..c5c8cfe2 100644 --- a/crypto/test/scoped_types.h +++ b/crypto/test/scoped_types.h @@ -16,6 +16,7 @@ #define OPENSSL_HEADER_CRYPTO_TEST_SCOPED_TYPES_H #include <stdint.h> +#include <stdio.h> #include <openssl/bio.h> #include <openssl/bn.h> @@ -57,6 +58,12 @@ struct OpenSSLFree { } }; +struct FileCloser { + void operator()(FILE *file) { + fclose(file); + } +}; + template<typename T, void (*func)(T*)> using ScopedOpenSSLType = bssl::unique_ptr<T, OpenSSLDeleter<T, func>>; @@ -119,5 +126,6 @@ using ScopedHMAC_CTX = ScopedOpenSSLContext<HMAC_CTX, void, HMAC_CTX_init, using ScopedOpenSSLBytes = bssl::unique_ptr<uint8_t, OpenSSLFree<uint8_t>>; using ScopedOpenSSLString = bssl::unique_ptr<char, OpenSSLFree<char>>; +using ScopedFILE = bssl::unique_ptr<FILE, FileCloser>; #endif // OPENSSL_HEADER_CRYPTO_TEST_SCOPED_TYPES_H |