| 45 | bool operator!=(const instruction &lhs, const instruction &rhs) noexcept { return !(lhs == rhs); } |
| 46 | |
| 47 | void checkInstructions(RestrictionGraph::RestrictionRange restrictions, |
| 48 | std::vector<instruction> expected_instructions) |
| 49 | { |
| 50 | std::vector<instruction> actual_instructions; |
| 51 | std::transform(restrictions.begin(), |
| 52 | restrictions.end(), |
| 53 | std::back_inserter(actual_instructions), |
| 54 | [](const auto &restriction) { |
| 55 | return instruction{restriction->turn_path.To(), bool(restriction->is_only)}; |
| 56 | }); |
| 57 | std::sort(actual_instructions.begin(), |
| 58 | actual_instructions.end(), |
| 59 | [](const auto &lhs, const auto &rhs) |
| 60 | { return (lhs.to < rhs.to) || (lhs.to == rhs.to && lhs.is_only); }); |
| 61 | std::sort(expected_instructions.begin(), |
| 62 | expected_instructions.end(), |
| 63 | [](const auto &lhs, const auto &rhs) |
| 64 | { return (lhs.to < rhs.to) || (lhs.to == rhs.to && lhs.is_only); }); |
| 65 | |
| 66 | BOOST_REQUIRE_EQUAL_COLLECTIONS(actual_instructions.begin(), |
| 67 | actual_instructions.end(), |
| 68 | expected_instructions.begin(), |
| 69 | expected_instructions.end()); |
| 70 | } |
| 71 | |
| 72 | void checkEdges(RestrictionGraph::EdgeRange edges, std::vector<NodeID> expected_edges) |
| 73 | { |