MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / test

Function test

tests/basic/test-cached-value.cpp:51–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void test()
52{
53 geode::CachedValue< Value > cache;
54 geode::OpenGeodeBasicException::test(
55 nb_computed == 0, "Wrong number of computations" );
56 geode::OpenGeodeBasicException::test(
57 cache( compute_value, 12., 15 ).test() == 27, "Wrong result" );
58 geode::OpenGeodeBasicException::test(
59 nb_computed == 1, "Wrong number of computations" );
60 geode::OpenGeodeBasicException::test(
61 cache( compute_value, 12., 15 ).test() == 27, "Wrong result" );
62 geode::OpenGeodeBasicException::test(
63 cache( compute_value, 1., 5 ).test() == 27, "Wrong result" );
64 geode::OpenGeodeBasicException::test(
65 nb_computed == 1, "Wrong number of computations" );
66 cache.reset();
67 geode::OpenGeodeBasicException::test(
68 cache( compute_value, 2., 5 ).test() == 7, "Wrong result" );
69 geode::OpenGeodeBasicException::test(
70 nb_computed == 2, "Wrong number of computations" );
71}
72
73OPENGEODE_TEST( "cached-value" )

Callers

nothing calls this directly

Calls 2

testMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected