OSDN Git Service

f2fs_utils: Add a static libf2fs_sparseblock for minvold
[android-x86/system-extras.git] / libpagemap / pagemap_test.cpp
index ccbc211..592072c 100644 (file)
  * limitations under the License.
  */
 
-#include <gtest/gtest.h>
-
 #include <pagemap/pagemap.h>
 
+#include <string>
+
+#include <gtest/gtest.h>
+
 TEST(pagemap, maps) {
   pm_kernel_t* kernel;
   ASSERT_EQ(0, pm_kernel_create(&kernel));
@@ -32,8 +34,9 @@ TEST(pagemap, maps) {
   bool found_heap = false;
   bool found_stack = false;
   for (size_t i = 0; i < num_maps; i++) {
-    if (strcmp(maps[i]->name, "[heap]") == 0) found_heap = true;
-    if (strcmp(maps[i]->name, "[stack]") == 0) found_stack = true;
+    std::string name(maps[i]->name);
+    if (name == "[heap]" || name == "[anon:libc_malloc]") found_heap = true;
+    if (name == "[stack]") found_stack = true;
   }
 
   ASSERT_TRUE(found_heap);