Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Wiseguy committed Oct 18, 2024
1 parent 17ce2f5 commit c678711
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_general.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ TEST_CASE("General: allocate: OOM")
REQUIRE(nullptr == heap->allocate(ArenaSize - static_cast<uint32_t>(O1HEAP_ALIGNMENT))); // Too large
REQUIRE(heap->getDiagnostics().oom_count == 2);

REQUIRE(nullptr == heap->allocate(heap->diagnostics.capacity - static_cast<uint32_t>(O1HEAP_ALIGNMENT) + 1U)); // Too large
REQUIRE(nullptr ==
heap->allocate(heap->diagnostics.capacity - static_cast<uint32_t>(O1HEAP_ALIGNMENT) + 1U)); // Too large
REQUIRE(heap->getDiagnostics().oom_count == 3);

REQUIRE(nullptr == heap->allocate(ArenaSize * 10U)); // Too large
Expand All @@ -176,8 +177,9 @@ TEST_CASE("General: allocate: OOM")
REQUIRE(heap->getDiagnostics().allocated == 0);
REQUIRE(heap->getDiagnostics().peak_request_size == ArenaSize * 10U);

REQUIRE(nullptr != heap->allocate(MiB256 - static_cast<uint32_t>(O1HEAP_ALIGNMENT))); // Maximum possible allocation.
REQUIRE(heap->getDiagnostics().oom_count == 4); // OOM counter not incremented.
REQUIRE(nullptr !=
heap->allocate(MiB256 - static_cast<uint32_t>(O1HEAP_ALIGNMENT))); // Maximum possible allocation.
REQUIRE(heap->getDiagnostics().oom_count == 4); // OOM counter not incremented.
REQUIRE(heap->getDiagnostics().peak_allocated == MiB256);
REQUIRE(heap->getDiagnostics().allocated == MiB256);
REQUIRE(heap->getDiagnostics().peak_request_size == ArenaSize * 10U); // Same size -- that one was unsuccessful.
Expand Down

0 comments on commit c678711

Please sign in to comment.