From 4b713669eb41a0dbc9aa028bf8faa0d2ba25ccfa Mon Sep 17 00:00:00 2001 From: shiqi <1454927420@qq.com> Date: Tue, 30 May 2017 22:36:35 +0800 Subject: [PATCH] test/unittest_bluefs: check whether rmdir success Signed-off-by: shiqi <1454927420@qq.com> --- src/test/objectstore/test_bluefs.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/test/objectstore/test_bluefs.cc b/src/test/objectstore/test_bluefs.cc index 4d437f6a864..33fb7885c31 100644 --- a/src/test/objectstore/test_bluefs.cc +++ b/src/test/objectstore/test_bluefs.cc @@ -377,18 +377,17 @@ TEST(BlueFS, test_simple_compaction_sync) { } } } - // Don't remove all { for (int i=0; i<10; i+=2) { string dir = "dir."; dir.append(to_string(i)); - for (int j=0; j<10; j+=2) { + for (int j=0; j<10; j++) { string file = "file."; file.append(to_string(j)); fs.unlink(dir, file); fs.flush_log(); } - fs.rmdir(dir); + ASSERT_EQ(0, fs.rmdir(dir)); fs.flush_log(); } } @@ -430,18 +429,17 @@ TEST(BlueFS, test_simple_compaction_async) { } } } - // Don't remove all { for (int i=0; i<10; i+=2) { string dir = "dir."; dir.append(to_string(i)); - for (int j=0; j<10; j+=2) { + for (int j=0; j<10; j++) { string file = "file."; file.append(to_string(j)); fs.unlink(dir, file); fs.flush_log(); } - fs.rmdir(dir); + ASSERT_EQ(0, fs.rmdir(dir)); fs.flush_log(); } } -- 2.47.3