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

Function UNIT_TEST

libs/base/base_tests/bidirectional_map_tests.cpp:14–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12using namespace std;
13
14UNIT_TEST(BidirectionalMap_Smoke)
15{
16 BidirectionalMap<int, string> m;
17 m.Add(1, "a");
18
19 {
20 string value;
21 TEST(m.GetValue(1, value), ());
22 TEST_EQUAL(value, "a", ());
23 }
24 {
25 int key;
26 TEST(m.GetKey("a", key), ());
27 TEST_EQUAL(key, 1, ());
28 }
29
30 TEST(!m.Add(1, "b"), ());
31 TEST(!m.Add(2, "a"), ());
32 TEST(m.Add(2, "b"), ());
33 TEST(!m.Add(2, "b"), ());
34}
35
36UNIT_TEST(BidirectionalMap_Remove)
37{

Callers

nothing calls this directly

Calls 8

TESTFunction · 0.85
RemoveKeyMethod · 0.80
RemoveValueMethod · 0.80
AddMethod · 0.45
GetValueMethod · 0.45
GetKeyMethod · 0.45
SizeMethod · 0.45
IsEmptyMethod · 0.45

Tested by

no test coverage detected