Commit 416ae9bb authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

partalloc: de-indent split tests

Now that the PurgeDiscardable test cases are split into tests, remove
their indentation layers and wrapping braces. This change is purely
syntactical.

Bug: 1128436
Change-Id: Ib3d6805187c68ad9912a3f98d52187e26ece9b04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2481075Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818113}
parent e63cc201
......@@ -1962,7 +1962,6 @@ TEST_F(PartitionAllocTest, PreferActiveOverEmpty) {
// Tests the API to purge discardable memory.
TEST_F(PartitionAllocTest, PurgeDiscardableSecondPage) {
// Free the second of two 4096 byte allocations and then purge.
{
void* ptr1 =
allocator.root()->Alloc(SystemPageSize() - kExtraAllocSize, type_name);
char* ptr2 = reinterpret_cast<char*>(
......@@ -1993,12 +1992,10 @@ TEST_F(PartitionAllocTest, PurgeDiscardableSecondPage) {
EXPECT_EQ(3u, slot_span->num_unprovisioned_slots);
allocator.root()->Free(ptr1);
}
}
TEST_F(PartitionAllocTest, PurgeDiscardableFirstPage) {
// Free the first of two 4096 byte allocations and then purge.
{
char* ptr1 = reinterpret_cast<char*>(
allocator.root()->Alloc(SystemPageSize() - kExtraAllocSize, type_name));
void* ptr2 =
......@@ -2028,11 +2025,9 @@ TEST_F(PartitionAllocTest, PurgeDiscardableFirstPage) {
CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset, false);
allocator.root()->Free(ptr2);
}
}
TEST_F(PartitionAllocTest, PurgeDiscardableNonPageSizedAlloc) {
{
const size_t requested_size = 2.25 * SystemPageSize();
char* ptr1 = reinterpret_cast<char*>(
allocator.root()->Alloc(requested_size - kExtraAllocSize, type_name));
......@@ -2075,7 +2070,6 @@ TEST_F(PartitionAllocTest, PurgeDiscardableNonPageSizedAlloc) {
allocator.root()->Free(ptr3);
allocator.root()->Free(ptr4);
}
}
TEST_F(PartitionAllocTest, PurgeDiscardableManyPages) {
......@@ -2086,7 +2080,6 @@ TEST_F(PartitionAllocTest, PurgeDiscardableManyPages) {
// TODO(palmer): Refactor this to branch on page size instead of architecture,
// for clarity of purpose and for applicability to more architectures.
#if defined(_MIPS_ARCH_LOONGSON)
{
char* ptr1 = reinterpret_cast<char*>(allocator.root()->Alloc(
(32 * SystemPageSize()) - kExtraAllocSize, type_name));
memset(ptr1, 'A', (32 * SystemPageSize()) - kExtraAllocSize);
......@@ -2115,9 +2108,7 @@ TEST_F(PartitionAllocTest, PurgeDiscardableManyPages) {
CheckPageInCore(ptr1 - kPointerOffset + (SystemPageSize() * 31), false);
allocator.root()->Free(ptr1);
}
#else
{
char* ptr1 = reinterpret_cast<char*>(allocator.root()->Alloc(
(64 * SystemPageSize()) - kExtraAllocSize, type_name));
memset(ptr1, 'A', (64 * SystemPageSize()) - kExtraAllocSize);
......@@ -2150,7 +2141,6 @@ TEST_F(PartitionAllocTest, PurgeDiscardableManyPages) {
CHECK_PAGE_IN_CORE(ptr1 - kPointerOffset + (SystemPageSize() * 63), false);
allocator.root()->Free(ptr1);
}
#endif
}
......@@ -2158,7 +2148,6 @@ TEST_F(PartitionAllocTest, PurgeDiscardableWithFreeListRewrite) {
// This sub-test tests truncation of the provisioned slots in a trickier
// case where the freelist is rewritten.
allocator.root()->PurgeMemory(PartitionPurgeDecommitEmptySlotSpans);
{
char* ptr1 = reinterpret_cast<char*>(
allocator.root()->Alloc(SystemPageSize() - kExtraAllocSize, type_name));
void* ptr2 =
......@@ -2221,13 +2210,11 @@ TEST_F(PartitionAllocTest, PurgeDiscardableWithFreeListRewrite) {
allocator.root()->Free(ptr1);
allocator.root()->Free(ptr2);
allocator.root()->Free(ptr3);
}
}
TEST_F(PartitionAllocTest, PurgeDiscardableDoubleTruncateFreeList) {
// This sub-test is similar, but tests a double-truncation.
allocator.root()->PurgeMemory(PartitionPurgeDecommitEmptySlotSpans);
{
char* ptr1 = reinterpret_cast<char*>(
allocator.root()->Alloc(SystemPageSize() - kExtraAllocSize, type_name));
void* ptr2 =
......@@ -2277,7 +2264,6 @@ TEST_F(PartitionAllocTest, PurgeDiscardableDoubleTruncateFreeList) {
allocator.root()->Free(ptr1);
allocator.root()->Free(ptr2);
}
}
TEST_F(PartitionAllocTest, ReallocMovesCookies) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment