MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / testContainsKey

Method testContainsKey

test/tests/containers/TestMap.h:275–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273 }
274
275 void testContainsKey() {
276
277 Map<int, int> map1(mAllocator);
278
279 rp3d_test(!map1.containsKey(2));
280 rp3d_test(!map1.containsKey(4));
281 rp3d_test(!map1.containsKey(6));
282
283 map1.add(Pair<int, int>(2, 20));
284 map1.add(Pair<int, int>(4, 40));
285 map1.add(Pair<int, int>(6, 60));
286
287 rp3d_test(map1.containsKey(2));
288 rp3d_test(map1.containsKey(4));
289 rp3d_test(map1.containsKey(6));
290
291 map1.remove(4);
292 rp3d_test(!map1.containsKey(4));
293 rp3d_test(map1.containsKey(2));
294 rp3d_test(map1.containsKey(6));
295
296 map1.clear();
297 rp3d_test(!map1.containsKey(2));
298 rp3d_test(!map1.containsKey(6));
299 }
300
301 void testIndexing() {
302

Callers

nothing calls this directly

Calls 4

containsKeyMethod · 0.80
addMethod · 0.45
removeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected