am 1d174a9c: am 02ca0e31: Merge "Fix FORTIFY_SOURCE unittests."
* commit '1d174a9c17f645a27d766a66e7477d797f955e90': Fix FORTIFY_SOURCE unittests.
This commit is contained in:
commit
373ea006ce
@ -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