diff options
author | Elliott Hughes <enh@google.com> | 2019-03-08 15:20:23 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2019-03-12 10:26:39 -0700 |
commit | bcaa454d32e1b4ccf92467bb263d627695ac9a5b (patch) | |
tree | 65d7d4c493242ecb51bfe1796f133b32538de514 /tests/malloc_test.cpp | |
parent | ff16c0b89b7297bc70353f60afac9bb93d6b0087 (diff) |
bionic tests: use GTEST_SKIP.
Also be a bit more to the point in our messages, focusing on "why" not
"what".
Test: ran tests
Change-Id: I297806c7a102bd52602dcd2fcf7a2cd34aba3a11
Diffstat (limited to 'tests/malloc_test.cpp')
-rw-r--r-- | tests/malloc_test.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/malloc_test.cpp b/tests/malloc_test.cpp index bc6a37b75..0226a2d68 100644 --- a/tests/malloc_test.cpp +++ b/tests/malloc_test.cpp @@ -89,7 +89,7 @@ TEST(malloc, calloc_overflow) { } TEST(malloc, memalign_multiple) { - SKIP_WITH_HWASAN; // hwasan requires power of 2 alignment. + SKIP_WITH_HWASAN << "hwasan requires power of 2 alignment"; // Memalign test where the alignment is any value. for (size_t i = 0; i <= 12; i++) { for (size_t alignment = 1 << i; alignment < (1U << (i+1)); alignment++) { @@ -526,24 +526,24 @@ TEST(malloc, mallopt_smoke) { TEST(malloc, mallopt_decay) { #if defined(__BIONIC__) - SKIP_WITH_HWASAN; // hwasan does not implement mallopt + SKIP_WITH_HWASAN << "hwasan does not implement mallopt"; errno = 0; ASSERT_EQ(1, mallopt(M_DECAY_TIME, 1)); ASSERT_EQ(1, mallopt(M_DECAY_TIME, 0)); ASSERT_EQ(1, mallopt(M_DECAY_TIME, 1)); ASSERT_EQ(1, mallopt(M_DECAY_TIME, 0)); #else - GTEST_LOG_(INFO) << "This tests a bionic implementation detail.\n"; + GTEST_SKIP() << "bionic-only test"; #endif } TEST(malloc, mallopt_purge) { #if defined(__BIONIC__) - SKIP_WITH_HWASAN; // hwasan does not implement mallopt + SKIP_WITH_HWASAN << "hwasan does not implement mallopt"; errno = 0; ASSERT_EQ(1, mallopt(M_PURGE, 0)); #else - GTEST_LOG_(INFO) << "This tests a bionic implementation detail.\n"; + GTEST_SKIP() << "bionic-only test"; #endif } @@ -561,7 +561,7 @@ TEST(malloc, reallocarray_overflow) { ASSERT_TRUE(reallocarray(nullptr, b, a) == nullptr); ASSERT_EQ(ENOMEM, errno); #else - GTEST_LOG_(INFO) << "This test requires a C library with reallocarray.\n"; + GTEST_SKIP() << "reallocarray not available"; #endif } @@ -571,13 +571,13 @@ TEST(malloc, reallocarray) { ASSERT_TRUE(p != nullptr); ASSERT_GE(malloc_usable_size(p), 64U); #else - GTEST_LOG_(INFO) << "This test requires a C library with reallocarray.\n"; + GTEST_SKIP() << "reallocarray not available"; #endif } TEST(malloc, mallinfo) { #if defined(__BIONIC__) - SKIP_WITH_HWASAN; // hwasan does not implement mallinfo + SKIP_WITH_HWASAN << "hwasan does not implement mallinfo"; static size_t sizes[] = { 8, 32, 128, 4096, 32768, 131072, 1024000, 10240000, 20480000, 300000000 }; @@ -616,7 +616,7 @@ TEST(malloc, mallinfo) { << kMaxAllocs << " allocations."; } #else - GTEST_LOG_(INFO) << "Host glibc does not pass this test, skipping.\n"; + GTEST_SKIP() << "glibc is broken"; #endif } @@ -627,7 +627,7 @@ TEST(android_mallopt, error_on_unexpected_option) { EXPECT_EQ(false, android_mallopt(unrecognized_option, nullptr, 0)); EXPECT_EQ(ENOTSUP, errno); #else - GTEST_LOG_(INFO) << "This tests a bionic implementation detail.\n"; + GTEST_SKIP() << "bionic-only test"; #endif } @@ -673,6 +673,6 @@ TEST(android_mallopt, init_zygote_child_profiling) { EXPECT_EQ(ENOTSUP, errno); } #else - GTEST_LOG_(INFO) << "This tests a bionic implementation detail.\n"; + GTEST_SKIP() << "bionic-only test"; #endif } |