Consistently use #if defined(__BIONIC__) in tests.
I've also switched some tests to be positive rather than negative,
because !defined is slightly harder to reason about and there are
only two cases: bionic and glibc.
Change-Id: I8d3ac40420ca5aead3e88c69cf293f267273c8ef
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp
index 4725350..655ad3f 100644
--- a/tests/stdio_test.cpp
+++ b/tests/stdio_test.cpp
@@ -219,7 +219,7 @@
}
TEST(stdio, snprintf_n) {
-#if !defined(__GLIBC__)
+#if defined(__BIONIC__)
// http://b/14492135
char buf[32];
int i = 1234;
@@ -460,7 +460,7 @@
errno = 0;
EXPECT_EQ(EOF, fwprintf(fp, L"hello"));
-#if !defined(__GLIBC__)
+#if defined(__BIONIC__)
EXPECT_EQ(EBADF, errno);
#endif
@@ -478,7 +478,7 @@
errno = 0;
EXPECT_EQ(WEOF, fputwc(L'x', fp));
-#if !defined(__GLIBC__)
+#if defined(__BIONIC__)
EXPECT_EQ(EBADF, errno);
#endif
}
@@ -521,7 +521,7 @@
ASSERT_EQ(mb_four_bytes, static_cast<wchar_t>(fgetwc(fp)));
EXPECT_EQ(0, fgetpos(fp, &pos5));
-#ifdef __BIONIC__
+#if defined(__BIONIC__)
// Bionic's fpos_t is just an alias for off_t. This is inherited from OpenBSD
// upstream. Glibc differs by storing the mbstate_t inside its fpos_t. In
// Bionic (and upstream OpenBSD) the mbstate_t is stored inside the FILE
@@ -586,9 +586,9 @@
// Store the "inside multi byte" position.
fpos_t pos_inside_mb;
ASSERT_EQ(0, fgetpos(fp, &pos_inside_mb));
- #ifdef __BIONIC__
- ASSERT_EQ(offset_inside_mb, static_cast<off_t>(pos_inside_mb));
- #endif
+#if defined(__BIONIC__)
+ ASSERT_EQ(offset_inside_mb, static_cast<off_t>(pos_inside_mb));
+#endif
// Reading from within a byte should produce an error.
ASSERT_EQ(WEOF, fgetwc(fp));