diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-05-21 15:06:45 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-05-21 15:16:07 -0400 |
commit | 8483241b4e2538e9adb75c7ffed2787afd361df6 (patch) | |
tree | 81a0224731b326aeab6d461f7f0170735e79d141 /src/test/test_crypto.c | |
parent | 943291d7ae3d246c50fa55caa96c9bb04ee577eb (diff) | |
download | tor-8483241b4e2538e9adb75c7ffed2787afd361df6.tar.gz tor-8483241b4e2538e9adb75c7ffed2787afd361df6.zip |
Improve openssl_version tests with better messages
These tests would report errors, but wouldn't report the offending
strings.
Diffstat (limited to 'src/test/test_crypto.c')
-rw-r--r-- | src/test/test_crypto.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c index 24eef156b0..e3a41412f7 100644 --- a/src/test/test_crypto.c +++ b/src/test/test_crypto.c @@ -152,8 +152,13 @@ test_crypto_openssl_version(void *arg) const char *h_version = crypto_openssl_get_header_version_str(); tt_assert(version); tt_assert(h_version); - tt_assert(!strcmpstart(version, h_version)); /* "-fips" suffix, etc */ - tt_assert(!strstr(version, "OpenSSL")); + if (strcmpstart(version, h_version)) { /* "-fips" suffix, etc */ + TT_DIE(("OpenSSL library version %s did not begin with header version %s.", + version, h_version)); + } + if (strstr(version, "OpenSSL")) { + TT_DIE(("assertion failed: !strstr(\"%s\", \"OpenSSL\")", version)); + } int a=-1,b=-1,c=-1; if (!strcmpstart(version, "LibreSSL") || !strcmpstart(version, "BoringSSL")) return; |