aboutsummaryrefslogtreecommitdiff
path: root/tests/surveyctx.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-04-30 21:41:40 -0700
committerGarrett D'Amore <garrett@damore.org>2018-05-01 12:27:19 -0700
commit4998964a435fe0f02a2d81b01fdb837214674e72 (patch)
treedc5fe29da0574fc1510ab6f9b23b54ffd68cd97b /tests/surveyctx.c
parent63bdb2c28bc185096e579d1922d57cb71ecaa36b (diff)
downloadnng-4998964a435fe0f02a2d81b01fdb837214674e72.tar.gz
nng-4998964a435fe0f02a2d81b01fdb837214674e72.tar.bz2
nng-4998964a435fe0f02a2d81b01fdb837214674e72.zip
fixes #381 Want comparators for various types
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);