@@ -82,4 +82,53 @@ GTEST_TEST(hashmap, metadata)
8282 }
8383 hud_assert_eq (indices[0 ], 0 );
8484 hud_assert_eq (indices[1 ], 4 );
85- }
85+ }
86+
87+ GTEST_TEST (array, count_return_count_of_element)
88+ {
89+ // using type = usize;
90+ // using HashMapType = hud::hashmap<type, type>;
91+
92+ // const auto test = []()
93+ // {
94+ // HashMapType map;
95+
96+ // // Count return 0 if array is empty
97+ // bool empty_ok = map.count() == 0;
98+
99+ // // Count return number of element if not empty
100+ // constexpr usize COUNT = 256;
101+ // for (usize value = 0; value < COUNT; value++)
102+ // {
103+ // map.add(value, value);
104+ // }
105+ // bool return_correct_count = map.count() == COUNT;
106+
107+ // // Count return number of element after remove
108+ // // Remove half
109+ // for (usize value = 0; value < COUNT; value += 2)
110+ // {
111+ // map.erase(value);
112+ // }
113+ // bool return_correct_count_after_erase_some = map.count() == COUNT;
114+ // return std::tuple {empty_ok, return_correct_count, return_correct_count_after_erase_some};
115+ // };
116+
117+ // // Non constant
118+ // {
119+ // HashMapType map;
120+ // const auto result = test();
121+ // hud_assert_eq(std::get<0>(result));
122+ // hud_assert_eq(std::get<1>(result));
123+ // hud_assert_eq(std::get<2>(result));
124+ // }
125+
126+ // // Constant
127+ // {
128+ // HashMapType map;
129+ // constexpr auto result = test();
130+ // hud_assert_eq(std::get<0>(result));
131+ // hud_assert_eq(std::get<1>(result));
132+ // hud_assert_eq(std::get<2>(result));
133+ // }
134+ }
0 commit comments