summaryrefslogtreecommitdiff
path: root/tests/stdio_test.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2021-02-18 17:11:56 -0800
committerElliott Hughes <enh@google.com>2021-02-18 17:23:04 -0800
commite657eb4f8abc2bb21571df1c0d0e0cbfaadce1c1 (patch)
treeece8247ab16072e2fd1fca786be9050562bb3f60 /tests/stdio_test.cpp
parent332065d57e734b65f56474d136d22d767e36cbcd (diff)
Fix some bionic death tests.
These were creating tombstones and spewing to the log. You need TEST_F() rather than TEST(), and the modern style is apparently to use `using` rather than an empty subclass. Bug: http://b/180605583 Test: run tests, check logcat Change-Id: I1e639d34854aeff6f042c24643b769a6bcfab877
Diffstat (limited to 'tests/stdio_test.cpp')
-rw-r--r--tests/stdio_test.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp
index afbbf2686..5491589a5 100644
--- a/tests/stdio_test.cpp
+++ b/tests/stdio_test.cpp
@@ -56,8 +56,8 @@
using namespace std::string_literals;
-class stdio_DeathTest : public BionicDeathTest {};
-class stdio_nofortify_DeathTest : public BionicDeathTest {};
+using stdio_DeathTest = BionicDeathTest;
+using stdio_nofortify_DeathTest = BionicDeathTest;
static void SetFileTo(const char* path, const char* content) {
FILE* fp;
@@ -361,7 +361,7 @@ TEST(STDIO_TEST, snprintf_S) { // Synonym for %ls.
EXPECT_STREQ("<hi>", buf);
}
-TEST(STDIO_TEST, snprintf_n) {
+TEST_F(STDIO_DEATHTEST, snprintf_n) {
#if defined(__BIONIC__)
// http://b/14492135 and http://b/31832608.
char buf[32];
@@ -2425,7 +2425,7 @@ TEST(STDIO_TEST, remove) {
ASSERT_EQ(ENOENT, errno);
}
-TEST(STDIO_DEATHTEST, snprintf_30445072_known_buffer_size) {
+TEST_F(STDIO_DEATHTEST, snprintf_30445072_known_buffer_size) {
char buf[16];
ASSERT_EXIT(snprintf(buf, atol("-1"), "hello"),
testing::KilledBySignal(SIGABRT),
@@ -2437,7 +2437,7 @@ TEST(STDIO_DEATHTEST, snprintf_30445072_known_buffer_size) {
);
}
-TEST(STDIO_DEATHTEST, snprintf_30445072_unknown_buffer_size) {
+TEST_F(STDIO_DEATHTEST, snprintf_30445072_unknown_buffer_size) {
std::string buf = "world";
ASSERT_EXIT(snprintf(&buf[0], atol("-1"), "hello"),
testing::KilledBySignal(SIGABRT),