Lines Matching refs:db
96 size_t CountPackages(const MountedApexDatabase& db) { in CountPackages() argument
98 db.ForallMountedApexes([&ret](const std::string& a ATTRIBUTE_UNUSED, in CountPackages()
104 bool Contains(const MountedApexDatabase& db, const std::string& package, in Contains() argument
109 db.ForallMountedApexes([&](const std::string& p, const MountedApexData& d, in Contains()
120 bool ContainsPackage(const MountedApexDatabase& db, const std::string& package, in ContainsPackage() argument
125 db.ForallMountedApexes( in ContainsPackage()
143 MountedApexDatabase db; in TEST() local
144 ASSERT_EQ(CountPackages(db), 0u); in TEST()
146 db.AddMountedApex(kPackage, false, kLoopName, kPath, kMountPoint, kDeviceName, in TEST()
148 ASSERT_TRUE(Contains(db, kPackage, kLoopName, kPath, kMountPoint, kDeviceName, in TEST()
150 ASSERT_TRUE(ContainsPackage(db, kPackage, kLoopName, kPath, kDeviceName, in TEST()
153 db.RemoveMountedApex(kPackage, kPath); in TEST()
154 EXPECT_FALSE(Contains(db, kPackage, kLoopName, kPath, kMountPoint, in TEST()
156 EXPECT_FALSE(ContainsPackage(db, kPackage, kLoopName, kPath, kDeviceName, in TEST()
169 MountedApexDatabase db; in TEST() local
170 ASSERT_EQ(CountPackages(db), 0u); in TEST()
173 db.AddMountedApex(kPackage[i], false, kLoopName[i], kPath[i], in TEST()
177 ASSERT_EQ(CountPackages(db), 4u); in TEST()
179 ASSERT_TRUE(Contains(db, kPackage[i], kLoopName[i], kPath[i], in TEST()
181 ASSERT_TRUE(ContainsPackage(db, kPackage[i], kLoopName[i], kPath[i], in TEST()
185 db.RemoveMountedApex(kPackage[0], kPath[0]); in TEST()
186 EXPECT_FALSE(Contains(db, kPackage[0], kLoopName[0], kPath[0], kMountPoint[0], in TEST()
188 EXPECT_FALSE(ContainsPackage(db, kPackage[0], kLoopName[0], kPath[0], in TEST()
190 EXPECT_TRUE(Contains(db, kPackage[1], kLoopName[1], kPath[1], kMountPoint[1], in TEST()
192 EXPECT_TRUE(ContainsPackage(db, kPackage[1], kLoopName[1], kPath[1], in TEST()
194 EXPECT_TRUE(Contains(db, kPackage[2], kLoopName[2], kPath[2], kMountPoint[2], in TEST()
196 EXPECT_TRUE(ContainsPackage(db, kPackage[2], kLoopName[2], kPath[2], in TEST()
198 EXPECT_TRUE(Contains(db, kPackage[3], kLoopName[3], kPath[3], kMountPoint[3], in TEST()
200 EXPECT_TRUE(ContainsPackage(db, kPackage[3], kLoopName[3], kPath[3], in TEST()
212 MountedApexDatabase db; in TEST() local
213 ASSERT_EQ(CountPackages(db), 0u); in TEST()
215 db.AddMountedApex(kPackage, true, kLoopName, kPath, kMountPoint, kDeviceName, in TEST()
218 auto ret = db.GetLatestMountedApex(kPackage); in TEST()
230 MountedApexDatabase db; in TEST() local
231 auto ret = db.GetLatestMountedApex("no-such-name"); in TEST()
243 MountedApexDatabase db; in TEST()
244 db.AddMountedApex("package", false, "loop", "path", "mount", "dm", in TEST()
246 db.AddMountedApex("package2", false, "loop", "path2", "mount2", "dm2", in TEST()
255 MountedApexDatabase db; in TEST()
256 db.AddMountedApex("package", false, "loop1", "path", "mount", "dm", in TEST()
258 db.AddMountedApex("package2", false, "loop2", "path2", "mount2", "dm2", in TEST()
267 MountedApexDatabase db; in TEST()
268 db.AddMountedApex("package", false, "loop", "path", "mount", "dm", in TEST()
270 db.AddMountedApex("package2", false, "loop2", "path2", "mount2", "dm2", in TEST()
279 MountedApexDatabase db; in TEST()
280 db.AddMountedApex("package", false, "loop", "path", "mount", "dm", in TEST()
282 db.AddMountedApex("package2", false, "loop2", "path2", "mount2", "dm", in TEST()