summaryrefslogtreecommitdiff
path: root/src/journal/test-journal.c
diff options
context:
space:
mode:
authorRonny Chevalier <chevalier.ronny@gmail.com>2014-11-30 02:16:19 +0100
committerRonny Chevalier <chevalier.ronny@gmail.com>2014-11-30 02:35:52 +0100
commit787784c4c1b24a13207d18b415d60483cfbdeaa3 (patch)
tree66b49b1a8e589fb38aa34d0208e6bc6c0b1a69f2 /src/journal/test-journal.c
parent30fbcf24460263961855e0ce4d8867fd2af3e149 (diff)
tests: use assert_se instead of assert
Otherwise they can be optimized away with -DNDEBUG
Diffstat (limited to 'src/journal/test-journal.c')
-rw-r--r--src/journal/test-journal.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/journal/test-journal.c b/src/journal/test-journal.c
index 74168b9b83..ff9dc9e170 100644
--- a/src/journal/test-journal.c
+++ b/src/journal/test-journal.c
@@ -66,55 +66,55 @@ static void test_non_empty(void) {
#endif
journal_file_dump(f);
- assert(journal_file_next_entry(f, NULL, 0, DIRECTION_DOWN, &o, &p) == 1);
- assert(le64toh(o->entry.seqnum) == 1);
+ assert_se(journal_file_next_entry(f, NULL, 0, DIRECTION_DOWN, &o, &p) == 1);
+ assert_se(le64toh(o->entry.seqnum) == 1);
- assert(journal_file_next_entry(f, o, p, DIRECTION_DOWN, &o, &p) == 1);
- assert(le64toh(o->entry.seqnum) == 2);
+ assert_se(journal_file_next_entry(f, o, p, DIRECTION_DOWN, &o, &p) == 1);
+ assert_se(le64toh(o->entry.seqnum) == 2);
- assert(journal_file_next_entry(f, o, p, DIRECTION_DOWN, &o, &p) == 1);
- assert(le64toh(o->entry.seqnum) == 3);
+ assert_se(journal_file_next_entry(f, o, p, DIRECTION_DOWN, &o, &p) == 1);
+ assert_se(le64toh(o->entry.seqnum) == 3);
- assert(journal_file_next_entry(f, o, p, DIRECTION_DOWN, &o, &p) == 0);
+ assert_se(journal_file_next_entry(f, o, p, DIRECTION_DOWN, &o, &p) == 0);
- assert(journal_file_next_entry(f, NULL, 0, DIRECTION_DOWN, &o, &p) == 1);
- assert(le64toh(o->entry.seqnum) == 1);
+ assert_se(journal_file_next_entry(f, NULL, 0, DIRECTION_DOWN, &o, &p) == 1);
+ assert_se(le64toh(o->entry.seqnum) == 1);
- assert(journal_file_skip_entry(f, o, p, 2, &o, &p) == 1);
- assert(le64toh(o->entry.seqnum) == 3);
+ assert_se(journal_file_skip_entry(f, o, p, 2, &o, &p) == 1);
+ assert_se(le64toh(o->entry.seqnum) == 3);
- assert(journal_file_skip_entry(f, o, p, -2, &o, &p) == 1);
- assert(le64toh(o->entry.seqnum) == 1);
+ assert_se(journal_file_skip_entry(f, o, p, -2, &o, &p) == 1);
+ assert_se(le64toh(o->entry.seqnum) == 1);
- assert(journal_file_skip_entry(f, o, p, -2, &o, &p) == 1);
- assert(le64toh(o->entry.seqnum) == 1);
+ assert_se(journal_file_skip_entry(f, o, p, -2, &o, &p) == 1);
+ assert_se(le64toh(o->entry.seqnum) == 1);
- assert(journal_file_find_data_object(f, test, strlen(test), NULL, &p) == 1);
- assert(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_DOWN, &o, NULL) == 1);
- assert(le64toh(o->entry.seqnum) == 1);
+ assert_se(journal_file_find_data_object(f, test, strlen(test), NULL, &p) == 1);
+ assert_se(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_DOWN, &o, NULL) == 1);
+ assert_se(le64toh(o->entry.seqnum) == 1);
- assert(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_UP, &o, NULL) == 1);
- assert(le64toh(o->entry.seqnum) == 3);
+ assert_se(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_UP, &o, NULL) == 1);
+ assert_se(le64toh(o->entry.seqnum) == 3);
- assert(journal_file_find_data_object(f, test2, strlen(test2), NULL, &p) == 1);
- assert(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_UP, &o, NULL) == 1);
- assert(le64toh(o->entry.seqnum) == 2);
+ assert_se(journal_file_find_data_object(f, test2, strlen(test2), NULL, &p) == 1);
+ assert_se(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_UP, &o, NULL) == 1);
+ assert_se(le64toh(o->entry.seqnum) == 2);
- assert(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_DOWN, &o, NULL) == 1);
- assert(le64toh(o->entry.seqnum) == 2);
+ assert_se(journal_file_next_entry_for_data(f, NULL, 0, p, DIRECTION_DOWN, &o, NULL) == 1);
+ assert_se(le64toh(o->entry.seqnum) == 2);
- assert(journal_file_find_data_object(f, "quux", 4, NULL, &p) == 0);
+ assert_se(journal_file_find_data_object(f, "quux", 4, NULL, &p) == 0);
- assert(journal_file_move_to_entry_by_seqnum(f, 1, DIRECTION_DOWN, &o, NULL) == 1);
- assert(le64toh(o->entry.seqnum) == 1);
+ assert_se(journal_file_move_to_entry_by_seqnum(f, 1, DIRECTION_DOWN, &o, NULL) == 1);
+ assert_se(le64toh(o->entry.seqnum) == 1);
- assert(journal_file_move_to_entry_by_seqnum(f, 3, DIRECTION_DOWN, &o, NULL) == 1);
- assert(le64toh(o->entry.seqnum) == 3);
+ assert_se(journal_file_move_to_entry_by_seqnum(f, 3, DIRECTION_DOWN, &o, NULL) == 1);
+ assert_se(le64toh(o->entry.seqnum) == 3);
- assert(journal_file_move_to_entry_by_seqnum(f, 2, DIRECTION_DOWN, &o, NULL) == 1);
- assert(le64toh(o->entry.seqnum) == 2);
+ assert_se(journal_file_move_to_entry_by_seqnum(f, 2, DIRECTION_DOWN, &o, NULL) == 1);
+ assert_se(le64toh(o->entry.seqnum) == 2);
- assert(journal_file_move_to_entry_by_seqnum(f, 10, DIRECTION_DOWN, &o, NULL) == 0);
+ assert_se(journal_file_move_to_entry_by_seqnum(f, 10, DIRECTION_DOWN, &o, NULL) == 0);
journal_file_rotate(&f, true, true);
journal_file_rotate(&f, true, true);