Lines Matching defs:regions
16 std::vector<MappedMemoryRegion> regions;
17 EXPECT_TRUE(ParseProcMaps("", ®ions));
18 EXPECT_EQ(0u, regions.size());
25 std::vector<MappedMemoryRegion> regions;
26 ASSERT_TRUE(ParseProcMaps(kNoSpaces, ®ions));
27 ASSERT_EQ(1u, regions.size());
29 EXPECT_EQ(0x00400000u, regions[0].start);
30 EXPECT_EQ(0x0040b000u, regions[0].end);
31 EXPECT_EQ(0x00002200u, regions[0].offset);
32 EXPECT_EQ("/bin/cat", regions[0].path);
39 std::vector<MappedMemoryRegion> regions;
40 ASSERT_TRUE(ParseProcMaps(kSpaces, ®ions));
41 ASSERT_EQ(1u, regions.size());
43 EXPECT_EQ(0x00400000u, regions[0].start);
44 EXPECT_EQ(0x0040b000u, regions[0].end);
45 EXPECT_EQ(0x00002200u, regions[0].offset);
46 EXPECT_EQ("/bin/space cat", regions[0].path);
53 std::vector<MappedMemoryRegion> regions;
54 ASSERT_FALSE(ParseProcMaps(kNoSpaces, ®ions));
61 std::vector<MappedMemoryRegion> regions;
62 ASSERT_TRUE(ParseProcMaps(kNoPath, ®ions));
63 ASSERT_EQ(1u, regions.size());
65 EXPECT_EQ(0x00400000u, regions[0].start);
66 EXPECT_EQ(0x0040b000u, regions[0].end);
67 EXPECT_EQ(0x00000000u, regions[0].offset);
68 EXPECT_EQ("", regions[0].path);
75 std::vector<MappedMemoryRegion> regions;
76 ASSERT_TRUE(ParseProcMaps(kHeap, ®ions));
77 ASSERT_EQ(1u, regions.size());
79 EXPECT_EQ(0x022ac000u, regions[0].start);
80 EXPECT_EQ(0x022cd000u, regions[0].end);
81 EXPECT_EQ(0x00000000u, regions[0].offset);
82 EXPECT_EQ("[heap]", regions[0].path);
90 std::vector<MappedMemoryRegion> regions;
91 ASSERT_TRUE(ParseProcMaps(kStack, ®ions));
92 ASSERT_EQ(1u, regions.size());
94 EXPECT_EQ(0xbeb04000u, regions[0].start);
95 EXPECT_EQ(0xbeb25000u, regions[0].end);
96 EXPECT_EQ(0x00000000u, regions[0].offset);
97 EXPECT_EQ("[stack]", regions[0].path);
104 std::vector<MappedMemoryRegion> regions;
105 ASSERT_TRUE(ParseProcMaps(kStack, ®ions));
106 ASSERT_EQ(1u, regions.size());
108 EXPECT_EQ(0x7fff69c5b000u, regions[0].start);
109 EXPECT_EQ(0x7fff69c7d000u, regions[0].end);
110 EXPECT_EQ(0x00000000u, regions[0].offset);
111 EXPECT_EQ("[stack]", regions[0].path);
121 std::vector<MappedMemoryRegion> regions;
122 ASSERT_TRUE(ParseProcMaps(kMultiple, ®ions));
123 ASSERT_EQ(3u, regions.size());
125 EXPECT_EQ(0x00400000u, regions[0].start);
126 EXPECT_EQ(0x0040b000u, regions[0].end);
127 EXPECT_EQ(0x00000000u, regions[0].offset);
128 EXPECT_EQ("/bin/cat", regions[0].path);
130 EXPECT_EQ(0x0060a000u, regions[1].start);
131 EXPECT_EQ(0x0060b000u, regions[1].end);
132 EXPECT_EQ(0x0000a000u, regions[1].offset);
133 EXPECT_EQ("/bin/cat", regions[1].path);
135 EXPECT_EQ(0x0060b000u, regions[2].start);
136 EXPECT_EQ(0x0060c000u, regions[2].end);
137 EXPECT_EQ(0x0000b000u, regions[2].offset);
138 EXPECT_EQ("/bin/cat", regions[2].path);
174 std::vector<MappedMemoryRegion> regions;
175 EXPECT_TRUE(ParseProcMaps(kTestCases[i].input, ®ions));
176 EXPECT_EQ(1u, regions.size());
177 if (regions.empty())
179 EXPECT_EQ(kTestCases[i].permissions, regions[0].permissions);
194 std::vector<MappedMemoryRegion> regions;
195 ASSERT_TRUE(ParseProcMaps(proc_maps, ®ions));
196 ASSERT_FALSE(regions.empty());
207 for (size_t i = 0; i < regions.size(); ++i) {
208 if (regions[i].path == exe_path.value()) {
214 if (regions[i].path == "[stack]") {
218 EXPECT_GE(address, regions[i].start);
219 EXPECT_LT(address, regions[i].end);
222 EXPECT_TRUE(regions[i].permissions & MappedMemoryRegion::READ);
223 EXPECT_TRUE(regions[i].permissions & MappedMemoryRegion::WRITE);
224 EXPECT_FALSE(regions[i].permissions & MappedMemoryRegion::EXECUTE);
225 EXPECT_TRUE(regions[i].permissions & MappedMemoryRegion::PRIVATE);
230 if (address >= regions[i].start && address < regions[i].end) {
231 EXPECT_FALSE(found_address) << "Found same address in multiple regions";
258 std::vector<MappedMemoryRegion> regions;
259 EXPECT_FALSE(ParseProcMaps(kTestCases[i], ®ions));
275 std::vector<MappedMemoryRegion> regions;
276 EXPECT_FALSE(ParseProcMaps(kTestCases[i], ®ions));