diff options
author | Nick Kralevich <nnk@google.com> | 2014-10-04 15:26:29 -0700 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2014-10-04 22:01:41 -0700 |
commit | 9b543ffeac216189cc8125f7624da9a8cbcbe2e4 (patch) | |
tree | d25f28e88151d614df5e39e4fc4fa22a280a6479 /tests/fortify_test.cpp | |
parent | ae97a776ea900e5923d6d320d72dcc04b224796e (diff) | |
download | android_bionic-9b543ffeac216189cc8125f7624da9a8cbcbe2e4.tar.gz android_bionic-9b543ffeac216189cc8125f7624da9a8cbcbe2e4.tar.bz2 android_bionic-9b543ffeac216189cc8125f7624da9a8cbcbe2e4.zip |
cdefs.h: add artificial attribute to FORTIFY_SOURCE functions
Otherwise the gcc compiler warning doesn't show up.
Delete some unittests. These unittests no longer compile cleanly
using -Wall -Werror, and rewriting them to compile cleanly
isn't feasible.
Bug: 17784968
Change-Id: I9bbdc7b6a1c2ac75754f5d0f90782e0dfae66721
Diffstat (limited to 'tests/fortify_test.cpp')
-rw-r--r-- | tests/fortify_test.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/tests/fortify_test.cpp b/tests/fortify_test.cpp index 352cac694..554a11247 100644 --- a/tests/fortify_test.cpp +++ b/tests/fortify_test.cpp @@ -120,17 +120,6 @@ TEST_F(DEATHTEST, sprintf_fortified2) { #endif #ifndef __clang__ -// This test is disabled in clang because clang doesn't properly detect -// this buffer overflow. TODO: Fix clang. -TEST_F(DEATHTEST, sprintf2_fortified2) { - ::testing::FLAGS_gtest_death_test_style = "threadsafe"; - foo myfoo; - ASSERT_EXIT(sprintf(myfoo.a, "0123456789"), - testing::KilledBySignal(SIGABRT), ""); -} -#endif - -#ifndef __clang__ // These tests are disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. static int vsprintf_helper2(const char *fmt, ...) { @@ -527,12 +516,6 @@ TEST_F(DEATHTEST, sprintf_malloc_fortified) { } #endif -TEST_F(DEATHTEST, sprintf2_fortified) { - ::testing::FLAGS_gtest_death_test_style = "threadsafe"; - char buf[5]; - ASSERT_EXIT(sprintf(buf, "aaaaa"), testing::KilledBySignal(SIGABRT), ""); -} - static int vsprintf_helper(const char *fmt, ...) { char buf[10]; va_list va; @@ -699,16 +682,6 @@ TEST_F(DEATHTEST, FD_ISSET_2_fortified) { ASSERT_EXIT(FD_ISSET(0, set), testing::KilledBySignal(SIGABRT), ""); } -// gtest's ASSERT_EXIT needs a valid expression, but glibc has a do-while macro. -static void FD_ZERO_function(fd_set* s) { FD_ZERO(s); } - -TEST_F(DEATHTEST, FD_ZERO_fortified) { - ::testing::FLAGS_gtest_death_test_style = "threadsafe"; - char buf[1]; - fd_set* set = (fd_set*) buf; - ASSERT_EXIT(FD_ZERO_function(set), testing::KilledBySignal(SIGABRT), ""); -} - TEST_F(DEATHTEST, read_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[1]; |