chiark / gitweb /
journal: unify code for up and for down traversal
[elogind.git] / src / journal / test-journal.c
index 3b67f1a..93e2b4d 100644 (file)
@@ -54,30 +54,30 @@ int main(int argc, char *argv[]) {
 
         journal_file_dump(f);
 
-        assert(journal_file_next_entry(f, NULL, &o, NULL) == 1);
+        assert(journal_file_next_entry(f, NULL, DIRECTION_DOWN, &o, NULL) == 1);
         assert(le64toh(o->entry.seqnum) == 1);
 
-        assert(journal_file_next_entry(f, o, &o, NULL) == 1);
+        assert(journal_file_next_entry(f, o, DIRECTION_DOWN, &o, NULL) == 1);
         assert(le64toh(o->entry.seqnum) == 2);
 
-        assert(journal_file_next_entry(f, o, &o, NULL) == 1);
+        assert(journal_file_next_entry(f, o, DIRECTION_DOWN, &o, NULL) == 1);
         assert(le64toh(o->entry.seqnum) == 3);
 
-        assert(journal_file_next_entry(f, o, &o, NULL) == 0);
+        assert(journal_file_next_entry(f, o, DIRECTION_DOWN, &o, NULL) == 0);
 
-        assert(journal_file_find_first_entry(f, test, strlen(test), &o, NULL) == 1);
+        assert(journal_file_find_first_entry(f, test, strlen(test), DIRECTION_DOWN, &o, NULL) == 1);
         assert(le64toh(o->entry.seqnum) == 1);
 
-        assert(journal_file_find_last_entry(f, test, strlen(test), &o, NULL) == 1);
+        assert(journal_file_find_first_entry(f, test, strlen(test), DIRECTION_UP, &o, NULL) == 1);
         assert(le64toh(o->entry.seqnum) == 3);
 
-        assert(journal_file_find_last_entry(f, test2, strlen(test2), &o, NULL) == 1);
+        assert(journal_file_find_first_entry(f, test2, strlen(test2), DIRECTION_UP, &o, NULL) == 1);
         assert(le64toh(o->entry.seqnum) == 2);
 
-        assert(journal_file_find_first_entry(f, test2, strlen(test2), &o, NULL) == 1);
+        assert(journal_file_find_first_entry(f, test2, strlen(test2), DIRECTION_DOWN, &o, NULL) == 1);
         assert(le64toh(o->entry.seqnum) == 2);
 
-        assert(journal_file_find_first_entry(f, "quux", 4, &o, NULL) == 0);
+        assert(journal_file_find_first_entry(f, "quux", 4, DIRECTION_DOWN, &o, NULL) == 0);
 
         assert(journal_file_move_to_entry(f, 1, &o, NULL) == 1);
         assert(le64toh(o->entry.seqnum) == 1);