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

Function test_right_shift_impl

tests/fl/math/fixed_point.cpp:508–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506
507template<typename T>
508void test_right_shift_impl() {
509 T a(4.0f);
510 T b = a >> 1;
511 FL_CHECK_EQ(b.to_int(), 2);
512 FL_CHECK_EQ(b.raw(), a.raw() >> 1);
513
514 T c = a >> 2;
515 FL_CHECK_EQ(c.to_int(), 1);
516 FL_CHECK_EQ(c.raw(), a.raw() >> 2);
517
518 // Shift by 0 is identity
519 FL_CHECK_EQ((a >> 0).raw(), a.raw());
520}
521
522template<typename T>
523void test_comparisons_impl() {

Callers

nothing calls this directly

Calls 2

to_intMethod · 0.45
rawMethod · 0.45

Tested by

no test coverage detected