MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_comparisons_impl

Function test_comparisons_impl

tests/fl/math/fixed_point.cpp:523–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

521
522template<typename T>
523void test_comparisons_impl() {
524 T a(1.0f), b(2.0f), c(1.0f);
525 T neg(-1.0f);
526 T zero;
527
528 // Equality
529 FL_CHECK(a == c);
530 FL_CHECK_FALSE(a == b);
531 FL_CHECK_EQ(a.raw(), c.raw());
532
533 // Inequality
534 FL_CHECK(a != b);
535 FL_CHECK_FALSE(a != c);
536
537 // Less than
538 FL_CHECK(a < b);
539 FL_CHECK_FALSE(b < a);
540 FL_CHECK_FALSE(a < c);
541
542 // Greater than
543 FL_CHECK(b > a);
544 FL_CHECK_FALSE(a > b);
545 FL_CHECK_FALSE(a > c);
546
547 // Less than or equal
548 FL_CHECK(a <= b);
549 FL_CHECK(a <= c);
550 FL_CHECK_FALSE(b <= a);
551
552 // Greater than or equal
553 FL_CHECK(b >= a);
554 FL_CHECK(a >= c);
555 FL_CHECK_FALSE(a >= b);
556
557 // Negative comparisons
558 FL_CHECK(neg < zero);
559 FL_CHECK(neg < a);
560 FL_CHECK(zero > neg);
561 FL_CHECK(a > neg);
562}
563
564template<typename T>
565void test_floor_ceil_impl() {

Callers

nothing calls this directly

Calls 1

rawMethod · 0.45

Tested by

no test coverage detected