Skip to content

Commit 975da64

Browse files
committed
Add baseAllocLinearAllocMoreThanPoolSize test
Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 2766092 commit 975da64

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/test_base_alloc_linear.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@
1616

1717
using umf_test::test;
1818

19+
TEST_F(test, baseAllocLinearAllocMoreThanPoolSize) {
20+
auto pool = std::shared_ptr<umf_ba_linear_pool_t>(
21+
umf_ba_linear_create(0 /* minimal pool size (page size) */),
22+
umf_ba_linear_destroy);
23+
24+
size_t new_size = 20 * 1024 * 1024; // = 20 MB
25+
void *ptr = umf_ba_linear_alloc(pool.get(), new_size);
26+
UT_ASSERTne(ptr, NULL);
27+
memset(ptr, 0, new_size);
28+
}
29+
1930
TEST_F(test, baseAllocLinearMultiThreadedAllocMemset) {
2031
static constexpr int NTHREADS = 10;
2132
static constexpr int ITERATIONS = 1000;

0 commit comments

Comments
 (0)