diff options
author | Laurent Ghigonis <laurent@p1sec.com> | 2012-12-02 15:35:52 +0100 |
---|---|---|
committer | Laurent Ghigonis <laurent@p1sec.com> | 2012-12-02 15:35:52 +0100 |
commit | 1d016825757e8db88c674bc28272a26dcc29eee3 (patch) | |
tree | 694b9de3fb7e602a6f44956068a786d4718a426f | |
parent | add functions to flush send buffers (diff) | |
download | glouglou-1d016825757e8db88c674bc28272a26dcc29eee3.tar.xz glouglou-1d016825757e8db88c674bc28272a26dcc29eee3.zip |
fix sendrecv unit test by using send buffer flush functions
-rw-r--r-- | libglouglou/tests/sendrecv.c | 12 |
1 files 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); } |