diff --git a/test/sources/LibcxxTester.h b/test/sources/LibcxxTester.h index a1dad65c..aa05884c 100644 --- a/test/sources/LibcxxTester.h +++ b/test/sources/LibcxxTester.h @@ -14,6 +14,7 @@ #include "libcxx/Support.h" +#include "../../include/momo/Version.h" #include "../../include/momo/ObjectManager.h" #include diff --git a/test/sources/libcxx/Support.h b/test/sources/libcxx/Support.h index 1f3d94e5..2ed1dd42 100644 --- a/test/sources/libcxx/Support.h +++ b/test/sources/libcxx/Support.h @@ -15,11 +15,14 @@ #include #include #include +#include //#define LIBCPP_HAS_BAD_NEWS_FOR_MOMO #define TEST_STD_VER 20 +#undef _LIBCPP_VERSION //? + #include "support/test_macros.h" #include "support/MoveOnly.h" diff --git a/test/sources/libcxx/map/map.cons/deduct.pass.cpp b/test/sources/libcxx/map/map.cons/deduct.pass.cpp index 45bc2d9b..5fea49f2 100644 --- a/test/sources/libcxx/map/map.cons/deduct.pass.cpp +++ b/test/sources/libcxx/map/map.cons/deduct.pass.cpp @@ -150,13 +150,17 @@ int main(int, char**) ASSERT_SAME_TYPE(decltype(m1), momo::stdish::map); #if !defined(TEST_GCC) && !defined(TEST_CLANG) +#if MOMO_VERSION_MAJOR > 3 using value_type = std::pair; momo::stdish::map m2{{value_type{1, 2}, {3, 4}}, std::less()}; ASSERT_SAME_TYPE(decltype(m2), momo::stdish::map); +#endif #endif } +#if MOMO_VERSION_MAJOR > 3 AssociativeContainerDeductionGuidesSfinaeAway>(); +#endif return 0; } diff --git a/test/sources/libcxx/map/map.cons/deduct_const.pass.cpp b/test/sources/libcxx/map/map.cons/deduct_const.pass.cpp index c2cd2723..1defd0a3 100644 --- a/test/sources/libcxx/map/map.cons/deduct_const.pass.cpp +++ b/test/sources/libcxx/map/map.cons/deduct_const.pass.cpp @@ -74,6 +74,7 @@ int main(int, char**) assert(std::equal(m.begin(), m.end(), std::begin(expected_m), std::end(expected_m))); } +#if MOMO_VERSION_MAJOR > 3 { momo::stdish::map m({ PC{1,1L}, PC{2,2L}, PC{1,1L}, PC{INT_MAX,1L}, PC{3,1L} }, std::greater()); @@ -81,6 +82,7 @@ int main(int, char**) const PC expected_m[] = { {INT_MAX,1L}, {3,1L}, {2,2L}, {1, 1L} }; assert(std::equal(m.begin(), m.end(), std::begin(expected_m), std::end(expected_m))); } +#endif { momo::stdish::map m({ PC{1,1L}, PC{2,2L}, PC{1,1L}, PC{INT_MAX,1L}, PC{3,1L} }, std::greater(), test_allocator(0, 43)); @@ -91,6 +93,7 @@ int main(int, char**) assert(m.get_allocator().get_id() == 43); } +#if MOMO_VERSION_MAJOR > 3 { momo::stdish::map m({ PC{1,1L}, PC{2,2L}, PC{1,1L}, PC{INT_MAX,1L}, PC{3,1L} }, test_allocator(0, 45)); @@ -99,6 +102,7 @@ int main(int, char**) assert(std::equal(m.begin(), m.end(), std::begin(expected_m), std::end(expected_m))); assert(m.get_allocator().get_id() == 45); } +#endif #endif return 0; diff --git a/test/sources/libcxx/multimap/multimap.cons/deduct.pass.cpp b/test/sources/libcxx/multimap/multimap.cons/deduct.pass.cpp index 223ecadd..1b5f3c1e 100644 --- a/test/sources/libcxx/multimap/multimap.cons/deduct.pass.cpp +++ b/test/sources/libcxx/multimap/multimap.cons/deduct.pass.cpp @@ -150,13 +150,17 @@ int main(int, char**) ASSERT_SAME_TYPE(decltype(m1), momo::stdish::multimap); #if !defined(TEST_GCC) && !defined(TEST_CLANG) +#if MOMO_VERSION_MAJOR > 3 using value_type = std::pair; momo::stdish::multimap m2{{value_type{1, 2}, {3, 4}}, std::less()}; ASSERT_SAME_TYPE(decltype(m2), momo::stdish::multimap); +#endif #endif } +#if MOMO_VERSION_MAJOR > 3 AssociativeContainerDeductionGuidesSfinaeAway>(); +#endif return 0; } diff --git a/test/sources/libcxx/multimap/multimap.cons/deduct_const.pass.cpp b/test/sources/libcxx/multimap/multimap.cons/deduct_const.pass.cpp index 06df26e0..f66ae08d 100644 --- a/test/sources/libcxx/multimap/multimap.cons/deduct_const.pass.cpp +++ b/test/sources/libcxx/multimap/multimap.cons/deduct_const.pass.cpp @@ -74,6 +74,7 @@ int main(int, char**) assert(std::equal(m.begin(), m.end(), std::begin(expected_m), std::end(expected_m))); } +#if MOMO_VERSION_MAJOR > 3 { momo::stdish::multimap m({ PC{1,1L}, PC{2,2L}, PC{1,1L}, PC{INT_MAX,1L}, PC{3,1L} }, std::greater()); @@ -81,6 +82,7 @@ int main(int, char**) const PC expected_m[] = { {INT_MAX,1L}, {3,1L}, {2,2L}, {1,1L}, {1,1L} }; assert(std::equal(m.begin(), m.end(), std::begin(expected_m), std::end(expected_m))); } +#endif { momo::stdish::multimap m({ PC{1,1L}, PC{2,2L}, PC{1,1L}, PC{INT_MAX,1L}, PC{3,1L} }, std::greater(), test_allocator(0, 43)); @@ -91,6 +93,7 @@ int main(int, char**) assert(m.get_allocator().get_id() == 43); } +#if MOMO_VERSION_MAJOR > 3 { momo::stdish::multimap m({ PC{1,1L}, PC{2,2L}, PC{1,1L}, PC{INT_MAX,1L}, PC{3,1L} }, test_allocator(0, 45)); @@ -99,6 +102,7 @@ int main(int, char**) assert(std::equal(m.begin(), m.end(), std::begin(expected_m), std::end(expected_m))); assert(m.get_allocator().get_id() == 45); } +#endif #endif return 0; diff --git a/test/sources/libcxx/set/set.cons/deduct.pass.cpp b/test/sources/libcxx/set/set.cons/deduct.pass.cpp index 4857f171..9fceffe5 100644 --- a/test/sources/libcxx/set/set.cons/deduct.pass.cpp +++ b/test/sources/libcxx/set/set.cons/deduct.pass.cpp @@ -179,7 +179,9 @@ int main(int, char **) { assert(s.size() == 2); } +#if MOMO_VERSION_MAJOR > 3 AssociativeContainerDeductionGuidesSfinaeAway>(); +#endif return 0; } diff --git a/test/sources/libcxx/unord.map/unord.map.cnstr/deduct.pass.cpp b/test/sources/libcxx/unord.map/unord.map.cnstr/deduct.pass.cpp index 778a1d7c..4eaa1bd5 100644 --- a/test/sources/libcxx/unord.map/unord.map.cnstr/deduct.pass.cpp +++ b/test/sources/libcxx/unord.map/unord.map.cnstr/deduct.pass.cpp @@ -218,7 +218,9 @@ int main(int, char**) ASSERT_SAME_TYPE(decltype(m2), momo::stdish::unordered_map); } +#if MOMO_VERSION_MAJOR > 3 UnorderedContainerDeductionGuidesSfinaeAway>(); +#endif return 0; } diff --git a/test/sources/libcxx/unord.map/unord.map.cnstr/deduct_const.pass.cpp b/test/sources/libcxx/unord.map/unord.map.cnstr/deduct_const.pass.cpp index d85d2baa..5a0fc670 100644 --- a/test/sources/libcxx/unord.map/unord.map.cnstr/deduct_const.pass.cpp +++ b/test/sources/libcxx/unord.map/unord.map.cnstr/deduct_const.pass.cpp @@ -114,6 +114,7 @@ int main(int, char**) assert(std::is_permutation(m.begin(), m.end(), std::begin(expected_m), std::end(expected_m))); } +#if MOMO_VERSION_MAJOR > 3 { momo::stdish::unordered_map m({ PC{1,1L}, PC{2,2L}, PC{1,1L}, PC{INT_MAX,1L}, PC{3,1L} }, 42, std::hash()); ASSERT_SAME_TYPE(decltype(m), momo::stdish::unordered_map>); @@ -125,6 +126,7 @@ int main(int, char**) ASSERT_SAME_TYPE(decltype(m), momo::stdish::unordered_map, std::equal_to<>>); assert(std::is_permutation(m.begin(), m.end(), std::begin(expected_m), std::end(expected_m))); } +#endif { momo::stdish::unordered_map m({ PC{1,1L}, PC{2,2L}, PC{1,1L}, PC{INT_MAX,1L}, PC{3,1L} }, 42, std::hash(), std::equal_to<>(), test_allocator(0, 44)); @@ -149,6 +151,7 @@ int main(int, char**) assert(m.get_allocator().get_id() == 46); } +#if MOMO_VERSION_MAJOR > 3 { momo::stdish::unordered_map m({ PC{1,1L}, PC{2,2L}, PC{1,1L}, PC{INT_MAX,1L}, PC{3,1L} }, 42, test_allocator(0, 47)); ASSERT_SAME_TYPE(decltype(m), momo::stdish::unordered_map, std::equal_to, test_allocator>); @@ -162,6 +165,7 @@ int main(int, char**) assert(std::is_permutation(m.begin(), m.end(), std::begin(expected_m), std::end(expected_m))); assert(m.get_allocator().get_id() == 48); } +#endif return 0; } diff --git a/test/sources/libcxx/unord.multimap/unord.multimap.cnstr/deduct.pass.cpp b/test/sources/libcxx/unord.multimap/unord.multimap.cnstr/deduct.pass.cpp index 87b28147..be7bc0ae 100644 --- a/test/sources/libcxx/unord.multimap/unord.multimap.cnstr/deduct.pass.cpp +++ b/test/sources/libcxx/unord.multimap/unord.multimap.cnstr/deduct.pass.cpp @@ -218,7 +218,9 @@ int main(int, char**) ASSERT_SAME_TYPE(decltype(m2), momo::stdish::unordered_multimap); } +#if MOMO_VERSION_MAJOR > 3 UnorderedContainerDeductionGuidesSfinaeAway>(); +#endif return 0; } diff --git a/test/sources/libcxx/unord.multimap/unord.multimap.cnstr/deduct_const.pass.cpp b/test/sources/libcxx/unord.multimap/unord.multimap.cnstr/deduct_const.pass.cpp index 471aaddc..894d4b54 100644 --- a/test/sources/libcxx/unord.multimap/unord.multimap.cnstr/deduct_const.pass.cpp +++ b/test/sources/libcxx/unord.multimap/unord.multimap.cnstr/deduct_const.pass.cpp @@ -114,6 +114,7 @@ int main(int, char**) assert(std::is_permutation(m.begin(), m.end(), std::begin(expected_m), std::end(expected_m))); } +#if MOMO_VERSION_MAJOR > 3 { momo::stdish::unordered_multimap m({ PC{1,1L}, PC{2,2L}, PC{1,1L}, PC{INT_MAX,1L}, PC{3,1L} }, 42, std::hash()); ASSERT_SAME_TYPE(decltype(m), momo::stdish::unordered_multimap>); @@ -125,6 +126,7 @@ int main(int, char**) ASSERT_SAME_TYPE(decltype(m), momo::stdish::unordered_multimap, std::equal_to<>>); assert(std::is_permutation(m.begin(), m.end(), std::begin(expected_m), std::end(expected_m))); } +#endif { momo::stdish::unordered_multimap m({ PC{1,1L}, PC{2,2L}, PC{1,1L}, PC{INT_MAX,1L}, PC{3,1L} }, 42, std::hash(), std::equal_to<>(), test_allocator(0, 44)); @@ -149,6 +151,7 @@ int main(int, char**) assert(m.get_allocator().get_id() == 46); } +#if MOMO_VERSION_MAJOR > 3 { momo::stdish::unordered_multimap m({ PC{1,1L}, PC{2,2L}, PC{1,1L}, PC{INT_MAX,1L}, PC{3,1L} }, 42, test_allocator(0, 47)); ASSERT_SAME_TYPE(decltype(m), momo::stdish::unordered_multimap, std::equal_to, test_allocator>); @@ -162,6 +165,7 @@ int main(int, char**) assert(std::is_permutation(m.begin(), m.end(), std::begin(expected_m), std::end(expected_m))); assert(m.get_allocator().get_id() == 48); } +#endif return 0; } diff --git a/test/sources/libcxx/unord.set/unord.set.cnstr/deduct.pass.cpp b/test/sources/libcxx/unord.set/unord.set.cnstr/deduct.pass.cpp index 2516da74..536968d4 100644 --- a/test/sources/libcxx/unord.set/unord.set.cnstr/deduct.pass.cpp +++ b/test/sources/libcxx/unord.set/unord.set.cnstr/deduct.pass.cpp @@ -189,7 +189,9 @@ int main(int, char**) } #if !(defined(TEST_MSVC) && _MSC_VER < 1930) && !(defined(TEST_GCC) && __GNUC__ < 11) +#if MOMO_VERSION_MAJOR > 3 UnorderedContainerDeductionGuidesSfinaeAway>(); +#endif #endif return 0; diff --git a/test/sources/libcxx/vector/vector.cons/deduct.pass.cpp b/test/sources/libcxx/vector/vector.cons/deduct.pass.cpp index 6367a816..01e068a9 100644 --- a/test/sources/libcxx/vector/vector.cons/deduct.pass.cpp +++ b/test/sources/libcxx/vector/vector.cons/deduct.pass.cpp @@ -149,7 +149,9 @@ TEST_CONSTEXPR_CXX20 bool tests() { } } +#if MOMO_VERSION_MAJOR > 3 SequenceContainerDeductionGuidesSfinaeAway>(); +#endif return true; } diff --git a/test/sources/libcxx/vector/vector.cons/move_assign_noexcept.pass.cpp b/test/sources/libcxx/vector/vector.cons/move_assign_noexcept.pass.cpp index 6c5b5dba..e0e29f10 100644 --- a/test/sources/libcxx/vector/vector.cons/move_assign_noexcept.pass.cpp +++ b/test/sources/libcxx/vector/vector.cons/move_assign_noexcept.pass.cpp @@ -88,10 +88,12 @@ int main(int, char**) typedef std::vector> C; static_assert( std::is_nothrow_move_assignable::value, ""); } +#if MOMO_VERSION_MAJOR > 3 { // POCMA false, is_always_equal false typedef std::vector> C; static_assert(!std::is_nothrow_move_assignable::value, ""); } +#endif #endif return 0;