File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ /* ******************************************************************\
2+
3+ Module: Unit test utilities
4+
5+ Author: Diffblue Limited.
6+
7+ \*******************************************************************/
8+
9+ #ifndef CPROVER_TESTING_UTILS_REQUIRE_VECTORS_EQUAL_UNORDERED_H
10+ #define CPROVER_TESTING_UTILS_REQUIRE_VECTORS_EQUAL_UNORDERED_H
11+
12+ #include < testing-utils/catch.hpp>
13+ #include < vector>
14+
15+ // / Checks whether two vectors are equal, ignoring ordering
16+ // / \tparam T: The type of the vector contents
17+ // / \param actual: The vector to check
18+ // / \param expected: The vector to check against
19+ template <class T >
20+ void require_vectors_equal_unordered (
21+ const std::vector<T> &actual,
22+ const std::vector<T> &expected)
23+ {
24+ REQUIRE (actual.size () == expected.size ());
25+ REQUIRE_THAT (actual, Catch::Matchers::Vector::ContainsMatcher<T>{expected});
26+ }
27+
28+ #endif // CPROVER_TESTING_UTILS_REQUIRE_VECTORS_EQUAL_UNORDERED_H
You can’t perform that action at this time.
0 commit comments