MCPcopy Create free account
hub / github.com/comaps/comaps / UNIT_TEST

Function UNIT_TEST

libs/base/base_tests/fifo_cache_test.cpp:46–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44};
45
46UNIT_TEST(FifoCache_Smoke)
47{
48 using Key = int;
49 using Value = int;
50 FifoCacheTest<Key, Value> cache(3 /* capacity */, [](Key k, Value & v) { v = k; } /* loader */);
51
52 TEST_EQUAL(cache.GetValue(1), 1, ());
53 TEST_EQUAL(cache.GetValue(2), 2, ());
54 TEST_EQUAL(cache.GetValue(3), 3, ());
55 TEST_EQUAL(cache.GetValue(4), 4, ());
56 TEST_EQUAL(cache.GetValue(1), 1, ());
57 TEST(cache.IsValid(), ());
58}
59
60UNIT_TEST(FifoCache)
61{

Callers

nothing calls this directly

Calls 5

TESTFunction · 0.85
GetValueMethod · 0.45
IsValidMethod · 0.45
cbeginMethod · 0.45
cendMethod · 0.45

Tested by

no test coverage detected