diff options
author | Steven Laver <lavers@google.com> | 2019-10-24 16:39:48 -0700 |
---|---|---|
committer | Steven Laver <lavers@google.com> | 2019-10-24 16:39:48 -0700 |
commit | 38a2028b52982e46a8dba510b9a9291487ee764e (patch) | |
tree | 83ff6fc89f06331b1f948b311b02fc5c8979d2e4 /tests/malloc_test.cpp | |
parent | a1ac182d1b5fb1e4ec1eb2f399b358ec88352e07 (diff) | |
parent | cf4528ba7412905035d61ea61920b721968b3504 (diff) |
Merge RP1A.191024.001
Change-Id: I45bd393849946efea6dfd4770de8d18d98028fee
Diffstat (limited to 'tests/malloc_test.cpp')
-rw-r--r-- | tests/malloc_test.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/malloc_test.cpp b/tests/malloc_test.cpp index 989e2d079..0407553b2 100644 --- a/tests/malloc_test.cpp +++ b/tests/malloc_test.cpp @@ -371,7 +371,8 @@ TEST(malloc, malloc_info) { auto root = doc.FirstChildElement(); ASSERT_NE(nullptr, root); ASSERT_STREQ("malloc", root->Name()); - if (std::string(root->Attribute("version")) == "jemalloc-1") { + std::string version(root->Attribute("version")); + if (version == "jemalloc-1") { // Verify jemalloc version of this data. ASSERT_STREQ("jemalloc-1", root->Attribute("version")); @@ -404,9 +405,9 @@ TEST(malloc, malloc_info) { } } } else { - // Only verify that this is debug-malloc-1, the malloc debug unit tests - // verify the output. - ASSERT_STREQ("debug-malloc-1", root->Attribute("version")); + // Do not verify output for scudo or debug malloc. + ASSERT_TRUE(version == "scudo-1" || version == "debug-malloc-1") + << "Unknown version: " << version; } #endif } @@ -431,7 +432,8 @@ TEST(malloc, malloc_info_matches_mallinfo) { auto root = doc.FirstChildElement(); ASSERT_NE(nullptr, root); ASSERT_STREQ("malloc", root->Name()); - if (std::string(root->Attribute("version")) == "jemalloc-1") { + std::string version(root->Attribute("version")); + if (version == "jemalloc-1") { // Verify jemalloc version of this data. ASSERT_STREQ("jemalloc-1", root->Attribute("version")); @@ -458,9 +460,9 @@ TEST(malloc, malloc_info_matches_mallinfo) { EXPECT_LE(mallinfo_before_allocated_bytes, total_allocated_bytes); EXPECT_GE(mallinfo_after_allocated_bytes, total_allocated_bytes); } else { - // Only verify that this is debug-malloc-1, the malloc debug unit tests - // verify the output. - ASSERT_STREQ("debug-malloc-1", root->Attribute("version")); + // Do not verify output for scudo or debug malloc. + ASSERT_TRUE(version == "scudo-1" || version == "debug-malloc-1") + << "Unknown version: " << version; } #endif } |