]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test: ceph_test_filejournal Add check of journalq in WriteTrim test
authorDavid Zafman <dzafman@redhat.com>
Fri, 20 Feb 2015 03:48:11 +0000 (19:48 -0800)
committerDavid Zafman <dzafman@redhat.com>
Wed, 13 May 2015 20:09:12 +0000 (13:09 -0700)
Commit all journal entries and check for empty journalq

Signed-off-by: David Zafman <dzafman@redhat.com>
src/os/FileJournal.h
src/test/test_filejournal.cc

index 964dbe721bc76587fc02164199e9c014da6b5275..d565252f4efdeed2a2464017c3e2bd9ab446b510 100644 (file)
@@ -214,6 +214,8 @@ public:
     }
   } __attribute__((__packed__, aligned(4)));
 
+  bool journalq_empty() { return journalq.empty(); }
+
 private:
   string fn;
 
index befe761400db918aef4a1ee5696c31eaa77090a1..5bbaab1c99fb076fe999470a391c157654ff4ef0 100644 (file)
@@ -360,9 +360,11 @@ TEST(TestFileJournal, WriteTrim) {
   while (ls.size()) {
     delete ls.front();
     ls.pop_front();
-    j.committed_thru(committed);
+    j.committed_thru(++committed);
   }
 
+  ASSERT_TRUE(j.journalq_empty());
+
   j.close();
 }