summaryrefslogtreecommitdiff
path: root/tests/surveyctx.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/surveyctx.c')
-rw-r--r--tests/surveyctx.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/surveyctx.c b/tests/surveyctx.c
index f4d8e703..aa36eca1 100644
--- a/tests/surveyctx.c
+++ b/tests/surveyctx.c
@@ -92,7 +92,7 @@ TestMain("Surveyor concurrent contexts", {
atexit(nng_fini);
Convey("We can use Surveyor contexts concurrently", {
- nng_socket surv;
+ nng_socket surv = NNG_SOCKET_INITIALIZER;
So(nng_aio_alloc(&resp_state.aio, (void *) resp_cb, NULL) ==
0);
@@ -145,6 +145,14 @@ TestMain("Surveyor concurrent contexts", {
if ((rv = nng_ctx_open(&ctxs[i], surv)) != 0) {
break;
}
+ if (nng_ctx_id(ctxs[i]) < 0) {
+ Fail("Invalid context ID");
+ break;
+ }
+ if ((i > 0) &&
+ (nng_ctx_id(ctxs[i]) == nng_ctx_id(ctxs[i - 1]))) {
+ Fail("Context IDs not different");
+ }
}
So(rv == 0);
So(i == NCTX);