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

Function TEST

valdi/test/runtime/DiskCache_tests.cpp:50–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50TEST(DiskCache, canStoreAndRetrieve) {
51 TemporaryDirectory directory;
52 DiskCacheImpl diskCache(directory.get());
53
54 auto result = diskCache.store(Path("hello"), createContent("world"));
55 ASSERT_TRUE(result.success()) << result.description();
56
57 auto loadResult = diskCache.load(Path("hello"));
58 ASSERT_TRUE(loadResult.success()) << loadResult.description();
59
60 ASSERT_EQ(createContent("world"), loadResult.value());
61}
62
63TEST(DiskCache, failOnInvalidFile) {
64 TemporaryDirectory directory;

Callers

nothing calls this directly

Calls 13

createContentFunction · 0.85
descriptionMethod · 0.80
hasPrefixMethod · 0.80
hasSuffixMethod · 0.80
getMethod · 0.65
storeMethod · 0.65
loadMethod · 0.65
valueMethod · 0.65
removeMethod · 0.65
appendMethod · 0.65
PathClass · 0.50
successMethod · 0.45

Tested by

no test coverage detected