diff options
Diffstat (limited to 'libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value')
| -rw-r--r-- | libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/uninitialized_value_construct.pass.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/uninitialized_value_construct.pass.cpp b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/uninitialized_value_construct.pass.cpp index befe30a6c03..c2d860694a7 100644 --- a/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/uninitialized_value_construct.pass.cpp +++ b/libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.value/uninitialized_value_construct.pass.cpp @@ -27,7 +27,7 @@ struct Counted { static void reset() { count = constructed = 0; } explicit Counted() { ++count; ++constructed; } Counted(Counted const&) { assert(false); } - ~Counted() { --count; } + ~Counted() { assert(count > 0); --count; } friend void operator&(Counted) = delete; }; int Counted::count = 0; @@ -47,7 +47,7 @@ struct ThrowsCounted { ++count; } ThrowsCounted(ThrowsCounted const&) { assert(false); } - ~ThrowsCounted() { --count; } + ~ThrowsCounted() { assert(count > 0); --count; } friend void operator&(ThrowsCounted) = delete; }; int ThrowsCounted::count = 0; @@ -66,10 +66,8 @@ void test_ctor_throws() std::uninitialized_value_construct(It(p), It(p+N)); assert(false); } catch (...) {} - assert(ThrowsCounted::count == 3); - assert(ThrowsCounted::constructed == 4); // forth construction throws - std::destroy(p, p+3); assert(ThrowsCounted::count == 0); + assert(ThrowsCounted::constructed == 4); // forth construction throws #endif } |

