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

Function test_pmr_destructor_deallocates

tests/misc/containers.cpp:1631–1642  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1629
1630template <typename Factory>
1631void test_pmr_destructor_deallocates() {
1632 tracking_memory_resource mr;
1633 {
1634 typename Factory::container_type c = Factory::create(mr);
1635 for (int i = 0; i < kPmrInsertCount; ++i) {
1636 Factory::insert(c, i);
1637 }
1638 FL_CHECK(mr.allocate_count > 0);
1639 }
1640 // After destruction, deallocate should have been called
1641 FL_CHECK(mr.deallocate_count > 0);
1642}
1643
1644FL_TEST_CASE("PMR allocation - insert causes allocations through memory_resource") {
1645 FL_SUBCASE("fl::vector") { test_pmr_insert_allocates<PmrVectorFactory>(); }

Callers

nothing calls this directly

Calls 2

createFunction · 0.85
insertFunction · 0.50

Tested by

no test coverage detected