| 13 | using namespace osrm::util; |
| 14 | |
| 15 | BOOST_AUTO_TEST_CASE(basic_permuation) |
| 16 | { |
| 17 | // cycles (0 3 2 1 4 8) (5) (6 9 7) |
| 18 | // 0 1 2 3 4 5 6 7 8 9 |
| 19 | std::vector<std::uint32_t> values{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; |
| 20 | const std::vector<std::uint32_t> permutation{3, 4, 1, 2, 8, 5, 9, 6, 0, 7}; |
| 21 | std::vector<std::uint32_t> reference{9, 3, 4, 1, 2, 6, 8, 10, 5, 7}; |
| 22 | |
| 23 | inplacePermutation(values.begin(), values.end(), permutation); |
| 24 | |
| 25 | CHECK_EQUAL_COLLECTIONS(values, reference); |
| 26 | } |
| 27 | |
| 28 | BOOST_AUTO_TEST_SUITE_END() |
nothing calls this directly
no test coverage detected