From 1d016825757e8db88c674bc28272a26dcc29eee3 Mon Sep 17 00:00:00 2001 From: Laurent Ghigonis Date: Sun, 2 Dec 2012 15:35:52 +0100 Subject: fix sendrecv unit test by using send buffer flush functions --- libglouglou/tests/sendrecv.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libglouglou/tests/sendrecv.c b/libglouglou/tests/sendrecv.c index ff848f0..cbfb402 100644 --- a/libglouglou/tests/sendrecv.c +++ b/libglouglou/tests/sendrecv.c @@ -49,17 +49,19 @@ main(void) pkt.type = PACKET_NEWCONN; gg_server_send(srv, &pkt, NULL); - event_base_loop(ev_base, EVLOOP_ONCE); - + gg_server_send_flush(srv, NULL); gg_client_send(cli, &pkt); - event_base_loop(ev_base, EVLOOP_ONCE); + gg_client_send_flush(cli); + + event_base_loop(ev_base, EVLOOP_NONBLOCK); + + gg_client_disconnect(cli); + gg_server_stop(srv); if (srv_recv_ok == 0) printf("error: srv_recv_ok == 0\n"); if (cli_recv_ok == 0) printf("error: cli_recv_ok == 0\n"); - gg_client_disconnect(cli); - return (!srv_recv_ok || !cli_recv_ok); } -- cgit v1.2.3-59-g8ed1b