Skip to content

Commit

Permalink
lib: Use i_asserts() for NULL-checks in test_event_filter_inc_int()
Browse files Browse the repository at this point in the history
This is so scan-build doesn't explore the assertations not holding and
create noise with that.
  • Loading branch information
mrannanj committed Aug 28, 2018
1 parent 1b72f71 commit 74c7e33
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/test-event-filter.c
Expand Up @@ -120,21 +120,21 @@ 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);

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);
Expand Down

0 comments on commit 74c7e33

Please sign in to comment.