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

Function test_container_comparison

tests/test_container_helpers.h:747–769  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

745// Test container comparison operators
746template<typename Container>
747void test_container_comparison() {
748 Container c1, c2;
749 auto ptr1 = make_shared_int(1);
750 auto ptr2 = make_shared_int(1);
751
752 // Populate both with same pointer (so they're actually equal)
753 populate(c1, ptr1);
754 populate(c2, ptr1);
755
756 // Test equality - COMPILER ERROR if operator== doesn't exist
757 FL_CHECK(c1 == c2);
758 FL_CHECK(!(c1 != c2));
759
760 // Test with different pointers
761 Container c3;
762 populate(c3, ptr2);
763 // c3 may or may not be equal to c1 depending on pointer comparison
764 // (with different pointers, it's likely not equal or less than)
765 // Test operator< - COMPILER ERROR if operator< doesn't exist
766 if (c1 < c3 || c3 < c1 || c1 == c3) {
767 FL_CHECK(true); // At least one comparison worked
768 }
769}
770
771// ============================================================================
772// MAP-SPECIFIC ITERATOR TESTS

Callers

nothing calls this directly

Calls 2

make_shared_intFunction · 0.85
populateFunction · 0.85

Tested by

no test coverage detected