Verify that the packed vector behaves as expected
| 20 | |
| 21 | // Verify that the packed vector behaves as expected |
| 22 | BOOST_AUTO_TEST_CASE(insert_and_retrieve_packed_test) |
| 23 | { |
| 24 | PackedVector<OSMNodeID, 33> packed_ids; |
| 25 | std::vector<OSMNodeID> original_ids; |
| 26 | |
| 27 | const constexpr std::size_t num_test_cases = 399; |
| 28 | const constexpr std::uint64_t max_id = (1ULL << 33) - 1; |
| 29 | |
| 30 | std::mt19937 rng(osrm::test::getTestRandomSeed()); |
| 31 | std::uniform_int_distribution<std::uint64_t> dist(0, max_id); |
| 32 | |
| 33 | for (std::size_t i = 0; i < num_test_cases; i++) |
| 34 | { |
| 35 | OSMNodeID r{dist(rng)}; // max 33-bit uint |
| 36 | |
| 37 | packed_ids.push_back(r); |
| 38 | original_ids.push_back(r); |
| 39 | } |
| 40 | |
| 41 | for (std::size_t i = 0; i < num_test_cases; i++) |
| 42 | { |
| 43 | BOOST_CHECK_EQUAL(original_ids.at(i), packed_ids.at(i)); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | BOOST_AUTO_TEST_CASE(packed_vector_capacity_test) |
| 48 | { |
nothing calls this directly
no test coverage detected