diff options
author | Christopher Ferris <cferris@google.com> | 2016-02-22 19:14:26 -0800 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2016-02-22 19:14:26 -0800 |
commit | 0e2a0265798ed47cbbf6977f0f84cf81d93173a6 (patch) | |
tree | 888f3e9a96e38769cddae99ce0b9eb2881aa5c4d /libc/malloc_debug/tests/malloc_debug_config_tests.cpp | |
parent | f2d516b3f9ef901991387ee473140ea24feaab48 (diff) |
Fix wrong guard values for 64 bit.
I added the code to force alignments of 8 for 32 bit and 16 for 64 bit,
but I missed a couple of tests that failed due to this change. Fix the
failing tests.
Bug: 26739265
Change-Id: Ice9932d1419e59c07483c4c9fcdb84970844f0a6
Diffstat (limited to 'libc/malloc_debug/tests/malloc_debug_config_tests.cpp')
-rw-r--r-- | libc/malloc_debug/tests/malloc_debug_config_tests.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libc/malloc_debug/tests/malloc_debug_config_tests.cpp b/libc/malloc_debug/tests/malloc_debug_config_tests.cpp index 1c800db4c..b8535e180 100644 --- a/libc/malloc_debug/tests/malloc_debug_config_tests.cpp +++ b/libc/malloc_debug/tests/malloc_debug_config_tests.cpp @@ -208,19 +208,19 @@ TEST_F(MallocDebugConfigTest, extra_space) { } TEST_F(MallocDebugConfigTest, multiple_options) { - ASSERT_TRUE(InitConfig(" backtrace=64 front_guard=24")); + ASSERT_TRUE(InitConfig(" backtrace=64 front_guard=48")); ASSERT_EQ(BACKTRACE | TRACK_ALLOCS | FRONT_GUARD, config->options); ASSERT_EQ(64U, config->backtrace_frames); - ASSERT_EQ(24U, config->front_guard_bytes); + ASSERT_EQ(48U, config->front_guard_bytes); ASSERT_STREQ("", getFakeLogBuf().c_str()); ASSERT_STREQ("", getFakeLogPrint().c_str()); } TEST_F(MallocDebugConfigTest, front_guard) { - ASSERT_TRUE(InitConfig("front_guard=24")); + ASSERT_TRUE(InitConfig("front_guard=48")); ASSERT_EQ(FRONT_GUARD, config->options); - ASSERT_EQ(24U, config->front_guard_bytes); + ASSERT_EQ(48U, config->front_guard_bytes); ASSERT_TRUE(InitConfig("front_guard")); ASSERT_EQ(FRONT_GUARD, config->options); @@ -228,7 +228,11 @@ TEST_F(MallocDebugConfigTest, front_guard) { ASSERT_TRUE(InitConfig("front_guard=39")); ASSERT_EQ(FRONT_GUARD, config->options); +#if defined(__LP64__) + ASSERT_EQ(48U, config->front_guard_bytes); +#else ASSERT_EQ(40U, config->front_guard_bytes); +#endif ASSERT_TRUE(InitConfig("front_guard=41")); ASSERT_EQ(FRONT_GUARD, config->options); |