Skip to content

Commit

Permalink
Add test case for freeing with invalid arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
mempler committed Dec 16, 2023
1 parent 12a0a4a commit bb9a39f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/runtime/tests/Allocators/SlabAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,16 @@ TEST_CASE("RtlSlabAllocate", "[SlabAllocator]") {
REQUIRE(Cache->Partial == NULL);
}

SECTION("Free with invalid arguments") {
UINTN* Object = NULL;

Status = RtlSlabFree(NULL, SLAB_CACHE_FLAGS_NONE, (VOID**)&Object);
REQUIRE(Status == STATUS_INVALID_PARAMETER);

Status = RtlSlabFree(Cache, SLAB_CACHE_FLAGS_NONE, NULL);
REQUIRE(Status == STATUS_INVALID_PARAMETER);
}

//
// Teardown
//
Expand Down

0 comments on commit bb9a39f

Please sign in to comment.