diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-12-26 16:41:13 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-12-26 18:21:22 -0800 |
| commit | eaa1b679271b4d07507b8ba4a80ee7bc0448da67 (patch) | |
| tree | 881b8c876ca891ccef450685833e4ad877cd9569 /src/sp/protocol/bus0/bus_test.c | |
| parent | 458b414401d897d905f5313ec80594d8b8b95a48 (diff) | |
| download | nng-eaa1b679271b4d07507b8ba4a80ee7bc0448da67.tar.gz nng-eaa1b679271b4d07507b8ba4a80ee7bc0448da67.tar.bz2 nng-eaa1b679271b4d07507b8ba4a80ee7bc0448da67.zip | |
bus: use nni_aio_start
The test needed a change to ensure that we do not trigger a debugging
check (you cannot submit another job on an aio that you've been notified
is stopped via NNG_ESTOPPED.)
Diffstat (limited to 'src/sp/protocol/bus0/bus_test.c')
| -rw-r--r-- | src/sp/protocol/bus0/bus_test.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/src/sp/protocol/bus0/bus_test.c b/src/sp/protocol/bus0/bus_test.c index c9952d81..94ba8329 100644 --- a/src/sp/protocol/bus0/bus_test.c +++ b/src/sp/protocol/bus0/bus_test.c @@ -179,24 +179,28 @@ static void test_bus_aio_stopped(void) { nng_socket s1; - nng_aio *aio; + nng_aio *aio1; + nng_aio *aio2; nng_msg *msg; NUTS_PASS(nng_bus0_open(&s1)); NUTS_PASS(nng_msg_alloc(&msg, 0)); - NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL)); - nng_aio_stop(aio); - - nng_recv_aio(s1, aio); - nng_aio_wait(aio); - NUTS_FAIL(nng_aio_result(aio), NNG_ESTOPPED); - - nng_aio_set_msg(aio, msg); - nng_send_aio(s1, aio); - nng_aio_wait(aio); - NUTS_FAIL(nng_aio_result(aio), NNG_ESTOPPED); - - nng_aio_free(aio); + NUTS_PASS(nng_aio_alloc(&aio1, NULL, NULL)); + NUTS_PASS(nng_aio_alloc(&aio2, NULL, NULL)); + nng_aio_stop(aio1); + nng_aio_stop(aio2); + + nng_recv_aio(s1, aio1); + nng_aio_wait(aio1); + NUTS_FAIL(nng_aio_result(aio1), NNG_ESTOPPED); + + nng_aio_set_msg(aio2, msg); + nng_send_aio(s1, aio2); + nng_aio_wait(aio2); + NUTS_FAIL(nng_aio_result(aio2), NNG_ESTOPPED); + + nng_aio_free(aio1); + nng_aio_free(aio2); nng_msg_free(msg); NUTS_CLOSE(s1); } |
