proxygen
|
#include <folly/futures/Barrier.h>
#include <wangle/client/persistence/FilePersistentCache.h>
#include <wangle/client/persistence/SharedMutexCacheLockGuard.h>
#include <wangle/client/persistence/test/TestUtil.h>
Go to the source code of this file.
Classes | |
class | FilePersistentCacheTest< MutexT > |
Typedefs | |
using | MutexTypes = ::testing::Types< std::mutex, folly::SharedMutex > |
Functions | |
TYPED_TEST_CASE (FilePersistentCacheTest, MutexTypes) | |
TYPED_TEST (FilePersistentCacheTest, stringTypesGetPutTest) | |
TYPED_TEST (FilePersistentCacheTest, basicTypeGetPutTest) | |
TYPED_TEST (FilePersistentCacheTest, stringCompositeGetPutTest) | |
TYPED_TEST (FilePersistentCacheTest, stringNestedValGetPutTest) | |
TYPED_TEST (FilePersistentCacheTest, stringNestedKeyValGetPutTest) | |
template<typename K , typename V , typename MutexT > | |
void | testEmptyFile () |
TYPED_TEST (FilePersistentCacheTest, stringTypesEmptyFile) | |
TYPED_TEST (FilePersistentCacheTest, stringNestedValEmptyFile) | |
template<typename K , typename V , typename MutexT > | |
void | testInvalidFile (const std::string &content) |
TYPED_TEST (FilePersistentCacheTest, stringTypesInvalidFile) | |
TYPED_TEST (FilePersistentCacheTest, stringNestedValInvalidFile) | |
template<typename K , typename V , typename MutexT > | |
void | testValidFile (const std::string &content, const vector< K > &keys, const vector< V > &values) |
TYPED_TEST (FilePersistentCacheTest, stringTypesValidFileTest) | |
TYPED_TEST (FilePersistentCacheTest, basicEvictionTest) | |
TYPED_TEST (FilePersistentCacheTest, backwardCompatiblityTest) | |
TYPED_TEST (FilePersistentCacheTest, destroy) | |
TYPED_TEST (FilePersistentCacheTest, threadstress) | |
using MutexTypes = ::testing::Types<std::mutex, folly::SharedMutex> |
Definition at line 30 of file FilePersistentCacheTest.cpp.
void testEmptyFile | ( | ) |
Definition at line 96 of file FilePersistentCacheTest.cpp.
References folly::closeNoInt(), EXPECT_EQ, EXPECT_TRUE, wangle::getPersistentCacheFilename(), and folly::openNoInt().
void testInvalidFile | ( | const std::string & | content | ) |
Definition at line 126 of file FilePersistentCacheTest.cpp.
References folly::closeNoInt(), EXPECT_EQ, EXPECT_TRUE, wangle::getPersistentCacheFilename(), folly::openNoInt(), and folly::writeFull().
void testValidFile | ( | const std::string & | content, |
const vector< K > & | keys, | ||
const vector< V > & | values | ||
) |
Definition at line 160 of file FilePersistentCacheTest.cpp.
References folly::closeNoInt(), EXPECT_EQ, EXPECT_TRUE, wangle::getPersistentCacheFilename(), i, folly::openNoInt(), and folly::writeFull().
TYPED_TEST | ( | FilePersistentCacheTest | , |
stringTypesGetPutTest | |||
) |
Definition at line 33 of file FilePersistentCacheTest.cpp.
References string, and values().
TYPED_TEST | ( | FilePersistentCacheTest | , |
basicTypeGetPutTest | |||
) |
Definition at line 41 of file FilePersistentCacheTest.cpp.
References values().
TYPED_TEST | ( | FilePersistentCacheTest | , |
stringCompositeGetPutTest | |||
) |
Definition at line 49 of file FilePersistentCacheTest.cpp.
References string, and values().
TYPED_TEST | ( | FilePersistentCacheTest | , |
stringNestedValGetPutTest | |||
) |
Definition at line 58 of file FilePersistentCacheTest.cpp.
References string, and values().
TYPED_TEST | ( | FilePersistentCacheTest | , |
stringNestedKeyValGetPutTest | |||
) |
Definition at line 75 of file FilePersistentCacheTest.cpp.
References values().
TYPED_TEST | ( | FilePersistentCacheTest | , |
stringTypesEmptyFile | |||
) |
TYPED_TEST | ( | FilePersistentCacheTest | , |
stringNestedValEmptyFile | |||
) |
TYPED_TEST | ( | FilePersistentCacheTest | , |
stringTypesInvalidFile | |||
) |
TYPED_TEST | ( | FilePersistentCacheTest | , |
stringNestedValInvalidFile | |||
) |
TYPED_TEST | ( | FilePersistentCacheTest | , |
stringTypesValidFileTest | |||
) |
Definition at line 187 of file FilePersistentCacheTest.cpp.
References string, and values().
TYPED_TEST | ( | FilePersistentCacheTest | , |
basicEvictionTest | |||
) |
Definition at line 196 of file FilePersistentCacheTest.cpp.
References EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, wangle::FilePersistentCache< K, V, M >::get(), wangle::getPersistentCacheFilename(), folly::Optional< Value >::hasValue(), i, wangle::FilePersistentCache< K, V, M >::put(), wangle::FilePersistentCache< K, V, M >::size(), and folly::Optional< Value >::value().
TYPED_TEST | ( | FilePersistentCacheTest | , |
backwardCompatiblityTest | |||
) |
Definition at line 223 of file FilePersistentCacheTest.cpp.
References folly::closeNoInt(), EXPECT_EQ, EXPECT_TRUE, wangle::getPersistentCacheFilename(), folly::openNoInt(), string, values(), and folly::writeFull().
TYPED_TEST | ( | FilePersistentCacheTest | , |
destroy | |||
) |
Definition at line 268 of file FilePersistentCacheTest.cpp.
References wangle::getPersistentCacheFilename(), and string.
TYPED_TEST | ( | FilePersistentCacheTest | , |
threadstress | |||
) |
Definition at line 280 of file FilePersistentCacheTest.cpp.
References b, EXPECT_EQ, EXPECT_TRUE, wangle::getPersistentCacheFilename(), i, threads, val, and folly::futures::Barrier::wait().
TYPED_TEST_CASE | ( | FilePersistentCacheTest | , |
MutexTypes | |||
) |