MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / testComparators

Function testComparators

src/ImathTest/testBox.cpp:363–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361
362template <class T>
363void
364testComparators (const char* type)
365{
366 cout << " comparators for type " << type << endl;
367
368 IMATH_INTERNAL_NAMESPACE::Rand32 rand (0);
369
370 //
371 // Compare empty.
372 //
373 {
374 IMATH_INTERNAL_NAMESPACE::Box<T> b0;
375 IMATH_INTERNAL_NAMESPACE::Box<T> b1;
376
377 assert (b0 == b1);
378 assert (!(b0 != b1));
379 }
380
381 //
382 // Compare empty to non-empty.
383 //
384 {
385 std::vector<T> perms;
386 permutations (perms);
387
388 for (unsigned int i = 0; i < perms.size (); i++)
389 {
390 for (unsigned int j = 0; j < perms.size (); j++)
391 {
392 T p0 = -perms[i];
393 T p1 = perms[j];
394
395 IMATH_INTERNAL_NAMESPACE::Box<T> b0;
396 IMATH_INTERNAL_NAMESPACE::Box<T> b1 (p0, p1);
397 assert (!(b0 == b1));
398 assert (b0 != b1);
399 }
400 }
401 }
402
403 //
404 // Compare two non-empty
405 //
406 {
407 std::vector<T> perms;
408 permutations (perms);
409
410 for (unsigned int i = 0; i < perms.size (); i++)
411 {
412 for (unsigned int j = 0; j < perms.size (); j++)
413 {
414 T p0 = -perms[i];
415 T p1 = perms[j];
416
417 T p2 = -perms[j];
418 T p3 = perms[i];
419
420 IMATH_INTERNAL_NAMESPACE::Box<T> b0 (p0, p1);

Callers

nothing calls this directly

Calls 2

permutationsFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected