| 15 | using namespace osrm::util; |
| 16 | |
| 17 | BOOST_AUTO_TEST_CASE(rw_short) |
| 18 | { |
| 19 | std::size_t num_elements = 1000; |
| 20 | std::unique_ptr<char[]> data = std::make_unique<char[]>(sizeof(std::uint16_t) * num_elements); |
| 21 | util::vector_view<std::uint16_t> view(reinterpret_cast<std::uint16_t *>(data.get()), |
| 22 | num_elements); |
| 23 | std::vector<std::uint16_t> reference; |
| 24 | |
| 25 | std::mt19937 rng(osrm::test::getTestRandomSeed()); |
| 26 | std::uniform_int_distribution<std::mt19937::result_type> dist(0, (1UL << 16)); |
| 27 | |
| 28 | for (std::size_t i = 0; i < num_elements; i++) |
| 29 | { |
| 30 | auto r = dist(rng); |
| 31 | view[i] = r; |
| 32 | reference.push_back(r); |
| 33 | } |
| 34 | |
| 35 | for (std::size_t i = 0; i < num_elements; i++) |
| 36 | { |
| 37 | BOOST_CHECK_EQUAL(view[i], reference[i]); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | BOOST_AUTO_TEST_CASE(rw_bool) |
| 42 | { |
nothing calls this directly
no test coverage detected