MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

unit_tests/util/permutation.cpp:15–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13using namespace osrm::util;
14
15BOOST_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
28BOOST_AUTO_TEST_SUITE_END()

Callers

nothing calls this directly

Calls 3

inplacePermutationFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected