Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
achabense committed Sep 8, 2023
1 parent 779b76a commit 7d274cd
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/std/tests/GH_003570_allocate_at_least/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct signalling_allocator {

allocation_result<T*> allocate_at_least(size_t count) {
allocate_at_least_signal.set();
return {allocate(count * 2), count * 2};
return {allocate(count * 3), count * 3};
}

void deallocate(T* ptr, size_t) noexcept {
Expand All @@ -67,15 +67,19 @@ void test_container() {
const size_t reserve_count = container.capacity() + 100;
container.reserve(reserve_count);
assert(allocate_at_least_signal.consume());
assert(container.capacity() >= reserve_count * 2);
assert(container.capacity() >= reserve_count * 3);
assert(container.size() == 0);
}

void test_deque() {
deque<int, signalling_allocator<int>> d;
d.resize(100);
assert(allocate_at_least_signal.consume());
deque<size_t, signalling_allocator<size_t>> d;
for (size_t i = 0; i < 100; i++) {
d.push_back(i);
}
assert(d.size() == 100);
for (size_t i = 0; i < 100; i++) {
assert(d[i] == i);
}
}

void test_stream_overflow(auto& stream) {
Expand Down

0 comments on commit 7d274cd

Please sign in to comment.