Change pointer to allocation in unit tests.
I changed the output from "pointer" to "allocation" for allocation
mismatches. I forgot to update the tests.
Bug: 28218530
(cherry picked from commit 97fd7d95f5abd3fbc3274b2591883ecdd9cc03cc)
Change-Id: I4076e4ddb5d2385e786e3ebca187d1e84e3c172c
diff --git a/libc/malloc_debug/tests/malloc_debug_unit_tests.cpp b/libc/malloc_debug/tests/malloc_debug_unit_tests.cpp
index b6bf7bc..014b913 100644
--- a/libc/malloc_debug/tests/malloc_debug_unit_tests.cpp
+++ b/libc/malloc_debug/tests/malloc_debug_unit_tests.cpp
@@ -382,8 +382,8 @@
std::string expected_log(DIVIDER);
expected_log += android::base::StringPrintf(
"6 malloc_debug +++ ALLOCATION %p SIZE 100 HAS A CORRUPTED FRONT GUARD\n", pointer);
- expected_log += "6 malloc_debug pointer[-32] = 0x00 (expected 0xaa)\n";
- expected_log += "6 malloc_debug pointer[-15] = 0x02 (expected 0xaa)\n";
+ expected_log += "6 malloc_debug allocation[-32] = 0x00 (expected 0xaa)\n";
+ expected_log += "6 malloc_debug allocation[-15] = 0x02 (expected 0xaa)\n";
expected_log += "6 malloc_debug Backtrace at time of failure:\n";
expected_log += "6 malloc_debug #00 pc 0x1\n";
expected_log += "6 malloc_debug #01 pc 0x2\n";
@@ -463,8 +463,8 @@
std::string expected_log(DIVIDER);
expected_log += android::base::StringPrintf(
"6 malloc_debug +++ ALLOCATION %p SIZE 100 HAS A CORRUPTED REAR GUARD\n", pointer);
- expected_log += "6 malloc_debug pointer[130] = 0xbf (expected 0xbb)\n";
- expected_log += "6 malloc_debug pointer[131] = 0x00 (expected 0xbb)\n";
+ expected_log += "6 malloc_debug allocation[130] = 0xbf (expected 0xbb)\n";
+ expected_log += "6 malloc_debug allocation[131] = 0x00 (expected 0xbb)\n";
expected_log += "6 malloc_debug Backtrace at time of failure:\n";
expected_log += "6 malloc_debug #00 pc 0x100\n";
expected_log += "6 malloc_debug #01 pc 0x200\n";
@@ -495,8 +495,8 @@
std::string expected_log(DIVIDER);
expected_log += android::base::StringPrintf(
"6 malloc_debug +++ ALLOCATION %p SIZE 100 HAS A CORRUPTED REAR GUARD\n", pointer);
- expected_log += "6 malloc_debug pointer[130] = 0xbf (expected 0xbb)\n";
- expected_log += "6 malloc_debug pointer[131] = 0x00 (expected 0xbb)\n";
+ expected_log += "6 malloc_debug allocation[130] = 0xbf (expected 0xbb)\n";
+ expected_log += "6 malloc_debug allocation[131] = 0x00 (expected 0xbb)\n";
expected_log += "6 malloc_debug Backtrace at time of failure:\n";
expected_log += "6 malloc_debug #00 pc 0x100\n";
expected_log += "6 malloc_debug #01 pc 0x200\n";
@@ -758,22 +758,22 @@
ASSERT_STREQ("", getFakeLogBuf().c_str());
std::string expected_log(DIVIDER);
expected_log += android::base::StringPrintf("6 malloc_debug +++ ALLOCATION %p USED AFTER FREE\n", pointers[0]);
- expected_log += "6 malloc_debug pointer[20] = 0xaf (expected 0xef)\n";
- expected_log += "6 malloc_debug pointer[99] = 0x12 (expected 0xef)\n";
+ expected_log += "6 malloc_debug allocation[20] = 0xaf (expected 0xef)\n";
+ expected_log += "6 malloc_debug allocation[99] = 0x12 (expected 0xef)\n";
expected_log += DIVIDER;
expected_log += DIVIDER;
expected_log += android::base::StringPrintf("6 malloc_debug +++ ALLOCATION %p USED AFTER FREE\n", pointers[3]);
- expected_log += "6 malloc_debug pointer[3] = 0x34 (expected 0xef)\n";
+ expected_log += "6 malloc_debug allocation[3] = 0x34 (expected 0xef)\n";
expected_log += DIVIDER;
expected_log += DIVIDER;
expected_log += android::base::StringPrintf("6 malloc_debug +++ ALLOCATION %p USED AFTER FREE\n", pointer1_large);
- expected_log += "6 malloc_debug pointer[4095] = 0x90 (expected 0xef)\n";
- expected_log += "6 malloc_debug pointer[4100] = 0x56 (expected 0xef)\n";
- expected_log += "6 malloc_debug pointer[8191] = 0x89 (expected 0xef)\n";
+ expected_log += "6 malloc_debug allocation[4095] = 0x90 (expected 0xef)\n";
+ expected_log += "6 malloc_debug allocation[4100] = 0x56 (expected 0xef)\n";
+ expected_log += "6 malloc_debug allocation[8191] = 0x89 (expected 0xef)\n";
expected_log += DIVIDER;
expected_log += DIVIDER;
expected_log += android::base::StringPrintf("6 malloc_debug +++ ALLOCATION %p USED AFTER FREE\n", pointer2_large);
- expected_log += "6 malloc_debug pointer[8200] = 0x78 (expected 0xef)\n";
+ expected_log += "6 malloc_debug allocation[8200] = 0x78 (expected 0xef)\n";
expected_log += DIVIDER;
ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
}
@@ -797,7 +797,7 @@
ASSERT_STREQ("", getFakeLogBuf().c_str());
std::string expected_log(DIVIDER);
expected_log += android::base::StringPrintf("6 malloc_debug +++ ALLOCATION %p USED AFTER FREE\n", pointer);
- expected_log += "6 malloc_debug pointer[56] = 0x91 (expected 0xef)\n";
+ expected_log += "6 malloc_debug allocation[56] = 0x91 (expected 0xef)\n";
expected_log += DIVIDER;
ASSERT_STREQ(expected_log.c_str(), getFakeLogPrint().c_str());
}
@@ -824,7 +824,7 @@
ASSERT_STREQ("", getFakeLogBuf().c_str());
std::string expected_log(DIVIDER);
expected_log += android::base::StringPrintf("6 malloc_debug +++ ALLOCATION %p USED AFTER FREE\n", pointer);
- expected_log += "6 malloc_debug pointer[101] = 0xab (expected 0xef)\n";
+ expected_log += "6 malloc_debug allocation[101] = 0xab (expected 0xef)\n";
expected_log += "6 malloc_debug Backtrace at time of free:\n";
expected_log += "6 malloc_debug #00 pc 0xfa\n";
expected_log += "6 malloc_debug #01 pc 0xeb\n";