| 1592 | |
| 1593 | template <typename Factory> |
| 1594 | void test_pmr_insert_allocates() { |
| 1595 | tracking_memory_resource mr; |
| 1596 | typename Factory::container_type c = Factory::create(mr); |
| 1597 | for (int i = 0; i < kPmrInsertCount; ++i) { |
| 1598 | Factory::insert(c, i); |
| 1599 | } |
| 1600 | // PMR was used at some point (construction or insert that exceeds inline capacity) |
| 1601 | FL_CHECK(mr.allocate_count > 0); |
| 1602 | FL_CHECK(c.size() == static_cast<fl::size>(kPmrInsertCount)); |
| 1603 | } |
| 1604 | |
| 1605 | template <typename Factory> |
| 1606 | void test_pmr_clear_empties() { |