Skip to content

Commit f018ba3

Browse files
committed
Fix pagemap_test#maps.
We don't necessarily have a brk-based heap. Bug: http://b/27425642 (cherry picked from commit b2084a5) Change-Id: Ia5c96fb26a8011c62037f3a3c4cbf44e3b936507
1 parent ef24424 commit f018ba3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

libpagemap/pagemap_test.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include <gtest/gtest.h>
18-
1917
#include <pagemap/pagemap.h>
2018

19+
#include <string>
20+
21+
#include <gtest/gtest.h>
22+
2123
TEST(pagemap, maps) {
2224
pm_kernel_t* kernel;
2325
ASSERT_EQ(0, pm_kernel_create(&kernel));
@@ -32,8 +34,9 @@ TEST(pagemap, maps) {
3234
bool found_heap = false;
3335
bool found_stack = false;
3436
for (size_t i = 0; i < num_maps; i++) {
35-
if (strcmp(maps[i]->name, "[heap]") == 0) found_heap = true;
36-
if (strcmp(maps[i]->name, "[stack]") == 0) found_stack = true;
37+
std::string name(maps[i]->name);
38+
if (name == "[heap]" || name == "[anon:libc_malloc]") found_heap = true;
39+
if (name == "[stack]") found_stack = true;
3740
}
3841

3942
ASSERT_TRUE(found_heap);

0 commit comments

Comments
 (0)