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

Function test_addition_impl

tests/fl/math/fixed_point.cpp:407–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405
406template<typename T>
407void test_addition_impl() {
408 T a(1.0f), b(2.0f);
409 T c = a + b;
410 FL_CHECK_EQ(c.raw(), (a.raw() + b.raw()));
411 FL_CHECK_EQ(c.to_int(), 3);
412
413 // Zero identity
414 T zero;
415 FL_CHECK_EQ((a + zero).raw(), a.raw());
416
417 // Commutativity
418 FL_CHECK_EQ((a + b).raw(), (b + a).raw());
419}
420
421template<typename T>
422void test_subtraction_impl() {

Callers

nothing calls this directly

Calls 2

rawMethod · 0.45
to_intMethod · 0.45

Tested by

no test coverage detected