| 813 | // Verifies: rbegin/rend work correctly |
| 814 | template<template<typename, typename> class MapTemplate> |
| 815 | void test_map_reverse_iterators() { |
| 816 | using MapContainer = MapTemplate<int, fl::shared_ptr<int>>; |
| 817 | |
| 818 | MapContainer source; |
| 819 | populate_map(source, 1, make_shared_int(10)); |
| 820 | populate_map(source, 2, make_shared_int(20)); |
| 821 | populate_map(source, 3, make_shared_int(30)); |
| 822 | |
| 823 | // Test reverse iterators exist |
| 824 | FL_CHECK(source.rbegin() != source.rend()); |
| 825 | |
| 826 | // Count reverse iteration |
| 827 | int count = 0; |
| 828 | for (auto rit = source.rbegin(); rit != source.rend(); ++rit) { |
| 829 | count++; |
| 830 | } |
| 831 | FL_CHECK(count == 3); |
| 832 | |
| 833 | // Move and verify |
| 834 | MapContainer destination = fl::move(source); |
| 835 | FL_CHECK(source.rbegin() == source.rend()); // Empty |
| 836 | FL_CHECK(destination.rbegin() != destination.rend()); |
| 837 | } |
| 838 | |
| 839 | // Test iterator arithmetic for RandomAccessIterator maps (like flat_map) |
| 840 | // Verifies: operator+, operator-, distance calculations |
nothing calls this directly
no test coverage detected