proxygen
SSLSessionCacheManagerTest.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2017-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #include <glog/logging.h>
19 #include <folly/Random.h>
20 
21 using std::shared_ptr;
22 using namespace folly;
23 using namespace wangle;
24 
25 TEST(ShardedLocalSSLSessionCacheTest, TestHash) {
26  uint32_t buckets = 10;
27  uint32_t cacheSize = 20;
28  uint32_t cacheCullSize = 100;
29 
30  std::array<uint8_t, 32> id;
31  Random::secureRandom(id.data(), id.size());
32 
33  ShardedLocalSSLSessionCache cache(buckets, cacheSize, cacheCullSize);
34  cache.hash(std::string((char*)id.data(), id.size()));
35 }
static std::enable_if< std::is_integral< T >::value &&!std::is_same< T, bool >::value, T >::type secureRandom()
Definition: Random.h:112
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
constexpr auto size(C const &c) -> decltype(c.size())
Definition: Access.h:45
constexpr auto data(C &c) -> decltype(c.data())
Definition: Access.h:71
const char * string
Definition: Conv.cpp:212
TEST(SequencedExecutor, CPUThreadPoolExecutor)
size_t hash(const std::string &key)