MCPcopy Create free account
hub / github.com/facebook/CacheLib / genRandomStr

Function genRandomStr

cachelib/allocator/nvmcache/tests/NvmCacheTests.cpp:32–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31namespace {
32std::string genRandomStr(size_t len) {
33 std::string text;
34 text.reserve(len);
35 for (unsigned int i = 0; i < len; i++) {
36 // avoid char 0 in string
37 text += static_cast<char>(folly::Random::rand32() % UCHAR_MAX + 1);
38 }
39 return text;
40}
41} // namespace
42TEST_F(NvmCacheTest, Config) {
43 struct MockEncryptor : public navy::DeviceEncryptor {

Callers 1

TEST_FFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected