MCPcopy Create free account
hub / github.com/boostorg/json / testHashPolicy

Method testHashPolicy

test/object.cpp:1485–1508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1483 }
1484
1485 void
1486 testHashPolicy()
1487 {
1488 // reserve(size_type)
1489 {
1490 {
1491 object o;
1492 for(std::size_t i = 0; i < 10; ++i)
1493 o.emplace(std::to_string(i), i);
1494 o.reserve(15);
1495 BOOST_TEST(o.capacity() >= 15);
1496 o.reserve(20);
1497 BOOST_TEST(o.capacity() >= 20);
1498 }
1499
1500 {
1501 object o;
1502 o.reserve(3);
1503 BOOST_TEST(o.capacity() == 3);
1504 o.reserve(7);
1505 BOOST_TEST(o.capacity() == 7);
1506 }
1507 }
1508 }
1509
1510 //------------------------------------------------------
1511

Callers

nothing calls this directly

Calls 3

emplaceMethod · 0.80
reserveMethod · 0.45
capacityMethod · 0.45

Tested by

no test coverage detected