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

Function test_map_erase

tests/misc/containers.cpp:529–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

527// Erase operations for map containers
528template<typename Map>
529void test_map_erase() {
530 Map m;
531 m.insert(fl::make_pair(1, 100));
532 m.insert(fl::make_pair(2, 200));
533 m.insert(fl::make_pair(3, 300));
534
535 FL_CHECK(m.size() == 3);
536
537 // Erase by key
538 auto count = m.erase(2);
539 FL_CHECK(count == 1);
540 FL_CHECK(m.size() == 2);
541 FL_CHECK(m.find(2) == m.end());
542}
543
544// Iteration for map containers
545template<typename Map>

Callers

nothing calls this directly

Calls 6

make_pairFunction · 0.85
insertMethod · 0.45
sizeMethod · 0.45
eraseMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected