blob: 8e11f002f3658cd9ec290160e14339f49d5bcea1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
From ab6163e989e93a67afb13285539fd89e60a1c11a Mon Sep 17 00:00:00 2001
From: Mike Ellery <mellery451@gmail.com>
Date: Thu, 13 Sep 2018 08:25:02 -0700
Subject: [PATCH] Remove test sensitivity to error text from OpenSSL
---
src/test/beast/beast_asio_error_test.cpp | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/test/beast/beast_asio_error_test.cpp b/src/test/beast/beast_asio_error_test.cpp
index 4a3400ea70..5aeb925cba 100644
--- a/src/test/beast/beast_asio_error_test.cpp
+++ b/src/test/beast/beast_asio_error_test.cpp
@@ -32,13 +32,14 @@ class error_test : public unit_test::suite
boost::system::error_code ec =
boost::system::error_code (335544539,
boost::asio::error::get_ssl_category ());
- std::string const s = beast::error_message_with_ssl(ec);
-
-#ifdef SSL_R_SHORT_READ
- BEAST_EXPECT(s == " (20,0,219) error:140000DB:SSL routines:SSL routines:short read");
-#else
- BEAST_EXPECT(s == " (20,0,219) error:140000DB:SSL routines:SSL routines:reason(219)");
-#endif
+ std::string s = beast::error_message_with_ssl(ec);
+ // strip away last part of the error message since
+ // it can vary with openssl versions and/or compile
+ // flags
+ auto const lastColon = s.find_last_of(':');
+ if (lastColon != s.npos)
+ s = s.substr(0, lastColon);
+ BEAST_EXPECT(s == " (20,0,219) error:140000DB:SSL routines:SSL routines");
}
}
};
|