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

Function UNIT_TEST

libs/base/base_tests/control_flow_tests.cpp:32–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30} // namespace
31
32UNIT_TEST(ControlFlow_Smoke)
33{
34 {
35 Repeater repeater(10);
36 uint32_t c = 0;
37 repeater.ForEach([&c] { ++c; });
38
39 TEST_EQUAL(c, 10, ());
40 TEST_EQUAL(c, repeater.m_repetitions, ());
41 TEST_EQUAL(c, repeater.m_calls, ());
42 }
43
44 {
45 Repeater repeater(10);
46 uint32_t c = 0;
47 repeater.ForEach([&c]
48 {
49 ++c;
50 if (c == 5)
51 return ControlFlow::Break;
52 return ControlFlow::Continue;
53 });
54
55 TEST_EQUAL(c, 5, ());
56 TEST_EQUAL(c, repeater.m_calls, ());
57 }
58}

Callers

nothing calls this directly

Calls 1

ForEachMethod · 0.45

Tested by

no test coverage detected