proxygen
SSLErrorsTest.cpp File Reference

Go to the source code of this file.

Functions

 TEST (SSLErrorsTest, TestMessage)
 

Function Documentation

TEST ( SSLErrorsTest  ,
TestMessage   
)

Definition at line 25 of file SSLErrorsTest.cpp.

References EXPECT_EQ, and string.

25  {
26  ERR_load_crypto_strings();
27  unsigned long err;
28 #ifdef OPENSSL_IS_BORINGSSL
29  err = ERR_PACK(ERR_LIB_X509, X509_R_CERT_ALREADY_IN_HASH_TABLE);
30 #else
31  err = ERR_PACK(
32  ERR_LIB_X509,
33  X509_F_X509_STORE_ADD_CERT,
34  X509_R_CERT_ALREADY_IN_HASH_TABLE);
35 #endif
36  SSLException ex(0, err, 0, 0);
37 
38 // This is flaky - we should not be testing error strings
39 // which may change version to version
40 #if defined(OPENSSL_IS_BORINGSSL)
41  std::string expectedMsg =
42  "AsyncSocketException: error:0b000069:X.509 certificate routines:"
43  "OPENSSL_internal:CERT_ALREADY_IN_HASH_TABLE, type = SSL error";
44 #else
45  std::string expectedMsg =
46  "AsyncSocketException: error:0B07C065:"
47  "x509 certificate routines:X509_STORE_add_cert:"
48  "cert already in hash table, type = SSL error";
49 #endif
50  std::string actual = ex.what();
51  EXPECT_EQ(expectedMsg, actual);
52 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
const char * string
Definition: Conv.cpp:212