diff options
author | Ronny Chevalier <chevalier.ronny@gmail.com> | 2015-01-22 22:53:42 +0100 |
---|---|---|
committer | Ronny Chevalier <chevalier.ronny@gmail.com> | 2015-01-22 23:10:56 +0100 |
commit | 0c0cdb06c139b52ff103287f6909b3daa5b2dc54 (patch) | |
tree | f904cb032c43691d325b6bb19941a2c115a07416 /src/journal/test-journal-interleaving.c | |
parent | 714af6af8a912650f9129f8b056ed92589443060 (diff) |
tests: use assert_se instead of assert
Otherwise they can be optimized away with -DNDEBUG
Diffstat (limited to 'src/journal/test-journal-interleaving.c')
-rw-r--r-- | src/journal/test-journal-interleaving.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/journal/test-journal-interleaving.c b/src/journal/test-journal-interleaving.c index 23a26c43f6..3c706018e9 100644 --- a/src/journal/test-journal-interleaving.c +++ b/src/journal/test-journal-interleaving.c @@ -212,43 +212,43 @@ static void test_sequence_numbers(void) { append_number(one, 1, &seqnum); printf("seqnum=%"PRIu64"\n", seqnum); - assert(seqnum == 1); + assert_se(seqnum == 1); append_number(one, 2, &seqnum); printf("seqnum=%"PRIu64"\n", seqnum); - assert(seqnum == 2); + assert_se(seqnum == 2); - assert(one->header->state == STATE_ONLINE); - assert(!sd_id128_equal(one->header->file_id, one->header->machine_id)); - assert(!sd_id128_equal(one->header->file_id, one->header->boot_id)); - assert(sd_id128_equal(one->header->file_id, one->header->seqnum_id)); + assert_se(one->header->state == STATE_ONLINE); + assert_se(!sd_id128_equal(one->header->file_id, one->header->machine_id)); + assert_se(!sd_id128_equal(one->header->file_id, one->header->boot_id)); + assert_se(sd_id128_equal(one->header->file_id, one->header->seqnum_id)); memcpy(&seqnum_id, &one->header->seqnum_id, sizeof(sd_id128_t)); assert_se(journal_file_open("two.journal", O_RDWR|O_CREAT, 0644, true, false, NULL, NULL, one, &two) == 0); - assert(two->header->state == STATE_ONLINE); - assert(!sd_id128_equal(two->header->file_id, one->header->file_id)); - assert(sd_id128_equal(one->header->machine_id, one->header->machine_id)); - assert(sd_id128_equal(one->header->boot_id, one->header->boot_id)); - assert(sd_id128_equal(one->header->seqnum_id, one->header->seqnum_id)); + assert_se(two->header->state == STATE_ONLINE); + assert_se(!sd_id128_equal(two->header->file_id, one->header->file_id)); + assert_se(sd_id128_equal(one->header->machine_id, one->header->machine_id)); + assert_se(sd_id128_equal(one->header->boot_id, one->header->boot_id)); + assert_se(sd_id128_equal(one->header->seqnum_id, one->header->seqnum_id)); append_number(two, 3, &seqnum); printf("seqnum=%"PRIu64"\n", seqnum); - assert(seqnum == 3); + assert_se(seqnum == 3); append_number(two, 4, &seqnum); printf("seqnum=%"PRIu64"\n", seqnum); - assert(seqnum == 4); + assert_se(seqnum == 4); test_close(two); append_number(one, 5, &seqnum); printf("seqnum=%"PRIu64"\n", seqnum); - assert(seqnum == 5); + assert_se(seqnum == 5); append_number(one, 6, &seqnum); printf("seqnum=%"PRIu64"\n", seqnum); - assert(seqnum == 6); + assert_se(seqnum == 6); test_close(one); @@ -258,11 +258,11 @@ static void test_sequence_numbers(void) { assert_se(journal_file_open("two.journal", O_RDWR, 0, true, false, NULL, NULL, NULL, &two) == 0); - assert(sd_id128_equal(two->header->seqnum_id, seqnum_id)); + assert_se(sd_id128_equal(two->header->seqnum_id, seqnum_id)); append_number(two, 7, &seqnum); printf("seqnum=%"PRIu64"\n", seqnum); - assert(seqnum == 5); + assert_se(seqnum == 5); /* So..., here we have the same seqnum in two files with the * same seqnum_id. */ |