]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Use i_asserts() for NULL-checks in test_event_filter_inc_int()
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Tue, 28 Aug 2018 09:00:54 +0000 (12:00 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 13 Nov 2018 13:03:35 +0000 (15:03 +0200)
This is so scan-build doesn't explore the assertations not holding and
create noise with that.

src/lib/test-event-filter.c

index f477fc7dca7737ccb6aede68d1f4c9d7d516a056..4a1e77e210cd0bb366268acd53670252f4718d0b 100644 (file)
@@ -120,13 +120,13 @@ static void test_event_filter_inc_int(void)
        event_filter_add(filter, &query);
 
        const struct event_field *f = event_find_field(root, "int");
-       test_assert(f == NULL);
+       i_assert(f == NULL);
        test_assert(!event_filter_match(filter, root, &failure_ctx));
 
        event_inc_int(root, "int", 7);
        test_assert(!event_filter_match(filter, root, &failure_ctx));
        f = event_find_field(root, "int");
-       test_assert(f != NULL);
+       i_assert(f != NULL);
        test_assert_strcmp(f->key, "int");
        test_assert(f->value_type == EVENT_FIELD_VALUE_TYPE_INTMAX);
        test_assert(f->value.intmax == 7);
@@ -134,7 +134,7 @@ static void test_event_filter_inc_int(void)
        event_inc_int(root, "int", 7);
        test_assert(event_filter_match(filter, root, &failure_ctx));
        f = event_find_field(root, "int");
-       test_assert(f != NULL);
+       i_assert(f != NULL);
        test_assert_strcmp(f->key, "int");
        test_assert(f->value_type == EVENT_FIELD_VALUE_TYPE_INTMAX);
        test_assert(f->value.intmax == 14);