From 09db2edb459d54a48745b4998b66e29be66a4a02 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Fri, 26 Jul 2019 08:14:09 +0900 Subject: [PATCH] Don't fail catastrophically on non-existing namespace When a new namespace is added to ld.config.txt, it has to be reflected to native_loader_test.cpp. However, failing to do so crashes the test instead of showing an error message that the namespace hasn't been added. Fixing the issue by not returning nullptr when the namespace isn't found. Bug: 138304345 Test: libnativeloader_test Change-Id: I9eee1293956caac69f95a946604a2e6f665bde89 --- libnativeloader/native_loader_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnativeloader/native_loader_test.cpp b/libnativeloader/native_loader_test.cpp index 614188b27..aa9d5e1d1 100644 --- a/libnativeloader/native_loader_test.cpp +++ b/libnativeloader/native_loader_test.cpp @@ -98,7 +98,7 @@ class MockPlatform : public Platform { if (namespaces.find(name) != namespaces.end()) { return namespaces[name]; } - return nullptr; + return TO_MOCK_NAMESPACE(TO_ANDROID_NAMESPACE("(namespace not found")); })); }