tree-wide: do not work in assert()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 9 Nov 2017 09:38:02 +0000 (18:38 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 9 Nov 2017 09:38:02 +0000 (18:38 +0900)
Follow-up for 85e55d14dea66f5fe412ca8128487d5ea828b7b1.

src/libsystemd-network/test-ndisc-rs.c
src/libsystemd/sd-event/test-event.c

index c3e1a8e..95c9311 100644 (file)
@@ -202,7 +202,7 @@ int icmp6_bind_router_advertisement(int index) {
 
 int icmp6_receive(int fd, void *iov_base, size_t iov_len,
                   struct in6_addr *dst, triple_timestamp *timestamp) {
-        assert (read (fd, iov_base, iov_len) == (ssize_t)iov_len);
+        assert_se(read (fd, iov_base, iov_len) == (ssize_t)iov_len);
 
         if (timestamp)
                 triple_timestamp_get(timestamp);
index 1a581ae..9fa544a 100644 (file)
@@ -317,11 +317,11 @@ static void test_rtqueue(void) {
 
         assert_se(sd_event_source_set_priority(v, -10) >= 0);
 
-        assert(sigqueue(getpid_cached(), SIGRTMIN+2, (union sigval) { .sival_int = 1 }) >= 0);
-        assert(sigqueue(getpid_cached(), SIGRTMIN+3, (union sigval) { .sival_int = 2 }) >= 0);
-        assert(sigqueue(getpid_cached(), SIGUSR2, (union sigval) { .sival_int = 3 }) >= 0);
-        assert(sigqueue(getpid_cached(), SIGRTMIN+3, (union sigval) { .sival_int = 4 }) >= 0);
-        assert(sigqueue(getpid_cached(), SIGUSR2, (union sigval) { .sival_int = 5 }) >= 0);
+        assert_se(sigqueue(getpid_cached(), SIGRTMIN+2, (union sigval) { .sival_int = 1 }) >= 0);
+        assert_se(sigqueue(getpid_cached(), SIGRTMIN+3, (union sigval) { .sival_int = 2 }) >= 0);
+        assert_se(sigqueue(getpid_cached(), SIGUSR2, (union sigval) { .sival_int = 3 }) >= 0);
+        assert_se(sigqueue(getpid_cached(), SIGRTMIN+3, (union sigval) { .sival_int = 4 }) >= 0);
+        assert_se(sigqueue(getpid_cached(), SIGUSR2, (union sigval) { .sival_int = 5 }) >= 0);
 
         assert_se(n_rtqueue == 0);
         assert_se(last_rtqueue_sigval == 0);