diff options
| author | Chih-Hung Hsieh <chh@google.com> | 2017-10-31 15:54:05 -0700 |
|---|---|---|
| committer | Chih-Hung Hsieh <chh@google.com> | 2017-10-31 15:55:40 -0700 |
| commit | 048df230ab15ba1881c07590140a75cea286a5db (patch) | |
| tree | a4fec4004f00a35dce466d17a192e71236ecc56e /libnativebridge | |
| parent | f0da1c42a3edb40d09a6ea49fee05bb0d6d243fc (diff) | |
| download | system_core-048df230ab15ba1881c07590140a75cea286a5db.tar.gz system_core-048df230ab15ba1881c07590140a75cea286a5db.tar.bz2 system_core-048df230ab15ba1881c07590140a75cea286a5db.zip | |
Use -Werror in system/core/libnativebridge
* Fix unused static variable warning.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I9c3a2031ac49368a1833a9d46af8174c3c9cd32e
Diffstat (limited to 'libnativebridge')
| -rw-r--r-- | libnativebridge/tests/Android.mk | 6 | ||||
| -rw-r--r-- | libnativebridge/tests/PreInitializeNativeBridge_test.cpp | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/libnativebridge/tests/Android.mk b/libnativebridge/tests/Android.mk index b3861e080..5b9ba1cde 100644 --- a/libnativebridge/tests/Android.mk +++ b/libnativebridge/tests/Android.mk @@ -33,10 +33,15 @@ shared_libraries := \ libnativebridge \ libnativebridge-dummy +libnativebridge_tests_common_cflags := \ + -Wall \ + -Werror \ + $(foreach file,$(test_src_files), \ $(eval include $(CLEAR_VARS)) \ $(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \ $(eval LOCAL_SRC_FILES := $(file)) \ + $(eval LOCAL_CFLAGS := $(libnativebridge_tests_common_cflags)) \ $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \ $(eval include $(BUILD_NATIVE_TEST)) \ ) @@ -45,6 +50,7 @@ $(foreach file,$(test_src_files), \ $(eval include $(CLEAR_VARS)) \ $(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \ $(eval LOCAL_SRC_FILES := $(file)) \ + $(eval LOCAL_CFLAGS := $(libnativebridge_tests_common_cflags)) \ $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \ $(eval include $(BUILD_HOST_NATIVE_TEST)) \ ) diff --git a/libnativebridge/tests/PreInitializeNativeBridge_test.cpp b/libnativebridge/tests/PreInitializeNativeBridge_test.cpp index f3e5f38cf..cd5a8e24b 100644 --- a/libnativebridge/tests/PreInitializeNativeBridge_test.cpp +++ b/libnativebridge/tests/PreInitializeNativeBridge_test.cpp @@ -30,12 +30,12 @@ namespace android { -static constexpr const char* kTestData = "PreInitializeNativeBridge test."; - TEST_F(NativeBridgeTest, PreInitializeNativeBridge) { ASSERT_TRUE(LoadNativeBridge(kNativeBridgeLibrary, nullptr)); #if !defined(__APPLE__) // Mac OS does not support bind-mount. #if !defined(__ANDROID__) // Cannot write into the hard-wired location. + static constexpr const char* kTestData = "PreInitializeNativeBridge test."; + // Try to create our mount namespace. if (unshare(CLONE_NEWNS) != -1) { // Create a dummy file. |
