MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / TEST

Function TEST

source/test/ordered_map_test.cpp:7–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5using namespace Star;
6
7TEST(OrderedMap, Insert) {
8 OrderedMap<int, int> map;
9 map.insert({3, 3});
10 map.insert({2, 2});
11 map.insert({1, 1});
12
13 {
14 List<int> comp = {3, 2, 1};
15 EXPECT_EQ(comp, map.keys());
16 }
17
18 {
19 List<int> comp = {3, 2, 1};
20 List<int> keys;
21 for (auto i = map.begin(); i != map.end(); ++i)
22 keys.append(i->first);
23 EXPECT_EQ(comp, keys);
24 }
25
26 {
27 List<int> comp = {1, 2, 3};
28 List<int> keys;
29 for (auto i = map.rbegin(); i != map.rend(); ++i)
30 keys.append(i->first);
31 EXPECT_EQ(comp, keys);
32 }
33}
34
35TEST(OrderedMap, Getters) {
36 OrderedMap<int, int> map;

Callers

nothing calls this directly

Calls 14

sortByKeyMethod · 0.80
sortByValueMethod · 0.80
insertMethod · 0.45
keysMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
appendMethod · 0.45
rbeginMethod · 0.45
rendMethod · 0.45
getMethod · 0.45
ptrMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected