| 884 | // Verifies: find() returns valid iterator, dereferencing works |
| 885 | template<template<typename, typename> class MapTemplate> |
| 886 | void test_map_find_and_iterate() { |
| 887 | using MapContainer = MapTemplate<int, fl::shared_ptr<int>>; |
| 888 | |
| 889 | MapContainer m; |
| 890 | auto ptr42 = make_shared_int(42); |
| 891 | populate_map(m, 5, ptr42); |
| 892 | populate_map(m, 10, make_shared_int(100)); |
| 893 | |
| 894 | // Find and dereference |
| 895 | auto it = m.find(5); |
| 896 | FL_CHECK(it != m.end()); |
| 897 | FL_CHECK(it->first == 5); |
| 898 | FL_CHECK(*it->second == 42); |
| 899 | |
| 900 | // Iterate from find result |
| 901 | int count = 0; |
| 902 | for (auto it2 = it; it2 != m.end(); ++it2) { |
| 903 | count++; |
| 904 | } |
| 905 | FL_CHECK(count >= 1); // At least the found element and beyond |
| 906 | } |
| 907 | |
| 908 | // Test const iterator functionality |
| 909 | // Verifies: const_iterator works with find |
nothing calls this directly
no test coverage detected