aboutsummaryrefslogtreecommitdiffstats
path: root/tests/stubs_test.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2013-12-20 18:43:21 -0800
committerChristopher Ferris <cferris@google.com>2014-02-06 20:12:21 -0800
commitf04935c85e0b466f0d30d2cd4c0fa2fff62e7d6d (patch)
tree8f1c6af75517892648f49adad9d4d5d44c20f49c /tests/stubs_test.cpp
parente163a3986aa7d1c67fe3274eb9204812be0a6245 (diff)
downloadandroid_bionic-f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6d.tar.gz
android_bionic-f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6d.tar.bz2
android_bionic-f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6d.zip
Make sure that the same tests are on all platforms.
In order to be able to generate a list of tests for cts, the same set of tests must exist across all platforms. This CL adds empty tests where a test was conditionally compiled out. This CL creates a single library libBionicTests that includes all of the tests found in bionic-unit-tests-static. Also fix a few missing include files in some test files. Tested by running and compiling the tests for every platform and verifying the same number of tests are on each platform. Change-Id: I9989d4bfebb0f9c409a0ce7e87169299eac605a2
Diffstat (limited to 'tests/stubs_test.cpp')
-rw-r--r--tests/stubs_test.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/stubs_test.cpp b/tests/stubs_test.cpp
index 2e1acc11a..7d70aa61f 100644
--- a/tests/stubs_test.cpp
+++ b/tests/stubs_test.cpp
@@ -23,8 +23,7 @@
#include <limits.h>
#include <unistd.h>
-#if __BIONIC__
-
+#if defined(__BIONIC__)
#define CHECK_GETPWNAM_FOR(username, uid, uid_type) \
SCOPED_TRACE(username); \
ASSERT_NO_FATAL_FAILURE(check_getpwnam(username, uid, uid_type));
@@ -51,6 +50,10 @@ static void check_getpwnam(const char* username, uid_t uid, uid_type_t uid_type)
EXPECT_STREQ("/system/bin/sh", pwd->pw_shell);
}
+#else
+#define CHECK_GETPWNAM_FOR(username, uid, uid_type) \
+ GTEST_LOG_(INFO) << "This test does nothing.\n";
+#endif
TEST(getpwnam, system_id_root) {
CHECK_GETPWNAM_FOR("root", 0, TYPE_SYSTEM);
@@ -104,5 +107,3 @@ TEST(getpwnam, app_id_u1_a0) {
TEST(getpwnam, app_id_u1_i0) {
CHECK_GETPWNAM_FOR("u1_i0", 199000, TYPE_APP);
}
-
-#endif /* __BIONIC__ */