Test: include deallocated size in allocator's log

This commit is contained in:
Benoit Blanchon committed 2023-04-02 16:47:59 +02:00
1 parent 2eb726b744
commit 57810af2ac
2 files changed
+50 -26

No files matched your search

+14 -14
View File
@@ -44,7 +44,7 @@ TEST_CASE("JsonDocument's allocator") {
{ JsonDocument doc(4096, &spyingAllocator); }
REQUIRE(spyingAllocator.log() == AllocatorLog()
<< AllocatorLog::Allocate(4096)
<< AllocatorLog::Deallocate());
<< AllocatorLog::Deallocate(4096));
}
SECTION("Copy construct") {
@@ -61,8 +61,8 @@ TEST_CASE("JsonDocument's allocator") {
REQUIRE(spyingAllocator.log() == AllocatorLog()
<< AllocatorLog::Allocate(4096)
<< AllocatorLog::Allocate(4096)
<< AllocatorLog::Deallocate()
<< AllocatorLog::Deallocate());
<< AllocatorLog::Deallocate(4096)
<< AllocatorLog::Deallocate(4096));
}
SECTION("Move construct") {
@@ -79,7 +79,7 @@ TEST_CASE("JsonDocument's allocator") {
}
REQUIRE(spyingAllocator.log() == AllocatorLog()
<< AllocatorLog::Allocate(4096)
<< AllocatorLog::Deallocate());
<< AllocatorLog::Deallocate(4096));
}
SECTION("Copy assign larger") {
@@ -97,10 +97,10 @@ TEST_CASE("JsonDocument's allocator") {
REQUIRE(spyingAllocator.log() == AllocatorLog()
<< AllocatorLog::Allocate(4096)
<< AllocatorLog::Allocate(8)
<< AllocatorLog::Deallocate()
<< AllocatorLog::Deallocate(8)
<< AllocatorLog::Allocate(4096)
<< AllocatorLog::Deallocate()
<< AllocatorLog::Deallocate());
<< AllocatorLog::Deallocate(4096)
<< AllocatorLog::Deallocate(4096));
}
SECTION("Copy assign smaller") {
@@ -118,10 +118,10 @@ TEST_CASE("JsonDocument's allocator") {
REQUIRE(spyingAllocator.log() == AllocatorLog()
<< AllocatorLog::Allocate(1024)
<< AllocatorLog::Allocate(4096)
<< AllocatorLog::Deallocate()
<< AllocatorLog::Deallocate(4096)
<< AllocatorLog::Allocate(1024)
<< AllocatorLog::Deallocate()
<< AllocatorLog::Deallocate());
<< AllocatorLog::Deallocate(1024)
<< AllocatorLog::Deallocate(1024));
}
SECTION("Copy assign same size") {
@@ -139,8 +139,8 @@ TEST_CASE("JsonDocument's allocator") {
REQUIRE(spyingAllocator.log() == AllocatorLog()
<< AllocatorLog::Allocate(1024)
<< AllocatorLog::Allocate(1024)
<< AllocatorLog::Deallocate()
<< AllocatorLog::Deallocate());
<< AllocatorLog::Deallocate(1024)
<< AllocatorLog::Deallocate(1024));
}
SECTION("Move assign") {
@@ -159,8 +159,8 @@ TEST_CASE("JsonDocument's allocator") {
REQUIRE(spyingAllocator.log() == AllocatorLog()
<< AllocatorLog::Allocate(4096)
<< AllocatorLog::Allocate(8)
<< AllocatorLog::Deallocate()
<< AllocatorLog::Deallocate());
<< AllocatorLog::Deallocate(8)
<< AllocatorLog::Deallocate(4096));
}
SECTION("garbageCollect()") {