From 0bcb3d2f34c20be63c9d93dd749a304689a0af12 Mon Sep 17 00:00:00 2001 From: zhanglei <243290414@qq.com> Date: Wed, 24 May 2017 05:22:02 -0400 Subject: [PATCH] test/:Check make_writeable return value Signed-off-by: zhanglei <243290414@qq.com> --- src/test/test_filejournal.cc | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/test/test_filejournal.cc b/src/test/test_filejournal.cc index 8a1ef5d426c..86d70736745 100644 --- a/src/test/test_filejournal.cc +++ b/src/test/test_filejournal.cc @@ -137,7 +137,7 @@ TEST(TestFileJournal, WriteSmall) { FileJournal j(g_ceph_context, fsid, finisher, &sync_cond, path, subtests[i].directio, subtests[i].aio, subtests[i].faio); ASSERT_EQ(0, j.create()); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); vector tls; bufferlist bl; @@ -162,7 +162,7 @@ TEST(TestFileJournal, WriteBig) { FileJournal j(g_ceph_context, fsid, finisher, &sync_cond, path, subtests[i].directio, subtests[i].aio, subtests[i].faio); ASSERT_EQ(0, j.create()); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); bufferlist bl; while (bl.length() < size_mb*1000/2) { @@ -190,7 +190,7 @@ TEST(TestFileJournal, WriteMany) { FileJournal j(g_ceph_context, fsid, finisher, &sync_cond, path, subtests[i].directio, subtests[i].aio, subtests[i].faio); ASSERT_EQ(0, j.create()); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); C_GatherBuilder gb(g_ceph_context, new C_SafeCond(&wait_lock, &cond, &done)); @@ -223,7 +223,7 @@ TEST(TestFileJournal, WriteManyVecs) { FileJournal j(g_ceph_context, fsid, finisher, &sync_cond, path, subtests[i].directio, subtests[i].aio, subtests[i].faio); ASSERT_EQ(0, j.create()); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); C_GatherBuilder gb(g_ceph_context, new C_SafeCond(&wait_lock, &cond, &done)); @@ -256,7 +256,7 @@ TEST(TestFileJournal, WriteManyVecs) { ASSERT_EQ(true, j.read_entry(inbl, seq)); ASSERT_EQ(seq, 2ull); ASSERT_TRUE(inbl.contents_equal(origbl)); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); j.close(); } @@ -275,7 +275,7 @@ TEST(TestFileJournal, ReplaySmall) { FileJournal j(g_ceph_context, fsid, finisher, &sync_cond, path, subtests[i].directio, subtests[i].aio, subtests[i].faio); ASSERT_EQ(0, j.create()); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); C_GatherBuilder gb(g_ceph_context, new C_SafeCond(&wait_lock, &cond, &done)); @@ -318,7 +318,7 @@ TEST(TestFileJournal, ReplaySmall) { ASSERT_TRUE(!j.read_entry(inbl, seq)); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); j.close(); } } @@ -335,7 +335,7 @@ TEST(TestFileJournal, ReplayCorrupt) { FileJournal j(g_ceph_context, fsid, finisher, &sync_cond, path, subtests[i].directio, subtests[i].aio, subtests[i].faio); ASSERT_EQ(0, j.create()); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); C_GatherBuilder gb(g_ceph_context, new C_SafeCond(&wait_lock, &cond, &done)); @@ -404,7 +404,7 @@ TEST(TestFileJournal, ReplayCorrupt) { ASSERT_FALSE(j.read_entry(inbl, seq, &corrupt)); ASSERT_TRUE(corrupt); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); j.close(); } } @@ -420,7 +420,7 @@ TEST(TestFileJournal, WriteTrim) { FileJournal j(g_ceph_context, fsid, finisher, &sync_cond, path, subtests[i].directio, subtests[i].aio, subtests[i].faio); ASSERT_EQ(0, j.create()); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); list ls; @@ -472,7 +472,7 @@ TEST(TestFileJournal, WriteTrimSmall) { FileJournal j(g_ceph_context, fsid, finisher, &sync_cond, path, subtests[i].directio, subtests[i].aio, subtests[i].faio); ASSERT_EQ(0, j.create()); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); list ls; @@ -522,7 +522,7 @@ TEST(TestFileJournal, ReplayDetectCorruptFooterMagic) { FileJournal j(g_ceph_context, fsid, finisher, &sync_cond, path, subtests[i].directio, subtests[i].aio, subtests[i].faio); ASSERT_EQ(0, j.create()); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); C_GatherBuilder gb(g_ceph_context, new C_SafeCond(&wait_lock, &cond, &done)); @@ -563,7 +563,7 @@ TEST(TestFileJournal, ReplayDetectCorruptFooterMagic) { ASSERT_FALSE(result); ASSERT_TRUE(corrupt); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); j.close(); ::close(fd); } @@ -581,7 +581,7 @@ TEST(TestFileJournal, ReplayDetectCorruptPayload) { FileJournal j(g_ceph_context, fsid, finisher, &sync_cond, path, subtests[i].directio, subtests[i].aio, subtests[i].faio); ASSERT_EQ(0, j.create()); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); C_GatherBuilder gb(g_ceph_context, new C_SafeCond(&wait_lock, &cond, &done)); @@ -622,7 +622,7 @@ TEST(TestFileJournal, ReplayDetectCorruptPayload) { ASSERT_FALSE(result); ASSERT_TRUE(corrupt); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); j.close(); ::close(fd); } @@ -640,7 +640,7 @@ TEST(TestFileJournal, ReplayDetectCorruptHeader) { FileJournal j(g_ceph_context, fsid, finisher, &sync_cond, path, subtests[i].directio, subtests[i].aio, subtests[i].faio); ASSERT_EQ(0, j.create()); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); C_GatherBuilder gb(g_ceph_context, new C_SafeCond(&wait_lock, &cond, &done)); @@ -681,7 +681,7 @@ TEST(TestFileJournal, ReplayDetectCorruptHeader) { ASSERT_FALSE(result); ASSERT_TRUE(corrupt); - j.make_writeable(); + ASSERT_EQ(0, j.make_writeable()); j.close(); ::close(fd); }