diff options
author | 2025-03-14 18:00:37 +0000 | |
---|---|---|
committer | 2025-03-20 15:50:43 -0700 | |
commit | 6f3beba5e01780c30364e34be15335da51c4e0e5 (patch) | |
tree | 1f7fcdeefd53e4601a5ad585f9da0765870ce483 /libnativeloader/native_loader_test.cpp | |
parent | 8badd481972993739e7711258f03a44638ca87a5 (diff) |
Move more path logic for tests to testing.cc, so it can be used without
depending on CommonArtTest.
Preparation to fix the libart-gtest dependency in
art_standalone_libartpalette_tests.
Due to a new #include, this necessitated fixing a bunch of `testing`
namespace references that could become ambigious wrt `art::testing`.
Test: m generate-boot-image
Test: art/tools/buildbot-build.sh
Bug: 404306250
Change-Id: Iafb3d73148125775c9c5ddbcbaef39dc61859118
Diffstat (limited to 'libnativeloader/native_loader_test.cpp')
-rw-r--r-- | libnativeloader/native_loader_test.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libnativeloader/native_loader_test.cpp b/libnativeloader/native_loader_test.cpp index a07551032c..90810647c3 100644 --- a/libnativeloader/native_loader_test.cpp +++ b/libnativeloader/native_loader_test.cpp @@ -131,7 +131,7 @@ class MockPlatform : public Platform { ON_CALL(*this, NativeBridgeIsSupported(_)).WillByDefault(Return(is_bridged_)); ON_CALL(*this, NativeBridgeIsPathSupported(_)).WillByDefault(Return(is_bridged_)); ON_CALL(*this, mock_get_exported_namespace(_, _)) - .WillByDefault(testing::Invoke([](bool, const char* name) -> mock_namespace_handle { + .WillByDefault(::testing::Invoke([](bool, const char* name) -> mock_namespace_handle { if (namespaces.find(name) != namespaces.end()) { return namespaces[name]; } @@ -274,8 +274,8 @@ class NativeLoaderTest : public ::testing::TestWithParam<bool> { bool IsBridged() { return GetParam(); } void SetUp() override { - mock = std::make_unique<testing::NiceMock<MockPlatform>>(IsBridged()); - jni_mock = std::make_unique<testing::NiceMock<MockJni>>(); + mock = std::make_unique<::testing::NiceMock<MockPlatform>>(IsBridged()); + jni_mock = std::make_unique<::testing::NiceMock<MockJni>>(); env = std::make_unique<JNIEnv>(); env->functions = CreateJNINativeInterface(); @@ -379,7 +379,7 @@ TEST_P(NativeLoaderTest, OpenNativeLibraryWithoutClassloaderAndCallerLocation) { EXPECT_EQ(errmsg, nullptr); } -INSTANTIATE_TEST_SUITE_P(NativeLoaderTests, NativeLoaderTest, testing::Bool()); +INSTANTIATE_TEST_SUITE_P(NativeLoaderTests, NativeLoaderTest, ::testing::Bool()); ///////////////////////////////////////////////////////////////// @@ -439,8 +439,8 @@ class NativeLoaderTest_Create : public NativeLoaderTest { ON_CALL(*jni_mock, JniObject_getParent(StrEq(class_loader))).WillByDefault(Return(nullptr)); - EXPECT_CALL(*mock, NativeBridgeIsPathSupported(_)).Times(testing::AnyNumber()); - EXPECT_CALL(*mock, NativeBridgeInitialized()).Times(testing::AnyNumber()); + EXPECT_CALL(*mock, NativeBridgeIsPathSupported(_)).Times(::testing::AnyNumber()); + EXPECT_CALL(*mock, NativeBridgeInitialized()).Times(::testing::AnyNumber()); EXPECT_CALL(*mock, mock_create_namespace( Eq(IsBridged()), StartsWith(expected_namespace_prefix + "-"), nullptr, @@ -684,7 +684,7 @@ TEST_P(NativeLoaderTest_Create, TwoApks) { } } -INSTANTIATE_TEST_SUITE_P(NativeLoaderTests_Create, NativeLoaderTest_Create, testing::Bool()); +INSTANTIATE_TEST_SUITE_P(NativeLoaderTests_Create, NativeLoaderTest_Create, ::testing::Bool()); const std::function<Result<bool>(const struct ConfigEntry&)> always_true = [](const struct ConfigEntry&) -> Result<bool> { return true; }; |