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

Function test_map_insert_find

tests/misc/containers.cpp:495–511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493// Insert/Find operations for map containers
494template<typename Map>
495void test_map_insert_find() {
496 Map m;
497 m.insert(fl::make_pair(1, 100));
498 m.insert(fl::make_pair(2, 200));
499 m.insert(fl::make_pair(3, 300));
500
501 FL_CHECK(m.size() == 3);
502
503 // Find existing keys
504 auto it = m.find(2);
505 FL_CHECK(it != m.end());
506 FL_CHECK(it->second == 200);
507
508 // Find non-existing key
509 auto it_not = m.find(99);
510 FL_CHECK(it_not == m.end());
511}
512
513// Operator[] access for map containers
514template<typename Map>

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected