MCPcopy Create free account
hub / github.com/Snapchat/Valdi / TEST

Function TEST

valdi/test/runtime/EncryptedDiskCache_tests.cpp:26–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26TEST(EncryptedDiskCache, generatesKeyWhenKeychainEmpty) {
27 auto innerDiskCache = makeShared<InMemoryDiskCache>();
28 auto keychain = makeShared<InMemoryKeychain>();
29 auto diskCache = makeShared<EncryptedDiskCache>(innerDiskCache, keychain);
30
31 ASSERT_TRUE(keychain->get(EncryptedDiskCache::getKeychainKey()).empty());
32
33 auto result = diskCache->store(Path("file.txt"), makeData("Hello World"));
34 ASSERT_TRUE(result) << result.description();
35
36 ASSERT_FALSE(keychain->get(EncryptedDiskCache::getKeychainKey()).empty());
37}
38
39TEST(EncryptedDiskCache, restoresKeyWhenKeychainNonEmpty) {
40 auto innerDiskCache = makeShared<InMemoryDiskCache>();

Callers

nothing calls this directly

Calls 10

makeDataFunction · 0.85
descriptionMethod · 0.80
asStringViewMethod · 0.80
getMethod · 0.65
storeMethod · 0.65
loadMethod · 0.65
valueMethod · 0.65
PathClass · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected