MCPcopy Create free account
hub / github.com/apache/qpid-proton / test_use

Function test_use

cpp/src/map_test.cpp:44–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44void test_use() {
45 proton::map<string, scalar> m;
46
47 m.put("x", "y");
48 ASSERT_EQUAL(scalar("y"), m.get("x"));
49 ASSERT(!m.empty());
50 ASSERT(m.exists("x"));
51 ASSERT_EQUAL(1U, m.size());
52
53 m.put("a", "b");
54 ASSERT_EQUAL(scalar("b"), m.get("a"));
55 ASSERT_EQUAL(2U, m.size());
56
57 ASSERT_EQUAL(1U, m.erase("x"));
58 ASSERT_EQUAL(1U, m.size());
59 ASSERT(!m.exists("x"));
60 ASSERT_EQUAL(scalar("b"), m.get("a"));
61
62 m.clear();
63 ASSERT(m.empty());
64}
65
66void test_cppmap() {
67 std::map<string, scalar> sm;

Callers 1

mainFunction · 0.85

Calls 8

existsMethod · 0.80
eraseMethod · 0.80
scalarClass · 0.50
putMethod · 0.45
getMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected