summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network/test-ipv4ll.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-network/test-ipv4ll.c')
-rw-r--r--src/libsystemd-network/test-ipv4ll.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/libsystemd-network/test-ipv4ll.c b/src/libsystemd-network/test-ipv4ll.c
index bb42930..e7dbd7f 100644
--- a/src/libsystemd-network/test-ipv4ll.c
+++ b/src/libsystemd-network/test-ipv4ll.c
@@ -85,33 +85,34 @@ static void test_public_api_setters(sd_event *e) {
assert_se(sd_ipv4ll_new(&ll) == 0);
assert_se(ll);
- assert_se(sd_ipv4ll_attach_event(NULL, NULL, 0) == -EINVAL);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_attach_event(NULL, NULL, 0) == -EINVAL);
assert_se(sd_ipv4ll_attach_event(ll, e, 0) == 0);
- assert_se(sd_ipv4ll_attach_event(ll, e, 0) == -EBUSY);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_attach_event(ll, e, 0) == -EBUSY);
- assert_se(sd_ipv4ll_set_callback(NULL, NULL, NULL) == -EINVAL);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_set_callback(NULL, NULL, NULL) == -EINVAL);
assert_se(sd_ipv4ll_set_callback(ll, NULL, NULL) == 0);
- assert_se(sd_ipv4ll_set_address(ll, &address) == -EINVAL);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_set_address(ll, &address) == -EINVAL);
address.s_addr |= htobe32(169U << 24 | 254U << 16);
- assert_se(sd_ipv4ll_set_address(ll, &address) == -EINVAL);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_set_address(ll, &address) == -EINVAL);
address.s_addr |= htobe32(0x00FF);
- assert_se(sd_ipv4ll_set_address(ll, &address) == -EINVAL);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_set_address(ll, &address) == -EINVAL);
address.s_addr |= htobe32(0xF000);
assert_se(sd_ipv4ll_set_address(ll, &address) == 0);
address.s_addr |= htobe32(0x0F00);
- assert_se(sd_ipv4ll_set_address(ll, &address) == -EINVAL);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_set_address(ll, &address) == -EINVAL);
- assert_se(sd_ipv4ll_set_address_seed(NULL, seed) == -EINVAL);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_set_address_seed(NULL, seed) == -EINVAL);
assert_se(sd_ipv4ll_set_address_seed(ll, seed) == 0);
- assert_se(sd_ipv4ll_set_mac(NULL, NULL) == -EINVAL);
- assert_se(sd_ipv4ll_set_mac(ll, NULL) == -EINVAL);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_set_mac(NULL, NULL) == -EINVAL);
+
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_set_mac(ll, NULL) == -EINVAL);
assert_se(sd_ipv4ll_set_mac(ll, &mac_addr) == 0);
- assert_se(sd_ipv4ll_set_ifindex(NULL, -1) == -EINVAL);
- assert_se(sd_ipv4ll_set_ifindex(ll, -1) == -EINVAL);
- assert_se(sd_ipv4ll_set_ifindex(ll, -99) == -EINVAL);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_set_ifindex(NULL, -1) == -EINVAL);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_set_ifindex(ll, -1) == -EINVAL);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_set_ifindex(ll, -99) == -EINVAL);
assert_se(sd_ipv4ll_set_ifindex(ll, 1) == 0);
assert_se(sd_ipv4ll_ref(ll) == ll);
@@ -134,17 +135,17 @@ static void test_basic_request(sd_event *e, const struct in_addr *start_address)
assert_se(sd_ipv4ll_new(&ll) == 0);
if (in4_addr_is_set(start_address))
assert_se(sd_ipv4ll_set_address(ll, start_address) >= 0);
- assert_se(sd_ipv4ll_start(ll) == -EINVAL);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_start(ll) == -EINVAL);
assert_se(sd_ipv4ll_attach_event(ll, e, 0) == 0);
- assert_se(sd_ipv4ll_start(ll) == -EINVAL);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_start(ll) == -EINVAL);
assert_se(sd_ipv4ll_set_mac(ll, &mac_addr) == 0);
- assert_se(sd_ipv4ll_start(ll) == -EINVAL);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_start(ll) == -EINVAL);
assert_se(sd_ipv4ll_set_callback(ll, basic_request_handler,
basic_request_handler_userdata) == 0);
- assert_se(sd_ipv4ll_start(ll) == -EINVAL);
+ ASSERT_RETURN_EXPECTED_SE(sd_ipv4ll_start(ll) == -EINVAL);
assert_se(sd_ipv4ll_set_ifindex(ll, 1) == 0);
assert_se(sd_ipv4ll_start(ll) == 1);