summaryrefslogtreecommitdiff
path: root/runtime/class_loader_context_test.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2018-11-13 15:39:53 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2018-11-13 15:39:53 +0000
commit9893c4773ce1da4dfb9f15140e93bf785abd89f7 (patch)
tree3b665e3d9064957f6cc5b8eb9cf7b0c5177c91bc /runtime/class_loader_context_test.cc
parent61f9bf1d48c43a4b65df5d0fe2d70c4ee87921f8 (diff)
Add missed null check in ClassLoaderContext::VerifyClassLoaderContextMatch.
bug: 119441748 Test: class_loader_context_test Change-Id: I68301a568eb321b42209584a3328e9a1b0fcc7ba
Diffstat (limited to 'runtime/class_loader_context_test.cc')
-rw-r--r--runtime/class_loader_context_test.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/class_loader_context_test.cc b/runtime/class_loader_context_test.cc
index cb3dc6506f..f3e2ac00ba 100644
--- a/runtime/class_loader_context_test.cc
+++ b/runtime/class_loader_context_test.cc
@@ -735,6 +735,17 @@ TEST_F(ClassLoaderContextTest, VerifyClassLoaderContextMatch) {
ClassLoaderContext::VerificationResult::kMismatch);
}
+TEST_F(ClassLoaderContextTest, VerifyClassLoaderContextMatchSpecial) {
+ std::string context_spec = "&";
+ std::unique_ptr<ClassLoaderContext> context = ParseContextWithChecksums(context_spec);
+ // Pretend that we successfully open the dex files to pass the DCHECKS.
+ // (as it's much easier to test all the corner cases without relying on actual dex files).
+ PretendContextOpenedDexFiles(context.get());
+
+ ASSERT_EQ(context->VerifyClassLoaderContextMatch(context_spec),
+ ClassLoaderContext::VerificationResult::kForcedToSkipChecks);
+}
+
TEST_F(ClassLoaderContextTest, VerifyClassLoaderContextMatchWithSL) {
std::string context_spec =
"PCL[a.dex*123:b.dex*456]{PCL[d.dex*321];PCL[e.dex*654]#PCL[f.dex*098:g.dex*999]}"