From 72440b0d815b1b79941f3f58a47ec4df1ba1e0fc Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 23 Dec 2016 01:50:31 -0800 Subject: Some tests around recvmsg (no senders yet). Fixes for some edge cases. --- tests/sock.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/sock.c b/tests/sock.c index 40949bfe..76942d31 100644 --- a/tests/sock.c +++ b/tests/sock.c @@ -27,5 +27,19 @@ TestMain("Socket Operations", { Convey("It's type is still proto", { So(nng_socket_protocol(sock) == NNG_PROTO_PAIR); }) + + Convey("Recv on with no pipes times out", { + nng_msg *msg = NULL; + rv = nng_recvmsg(sock, &msg, 0); + So(rv == NNG_ETIMEDOUT); + So(msg == NULL); + }) + + Convey("Recv nonblock with no pipes gives EAGAIN", { + nng_msg *msg = NULL; + rv = nng_recvmsg(sock, &msg, NNG_FLAG_NONBLOCK); + So(rv == NNG_EAGAIN); + So(msg == NULL); + }) }) }) \ No newline at end of file -- cgit v1.2.3-70-g09d2