| 1 | |
| 2 | // Copyright 2023 Christian Mazakas |
| 3 | // Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 4 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 5 | |
| 6 | #include "./containers.hpp" |
| 7 | |
| 8 | #include "../helpers/helpers.hpp" |
| 9 | #include "../helpers/invariants.hpp" |
| 10 | #include "../helpers/random_values.hpp" |
| 11 | #include "../helpers/strong.hpp" |
| 12 | #include "../helpers/tracker.hpp" |
| 13 | |
| 14 | #include <vector> |
| 15 | |
| 16 | UNORDERED_AUTO_TEST (less_osx_regression) { |
| 17 | DISABLE_EXCEPTIONS; |
| 18 | typedef test_pair_set::value_type value_type; |
| 19 | typedef test::exception::object object; |
| 20 | |
| 21 | std::vector<value_type> v; |
| 22 | v.push_back(x: value_type(object(12, 98), object(88, 13))); |
| 23 | v.push_back(x: value_type(object(24, 71), object(62, 84))); |
| 24 | v.push_back(x: value_type(object(30, 0), object(5, 73))); |
| 25 | v.push_back(x: value_type(object(34, 64), object(79, 58))); |
| 26 | v.push_back(x: value_type(object(36, 95), object(64, 23))); |
| 27 | v.push_back(x: value_type(object(42, 89), object(68, 44))); |
| 28 | v.push_back(x: value_type(object(42, 26), object(93, 64))); |
| 29 | v.push_back(x: value_type(object(86, 86), object(16, 62))); |
| 30 | v.push_back(x: value_type(object(86, 86), object(75, 23))); |
| 31 | v.push_back(x: value_type(object(92, 37), object(41, 90))); |
| 32 | |
| 33 | BOOST_TEST_EQ(v.size(), 10u); |
| 34 | |
| 35 | std::set<value_type, test::exception::less> s; |
| 36 | s.insert(first: v.begin(), last: v.end()); |
| 37 | BOOST_TEST_EQ(s.size(), v.size()); |
| 38 | |
| 39 | test::ordered<test_pair_set> tracker; |
| 40 | test_pair_set x; |
| 41 | for (std::vector<value_type>::iterator it = v.begin(); it != v.end(); |
| 42 | ++it) { |
| 43 | x.insert(x: *it); |
| 44 | } |
| 45 | |
| 46 | tracker.insert(first: v.begin(), last: v.end()); |
| 47 | tracker.compare(x); |
| 48 | } |
| 49 | |
| 50 | RUN_TESTS() |
| 51 | |