test: add several assertions

Follow-up for 7947dbe322.

Fixes CID#1508781 and CID#1508783.
This commit is contained in:
Yu Watanabe 2023-04-13 14:29:51 +09:00 committed by Luca Boccassi
parent 796da645a0
commit 85ba4ca8f6

View file

@ -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);