aboutsummaryrefslogtreecommitdiff
path: root/tests/sock.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2016-12-23 01:50:31 -0800
committerGarrett D'Amore <garrett@damore.org>2016-12-23 01:50:31 -0800
commit72440b0d815b1b79941f3f58a47ec4df1ba1e0fc (patch)
tree6494c69b89f36ab75976fc7acaec68a4d4f0d1bf /tests/sock.c
parent07478f02caaebf74c11b366d048ba696a8678fec (diff)
downloadnng-72440b0d815b1b79941f3f58a47ec4df1ba1e0fc.tar.gz
nng-72440b0d815b1b79941f3f58a47ec4df1ba1e0fc.tar.bz2
nng-72440b0d815b1b79941f3f58a47ec4df1ba1e0fc.zip
Some tests around recvmsg (no senders yet). Fixes for some edge cases.
Diffstat (limited to 'tests/sock.c')
-rw-r--r--tests/sock.c14
1 files changed, 14 insertions, 0 deletions
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