diff options
author | Elliott Hughes <enh@google.com> | 2019-01-30 13:52:36 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2019-01-30 13:52:36 -0800 |
commit | 18181e6a0a55bb8778e82b5fbc0f7090380ea87d (patch) | |
tree | 756a68e1676145785fcd7e4be1643ba9a31c118c /tests/getauxval_test.cpp | |
parent | ccc0922653904525147b670f0aa25aa85c0d2022 (diff) |
Updates for glibc 2.17.
Bug: http://b/111358231
Test: builds
Change-Id: I542b2a9acc74261ad12b78e4add0f3ae77c3656c
Diffstat (limited to 'tests/getauxval_test.cpp')
-rw-r--r-- | tests/getauxval_test.cpp | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/tests/getauxval_test.cpp b/tests/getauxval_test.cpp index 63bc9636d..aa21817ba 100644 --- a/tests/getauxval_test.cpp +++ b/tests/getauxval_test.cpp @@ -14,29 +14,14 @@ * limitations under the License. */ +#include <sys/auxv.h> + #include <errno.h> #include <sys/cdefs.h> #include <sys/utsname.h> #include <gtest/gtest.h> -// getauxval() was only added as of glibc version 2.16. -// See: http://lwn.net/Articles/519085/ -// Don't try to compile this code on older glibc versions. - -#if defined(__BIONIC__) - #define GETAUXVAL_CAN_COMPILE 1 -#elif defined(__GLIBC_PREREQ) - #if __GLIBC_PREREQ(2, 16) - #define GETAUXVAL_CAN_COMPILE 1 - #endif -#endif - -#if defined(GETAUXVAL_CAN_COMPILE) -#include <sys/auxv.h> -#endif - TEST(getauxval, expected_values) { -#if defined(GETAUXVAL_CAN_COMPILE) ASSERT_EQ(0UL, getauxval(AT_SECURE)); ASSERT_EQ(getuid(), getauxval(AT_UID)); ASSERT_EQ(geteuid(), getauxval(AT_EUID)); @@ -48,19 +33,12 @@ TEST(getauxval, expected_values) { ASSERT_NE(0UL, getauxval(AT_PHNUM)); ASSERT_NE(0UL, getauxval(AT_ENTRY)); ASSERT_NE(0UL, getauxval(AT_PAGESZ)); -#else - GTEST_LOG_(INFO) << "This test requires a C library with getauxval.\n"; -#endif } TEST(getauxval, unexpected_values) { -#if defined(GETAUXVAL_CAN_COMPILE) errno = 0; ASSERT_EQ(0UL, getauxval(0xdeadbeef)); ASSERT_EQ(ENOENT, errno); -#else - GTEST_LOG_(INFO) << "This test requires a C library with getauxval.\n"; -#endif } TEST(getauxval, arm_has_AT_HWCAP2) { |