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

Function test_capacity_management

tests/misc/containers.cpp:846–862  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

844
845template<typename Container>
846void test_capacity_management() {
847 Container c;
848
849 // Test capacity contract
850 FL_CHECK(c.capacity() >= c.size());
851
852 // Test reserve
853 c.reserve(100);
854 FL_CHECK(c.capacity() >= 100);
855
856 // Add elements and test shrink_to_fit
857 c.push_back(10);
858 c.push_back(20);
859 FL_CHECK(c.size() == 2);
860 c.shrink_to_fit();
861 FL_CHECK(c.capacity() >= 2);
862}
863
864// ============================================================================
865// Iterator Arithmetic Contract Test Functions

Callers

nothing calls this directly

Calls 5

capacityMethod · 0.45
sizeMethod · 0.45
reserveMethod · 0.45
push_backMethod · 0.45
shrink_to_fitMethod · 0.45

Tested by

no test coverage detected