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

Method testConverters

test/tests/containers/TestSet.h:426–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424 }
425
426 void testConverters() {
427
428 Set<int> set1(mAllocator);
429
430 rp3d_test(set1.begin() == set1.end());
431
432 set1.add(1);
433 set1.add(2);
434 set1.add(3);
435 set1.add(4);
436
437 Array<int> array1 = set1.toArray(mAllocator);
438 rp3d_test(array1.size() == 4);
439 rp3d_test(array1.find(1) != array1.end());
440 rp3d_test(array1.find(2) != array1.end());
441 rp3d_test(array1.find(3) != array1.end());
442 rp3d_test(array1.find(4) != array1.end());
443 rp3d_test(array1.find(5) == array1.end());
444 rp3d_test(array1.find(6) == array1.end());
445
446 Set<int> set2(mAllocator);
447 Array<int> array2 = set2.toArray(mAllocator);
448 rp3d_test(array2.size() == 0);
449 }
450 };
451
452}

Callers

nothing calls this directly

Calls 6

toArrayMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
addMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected