summaryrefslogtreecommitdiff
path: root/libnativeloader/native_loader_test.cpp
diff options
context:
space:
mode:
authorMartin Stjernholm <mast@google.com>2019-11-12 21:21:32 +0000
committerTreehugger Robot <treehugger-gerrit@google.com>2019-11-13 00:38:15 +0000
commit48297337eb1e44b0d9a3c5e9211ef9080eb406a8 (patch)
treecb10eb0dd62c5474e583c0fb8c6934076be9b5c2 /libnativeloader/native_loader_test.cpp
parentad88cbe5ac72e318d998bc16fc43d75522e13a3a (diff)
Avoid "using namespace" that's blocked by cpplint.
Test: m libnativeloader_test Bug: 142897320 Change-Id: I1d74f54638a0d2dfa1935590124b3266a064c04a
Diffstat (limited to 'libnativeloader/native_loader_test.cpp')
-rw-r--r--libnativeloader/native_loader_test.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/libnativeloader/native_loader_test.cpp b/libnativeloader/native_loader_test.cpp
index 8bd7386eea..3ce3ca9573 100644
--- a/libnativeloader/native_loader_test.cpp
+++ b/libnativeloader/native_loader_test.cpp
@@ -28,12 +28,16 @@
#include "nativeloader/native_loader.h"
#include "public_libraries.h"
-using namespace ::testing;
-using namespace ::android::nativeloader::internal;
-
namespace android {
namespace nativeloader {
+using ::testing::Eq;
+using ::testing::Return;
+using ::testing::StrEq;
+using ::testing::_;
+using internal::ConfigEntry;
+using internal::ParseConfig;
+
// gmock interface that represents interested platform APIs on libdl and libnativebridge
class Platform {
public:
@@ -96,7 +100,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(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];
}
@@ -282,7 +286,7 @@ class NativeLoaderTest : public ::testing::TestWithParam<bool> {
bool IsBridged() { return GetParam(); }
void SetUp() override {
- mock = std::make_unique<NiceMock<MockPlatform>>(IsBridged());
+ mock = std::make_unique<testing::NiceMock<MockPlatform>>(IsBridged());
env = std::make_unique<JNIEnv>();
env->functions = CreateJNINativeInterface();
@@ -355,8 +359,8 @@ class NativeLoaderTest_Create : public NativeLoaderTest {
ON_CALL(*mock, JniObject_getParent(StrEq(class_loader))).WillByDefault(Return(nullptr));
- EXPECT_CALL(*mock, NativeBridgeIsPathSupported(_)).Times(AnyNumber());
- EXPECT_CALL(*mock, NativeBridgeInitialized()).Times(AnyNumber());
+ EXPECT_CALL(*mock, NativeBridgeIsPathSupported(_)).Times(testing::AnyNumber());
+ EXPECT_CALL(*mock, NativeBridgeInitialized()).Times(testing::AnyNumber());
EXPECT_CALL(*mock, mock_create_namespace(
Eq(IsBridged()), StrEq(expected_namespace_name), nullptr,