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

Function testComparators

src/ImathTest/testInterval.cpp:269–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267
268template <class T>
269void
270testComparators (const char* type)
271{
272 cout << " comparators for type " << type << endl;
273
274 IMATH_INTERNAL_NAMESPACE::Rand32 rand (0);
275
276 //
277 // Compare empty.
278 //
279 {
280 IMATH_INTERNAL_NAMESPACE::Interval<T> b0;
281 IMATH_INTERNAL_NAMESPACE::Interval<T> b1;
282
283 assert (b0 == b1);
284 assert (!(b0 != b1));
285 }
286
287 //
288 // Compare empty to non-empty.
289 //
290 {
291 T p0 (-1);
292 T p1 (1);
293
294 IMATH_INTERNAL_NAMESPACE::Interval<T> b0;
295 IMATH_INTERNAL_NAMESPACE::Interval<T> b1 (p0, p1);
296 assert (!(b0 == b1));
297 assert (b0 != b1);
298 }
299
300 //
301 // Compare two non-empty
302 //
303 {
304 T p0 (-1);
305 T p1 (1);
306
307 T p2 (-2);
308 T p3 (2);
309
310 IMATH_INTERNAL_NAMESPACE::Interval<T> b0 (p0, p1);
311 IMATH_INTERNAL_NAMESPACE::Interval<T> b1 (p2, p3);
312 IMATH_INTERNAL_NAMESPACE::Interval<T> b2 (p0, p1);
313
314 assert (b0 != b1);
315 assert (!(b0 == b1));
316
317 assert (b0 == b2);
318 assert (!(b0 != b2));
319 }
320}
321
322template <class T>
323void

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected