diff options
Diffstat (limited to 'test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp')
-rw-r--r-- | test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp index 29797c3ee..3727c143d 100644 --- a/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp +++ b/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp @@ -1,9 +1,8 @@ //===----------------------------------------------------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -18,12 +17,13 @@ #include <set> #include <cassert> +#include "test_macros.h" #include "MoveOnly.h" #include "../../../test_compare.h" #include "test_allocator.h" #include "Counter.h" -int main() +int main(int, char**) { { typedef MoveOnly V; @@ -61,7 +61,7 @@ int main() assert(m3 == m2); assert(m3.get_allocator() == A(7)); assert(m3.key_comp() == C(5)); - assert(m1.empty()); + LIBCPP_ASSERT(m1.empty()); } { typedef MoveOnly V; @@ -99,7 +99,7 @@ int main() assert(m3 == m2); assert(m3.get_allocator() == A(5)); assert(m3.key_comp() == C(5)); - assert(m1.empty()); + LIBCPP_ASSERT(m1.empty()); } { typedef MoveOnly V; @@ -137,7 +137,7 @@ int main() assert(m3 == m2); assert(m3.get_allocator() == A(5)); assert(m3.key_comp() == C(5)); - assert(m1.empty()); + LIBCPP_ASSERT(m1.empty()); } { typedef Counter<int> V; @@ -171,17 +171,22 @@ int main() M m3(std::move(m1), A()); assert(m3 == m2); - assert(m1.empty()); - assert(Counter_base::gConstructed == 3*num); + LIBCPP_ASSERT(m1.empty()); + assert(Counter_base::gConstructed >= (int)(3*num)); + assert(Counter_base::gConstructed <= (int)(4*num)); { M m4(std::move(m2), A(5)); - assert(Counter_base::gConstructed == 3*num); + assert(Counter_base::gConstructed >= (int)(3*num)); + assert(Counter_base::gConstructed <= (int)(5*num)); assert(m4 == m3); - assert(m2.empty()); + LIBCPP_ASSERT(m2.empty()); } - assert(Counter_base::gConstructed == 2*num); + assert(Counter_base::gConstructed >= (int)(2*num)); + assert(Counter_base::gConstructed <= (int)(4*num)); } assert(Counter_base::gConstructed == 0); } + + return 0; } |