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

Function TEST

valdi/test/runtime/PersistentStore_tests.cpp:47–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45TEST(PersistentStore, generatesAKeyWhenCreatedTheFirstTime) {
46 PersistentStoreDependencies dependencies;
47
48 auto metadata = dependencies.keyChain->get(EncryptedDiskCache::getKeychainKey());
49
50 ASSERT_TRUE(metadata.empty());
51
52 auto userSession = Valdi::makeShared<UserSession>(STRING_LITERAL("4242"));
53
54 auto store = Valdi::makeShared<PersistentStore>(STRING_LITERAL("somepath"),
55 dependencies.diskCache,
56 userSession,
57 dependencies.keyChain,
58 dependencies.dispatchQueue,
59 dependencies.logger,
60 0,
61 true);
62 store->populate();
63 dependencies.dispatchQueue->sync([]() {});
64
65 metadata = dependencies.keyChain->get(EncryptedDiskCache::getKeychainKey());
66}
67
68TEST(PersistentStore, encryptsDataWhenKeychainSet) {
69 PersistentStoreDependencies dependencies;
70 auto store = Valdi::makeShared<PersistentStore>(STRING_LITERAL("somepath"),
71 dependencies.diskCache,

Callers

nothing calls this directly

Calls 15

getGlobalFunction · 0.85
makeBytesFunction · 0.85
descriptionMethod · 0.80
makeStringMethod · 0.80
asStringViewMethod · 0.80
getUpdateSequenceMethod · 0.80
getMethod · 0.65
enterMethod · 0.65
storeMethod · 0.65
loadMethod · 0.65
valueMethod · 0.65

Tested by

no test coverage detected