aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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