]> granicus.if.org Git - libevent/commitdiff
test/et/et: verify return codes
authorAzat Khuzhin <azat@libevent.org>
Mon, 28 Jan 2019 22:44:33 +0000 (01:44 +0300)
committerAzat Khuzhin <azat@libevent.org>
Tue, 29 Jan 2019 07:54:07 +0000 (10:54 +0300)
test/regress_et.c

index 07bcd4a583f96bb9d411337fa88e88ce43dcbd94..dc6e5b145e02325dca7f2064eeeee4754581c850 100644 (file)
@@ -95,7 +95,7 @@ test_edgetriggered(void *data_)
        called = was_et = 0;
 
        tt_int_op(send(pair[0], test, (int)strlen(test)+1, 0), >, 0);
-       shutdown(pair[0], EVUTIL_SHUT_WR);
+       tt_int_op(shutdown(pair[0], EVUTIL_SHUT_WR), ==, 0);
 
        supports_et = base_supports_et(base);
        TT_BLATHER(("Checking for edge-triggered events with %s, which should %s"
@@ -104,8 +104,8 @@ test_edgetriggered(void *data_)
 
        /* Initalize one event */
        ev = event_new(base, pair[1], EV_READ|EV_ET|EV_PERSIST, read_cb, &ev);
-
-       event_add(ev, NULL);
+       tt_assert(ev != NULL);
+       tt_int_op(event_add(ev, NULL), ==, 0);
 
        /* We're going to call the dispatch function twice.  The first invocation
         * will read a single byte from pair[1] in either case.  If we're edge
@@ -114,8 +114,8 @@ test_edgetriggered(void *data_)
         * do nothing.  If we're level triggered, the second invocation of
         * event_base_loop will also activate the event (because there's still
         * data to read). */
-       event_base_loop(base,EVLOOP_NONBLOCK|EVLOOP_ONCE);
-       event_base_loop(base,EVLOOP_NONBLOCK|EVLOOP_ONCE);
+       tt_int_op(event_base_loop(base,EVLOOP_NONBLOCK|EVLOOP_ONCE), ==, 0);
+       tt_int_op(event_base_loop(base,EVLOOP_NONBLOCK|EVLOOP_ONCE), ==, 0);
 
        if (supports_et) {
                tt_int_op(called, ==, 1);