#include "gtest/gtest.h"
#include <openssl/bio.h>
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#include <openssl/err.h>
#include <openssl/evp.h>
#endif
class Environment : public ::testing::Environment {
public:
~Environment() override = default;
void SetUp() override {
#if OPENSSL_VERSION_NUMBER < 0x10100000L
OpenSSL_add_all_algorithms();
#endif
}
void TearDown() override {
#if OPENSSL_VERSION_NUMBER < 0x10100000L
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
ERR_free_strings();
ERR_remove_state(0);
#endif
}
};
static const ::testing::Environment* const env =
::testing::AddGlobalTestEnvironment(new Environment);