1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
14 // Test unique_ptr move assignment
19 #include "unique_ptr_test_helper.h"
21 // test assignment from null
23 template <bool IsArray>
25 typedef typename std::conditional<IsArray, A[], A>::type VT;
26 const int expect_alive = IsArray ? 5 : 1;
28 std::unique_ptr<VT> s2(newValue<VT>(expect_alive));
29 assert(A::count == expect_alive);
31 assert(A::count == 0);
32 assert(s2.get() == 0);
34 assert(A::count == 0);
38 test_basic</*IsArray*/ false>();