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

Function test_map_bounds

tests/test_container_helpers.h:937–959  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

935// Verifies: binary search operations return valid iterators
936template<template<typename, typename> class MapTemplate>
937void test_map_bounds() {
938 using MapContainer = MapTemplate<int, fl::shared_ptr<int>>;
939
940 MapContainer m;
941 populate_map(m, 10, make_shared_int(100));
942 populate_map(m, 20, make_shared_int(200));
943 populate_map(m, 30, make_shared_int(300));
944
945 // Test lower_bound
946 auto lower = m.lower_bound(15);
947 FL_CHECK(lower != m.end());
948 FL_CHECK(lower->first >= 15);
949
950 // Test upper_bound
951 auto upper = m.upper_bound(20);
952 FL_CHECK(upper != m.end());
953 FL_CHECK(upper->first > 20);
954
955 // Test equal_range
956 auto range = m.equal_range(20);
957 FL_CHECK(range.first != m.end());
958 FL_CHECK(range.first->first == 20);
959}
960
961// Test insert and erase with iterators
962// Verifies: insert returns valid iterator, erase returns next iterator

Callers

nothing calls this directly

Calls 6

populate_mapFunction · 0.85
make_shared_intFunction · 0.85
lower_boundMethod · 0.45
endMethod · 0.45
upper_boundMethod · 0.45
equal_rangeMethod · 0.45

Tested by

no test coverage detected