Merge "Fix FORTIFY_SOURCE unittests."
This commit is contained in:
commit
02ca0e3142
@ -294,5 +294,9 @@ size_t test_fortify_inline(char* buf) {
|
||||
|
||||
TEST(Fortify1_Clang, fortify_inline) {
|
||||
char buf[1024];
|
||||
ASSERT_EQ(test_fortify_inline(buf), sizeof(buf));
|
||||
// no-op. Prints nothing. Needed to prevent the compiler
|
||||
// from optimizing out buf.
|
||||
buf[0] = '\0';
|
||||
printf("%s", buf);
|
||||
ASSERT_EQ(sizeof(buf), test_fortify_inline(buf));
|
||||
}
|
||||
|
@ -167,5 +167,9 @@ size_t test_fortify2_inline(char* buf) {
|
||||
|
||||
TEST(Fortify2_Clang, fortify_inline) {
|
||||
char buf[1024];
|
||||
ASSERT_EQ(test_fortify2_inline(buf), sizeof(buf));
|
||||
// no-op. Prints nothing. Needed to prevent the compiler
|
||||
// from optimizing out buf.
|
||||
buf[0] = '\0';
|
||||
printf("%s", buf);
|
||||
ASSERT_EQ(sizeof(buf), test_fortify2_inline(buf));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user