9 #include <gtest/gtest.h> 17 using namespace folly;
23 TEST(UtilTest, GetAlpnFromNpn) {
24 std::list<folly::SSLContext::NextProtocolsItem> npList;
25 std::list<std::string> protocolList1{
"test",
"test2"};
26 std::list<std::string> protocolList2{
"test3",
"test4"};
30 std::vector<std::string> expectedList{
std::begin(protocolList1),
32 EXPECT_EQ(FizzUtil::getAlpnsFromNpnList(npList), expectedList);
37 std::vector<std::string> expectedList{
std::begin(protocolList2),
39 EXPECT_EQ(FizzUtil::getAlpnsFromNpnList(npList), expectedList);
43 TEST(UtilTest, CreateTickerCipher) {
44 auto cipher = FizzUtil::createTicketCipher<server::AES128TicketCipher>(
45 std::vector<std::string>(),
46 "fakeSecretttttttttttttttttttttttttt",
47 std::vector<std::string>(),
49 std::chrono::seconds(100),
59 auto newCipher = FizzUtil::createTicketCipher<server::AES128TicketCipher>(
60 std::vector<std::string>(),
61 "fakeSecrettttttttttttttttttttttttt2",
62 std::vector<std::string>(),
63 std::chrono::seconds(100),
68 std::get<0>(newCipher->decrypt(
std::move(std::get<0>(*blob))).get()),
77 FizzUtil::readPrivateKey(testFile.
path().native(),
"");
84 FizzUtil::readPrivateKey(testFile.
path().native(),
""),
89 TEST(UtilTest, ReadChainFile) {
99 FizzUtil::readChainFile(testFile.
path().native()), std::runtime_error);
103 FizzUtil::readChainFile(
"test_file_does_not_exist"),
#define EXPECT_THROW(statement, expected_exception)
constexpr folly::StringPiece kP256Key
#define EXPECT_EQ(val1, val2)
constexpr detail::Map< Move > move
auto begin(TestAdlIterable &instance)
—— Concurrent Priority Queue Implementation ——
constexpr auto size(C const &c) -> decltype(c.size())
auto end(TestAdlIterable &instance)
const fs::path & path() const
void writeFileAtomic(StringPiece filename, iovec *iov, int count, mode_t permissions)
Range< const char * > StringPiece
constexpr folly::StringPiece kP384Key
TEST(SequencedExecutor, CPUThreadPoolExecutor)
constexpr folly::StringPiece kP256Certificate