mirror of
https://github.com/systemd/systemd.git
synced 2024-10-27 10:25:37 +03:00
test: add several assertions
Follow-up for 7947dbe322
.
Fixes CID#1508781 and CID#1508783.
This commit is contained in:
parent
796da645a0
commit
85ba4ca8f6
@ -54,7 +54,7 @@ static void test_fd(int fd, const void *buf, size_t n) {
|
||||
ssize_t m;
|
||||
|
||||
m = read(fd, rbuf, n + 1);
|
||||
|
||||
assert_se(m >= 0);
|
||||
assert_se(memcmp_nn(buf, n, rbuf, m) == 0);
|
||||
}
|
||||
|
||||
@ -75,6 +75,10 @@ static int method_passfd(Varlink *link, JsonVariant *parameters, VarlinkMethodFl
|
||||
|
||||
log_info("%i %i %i", xx, yy, zz);
|
||||
|
||||
assert_se(xx >= 0);
|
||||
assert_se(yy >= 0);
|
||||
assert_se(zz >= 0);
|
||||
|
||||
test_fd(xx, "foo", 3);
|
||||
test_fd(yy, "bar", 3);
|
||||
test_fd(zz, "quux", 4);
|
||||
|
Loading…
Reference in New Issue
Block a user