diff options
author | Chih-Hung Hsieh <chh@google.com> | 2016-06-03 10:18:07 -0700 |
---|---|---|
committer | Chih-Hung Hsieh <chh@google.com> | 2016-06-03 10:18:07 -0700 |
commit | d61ca37d35e31cae52a543e65d3ae02044abe5d3 (patch) | |
tree | 21c930e08750994a35991697790d61dd16fc4b52 | |
parent | a24cc2639f85d0b0978b18493f4f3bceebbc8ed3 (diff) | |
download | android_bionic-d61ca37d35e31cae52a543e65d3ae02044abe5d3.tar.gz android_bionic-d61ca37d35e31cae52a543e65d3ae02044abe5d3.tar.bz2 android_bionic-d61ca37d35e31cae52a543e65d3ae02044abe5d3.zip |
Fix misc-macro-parentheses warnings in bionic/tests.
Bug: 28705665
Change-Id: I532205b94e30acbdc97f3f4db0660c9a16a7de89
-rw-r--r-- | tests/dlext_test.cpp | 4 | ||||
-rw-r--r-- | tests/string_test.cpp | 8 | ||||
-rw-r--r-- | tests/wchar_test.cpp | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/tests/dlext_test.cpp b/tests/dlext_test.cpp index f8a7ccd4e..a0e83fe86 100644 --- a/tests/dlext_test.cpp +++ b/tests/dlext_test.cpp @@ -37,7 +37,7 @@ #include "dlext_private.h" #define ASSERT_DL_NOTNULL(ptr) \ - ASSERT_TRUE(ptr != nullptr) << "dlerror: " << dlerror() + ASSERT_TRUE((ptr) != nullptr) << "dlerror: " << dlerror() #define ASSERT_DL_ZERO(i) \ ASSERT_EQ(0, i) << "dlerror: " << dlerror() @@ -52,7 +52,7 @@ typedef int (*fn)(void); #define LIBNAME "libdlext_test.so" #define LIBNAME_NORELRO "libdlext_test_norelro.so" -#define LIBSIZE 1024*1024 // how much address space to reserve for it +constexpr auto LIBSIZE = 1024 * 1024; // how much address space to reserve for it #if defined(__LP64__) #define NATIVE_TESTS_PATH "/nativetest64" diff --git a/tests/string_test.cpp b/tests/string_test.cpp index 2a9da10af..763d65cd0 100644 --- a/tests/string_test.cpp +++ b/tests/string_test.cpp @@ -40,10 +40,10 @@ #define STRLCAT_SUPPORTED #endif -#define KB 1024 -#define SMALL 1*KB -#define MEDIUM 4*KB -#define LARGE 64*KB +constexpr auto KB = 1024; +constexpr auto SMALL = 1 * KB; +constexpr auto MEDIUM = 4 * KB; +constexpr auto LARGE = 64 * KB; static int signum(int i) { if (i < 0) { diff --git a/tests/wchar_test.cpp b/tests/wchar_test.cpp index e86d56dc0..000dc9836 100644 --- a/tests/wchar_test.cpp +++ b/tests/wchar_test.cpp @@ -22,7 +22,7 @@ #include <stdint.h> #include <wchar.h> -#define NUM_WCHARS(num_bytes) (num_bytes/sizeof(wchar_t)) +#define NUM_WCHARS(num_bytes) ((num_bytes)/sizeof(wchar_t)) TEST(wchar, sizeof_wchar_t) { EXPECT_EQ(4U, sizeof(wchar_t)); |