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

Function test_iterator_arithmetic

tests/test_container_helpers.h:732–743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730// Test iterator arithmetic for RandomAccessIterator
731template<typename Container>
732void test_iterator_arithmetic() {
733 Container c;
734 populate(c, make_shared_int(10));
735 populate(c, make_shared_int(20));
736 populate(c, make_shared_int(30));
737
738 // Test operator+ on iterators - COMPILER ERROR if operator+ doesn't exist
739 auto it0 = c.begin();
740 auto it1 = c.begin() + 1;
741 FL_CHECK(it1 - it0 == 1); // Distance check
742 FL_CHECK(*(c.begin() + 1) != *c.begin()); // Different elements
743}
744
745// Test container comparison operators
746template<typename Container>

Callers

nothing calls this directly

Calls 3

populateFunction · 0.85
make_shared_intFunction · 0.85
beginMethod · 0.45

Tested by

no test coverage detected