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

Method testIterators

test/tests/containers/TestMap.h:408–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406 }
407
408 void testIterators() {
409
410 Map<int, int> map1(mAllocator);
411
412 rp3d_test(map1.begin() == map1.end());
413
414 map1.add(Pair<int, int>(1, 5));
415 map1.add(Pair<int, int>(2, 6));
416 map1.add(Pair<int, int>(3, 8));
417 map1.add(Pair<int, int>(4, -1));
418
419 Map<int, int>::Iterator itBegin = map1.begin();
420 Map<int, int>::Iterator it = map1.begin();
421
422 rp3d_test(itBegin == it);
423
424 size_t size = 0;
425 for (auto it = map1.begin(); it != map1.end(); ++it) {
426 rp3d_test(map1.containsKey(it->first));
427 size++;
428 }
429 rp3d_test(map1.size() == size);
430 }
431 };
432
433}

Callers

nothing calls this directly

Calls 5

containsKeyMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
addMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected