test: use assert_se() instead of assert()
This commit is contained in:
@@ -16,7 +16,7 @@ static void test_one_address(sd_bus *b,
|
||||
r = bus_set_address_system_remote(b, host);
|
||||
log_info("\"%s\" → %d, \"%s\"", host, r, strna(r >= 0 ? b->address : NULL));
|
||||
if (result < 0 || expected) {
|
||||
assert(r == result);
|
||||
assert_se(r == result);
|
||||
if (r >= 0)
|
||||
assert_se(streq(b->address, expected));
|
||||
}
|
||||
|
||||
@@ -404,8 +404,8 @@ struct inotify_context {
|
||||
static void maybe_exit(sd_event_source *s, struct inotify_context *c) {
|
||||
unsigned n;
|
||||
|
||||
assert(s);
|
||||
assert(c);
|
||||
assert_se(s);
|
||||
assert_se(c);
|
||||
|
||||
if (!c->delete_self_handler_called)
|
||||
return;
|
||||
|
||||
@@ -118,7 +118,7 @@ _unused_ static void test_decompress_startswith(const char *compression,
|
||||
compressed = compressed2 = malloc(BUFSIZE_2);
|
||||
assert_se(compressed2);
|
||||
r = compress(data, data_len, compressed, BUFSIZE_2, &csize);
|
||||
assert(r == 0);
|
||||
assert_se(r == 0);
|
||||
}
|
||||
assert_se(r == 0);
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@ struct test_async_object {
|
||||
};
|
||||
|
||||
static struct test_async_object *test_async_object_free(struct test_async_object *t) {
|
||||
assert(t);
|
||||
assert_se(t);
|
||||
|
||||
free(t->ifname);
|
||||
return mfree(t);
|
||||
@@ -315,7 +315,7 @@ static int link_handler2(sd_netlink *rtnl, sd_netlink_message *m, void *userdata
|
||||
static void test_async_object_destroy(void *userdata) {
|
||||
struct test_async_object *t = userdata;
|
||||
|
||||
assert(userdata);
|
||||
assert_se(userdata);
|
||||
|
||||
log_info("%s: n_ref=%u", __func__, t->n_ref);
|
||||
test_async_object_unref(t);
|
||||
@@ -593,8 +593,8 @@ static int genl_ctrl_match_callback(sd_netlink *genl, sd_netlink_message *m, voi
|
||||
uint16_t id;
|
||||
uint8_t cmd;
|
||||
|
||||
assert(genl);
|
||||
assert(m);
|
||||
assert_se(genl);
|
||||
assert_se(m);
|
||||
|
||||
assert_se(sd_genl_message_get_family_name(genl, m, &name) >= 0);
|
||||
assert_se(streq(name, CTRL_GENL_NAME));
|
||||
|
||||
Reference in New Issue
Block a user