Skip to content

Commit 3bddbee

Browse files
committed
Simplify a test
1 parent 71e224f commit 3bddbee

File tree

1 file changed

+2
-11
lines changed
  • libcxx/test/std/utilities/memory/indirect/indirect.assign

1 file changed

+2
-11
lines changed

libcxx/test/std/utilities/memory/indirect/indirect.assign/move.pass.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,12 @@ constexpr void test_assignment() {
4141
assert(i2.valueless_after_move());
4242
}
4343
{ // Move assigning to an indirect simply transfers ownership of the held object.
44-
test_allocator_statistics stats;
45-
std::indirect<int, test_allocator<int>> i1(std::allocator_arg, test_allocator<int>(&stats), 1);
46-
std::indirect<int, test_allocator<int>> i2(std::allocator_arg, test_allocator<int>(&stats), 2);
47-
assert(stats.construct_count == 2);
44+
std::indirect<int, test_allocator<int>> i1(1);
45+
std::indirect<int, test_allocator<int>> i2(2);
4846
auto* addr2 = &*i2;
4947
i1 = std::move(i2);
5048
assert(i2.valueless_after_move());
5149
assert(&*i1 == addr2);
52-
assert(stats.construct_count == 2);
5350
assert(*i1 == 2);
5451
}
5552
{ // Assigning to an indirect with a different, non-POCMA allocator allocates a new owned object.
@@ -101,12 +98,6 @@ void test_assignment_throws() {
10198
#endif
10299
}
103100

104-
template <class T>
105-
struct pocma_test_allocator : test_allocator<T> {
106-
using test_allocator<T>::test_allocator;
107-
using propagate_on_container_move_assignment = std::true_type;
108-
};
109-
110101
struct Immovable {
111102
Immovable() = default;
112103
Immovable(const Immovable&) = delete;

0 commit comments

Comments
 (0)