From 6f3beba5e01780c30364e34be15335da51c4e0e5 Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Fri, 14 Mar 2025 18:00:37 +0000 Subject: 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 --- libnativeloader/native_loader_test.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'libnativeloader/native_loader_test.cpp') 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 IsBridged() { return GetParam(); } void SetUp() override { - mock = std::make_unique>(IsBridged()); - jni_mock = std::make_unique>(); + mock = std::make_unique<::testing::NiceMock>(IsBridged()); + jni_mock = std::make_unique<::testing::NiceMock>(); env = std::make_unique(); 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(const struct ConfigEntry&)> always_true = [](const struct ConfigEntry&) -> Result { return true; }; -- cgit v1.2.3-59-g8ed1b