aboutsummaryrefslogtreecommitdiff
path: root/tests/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/device.c')
-rw-r--r--tests/device.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/tests/device.c b/tests/device.c
index 85a06fca..d3407eab 100644
--- a/tests/device.c
+++ b/tests/device.c
@@ -42,19 +42,15 @@ Main({
nng_socket dev2;
nng_socket end1;
nng_socket end2;
- int raw;
uint64_t tmo;
nng_msg * msg;
void * thr;
So(nng_pair1_open(&dev1) == 0);
So(nng_pair1_open(&dev2) == 0);
- raw = 1;
- So(nng_setopt(dev1, NNG_OPT_RAW, &raw, sizeof(raw)) ==
- 0);
- raw = 1;
- So(nng_setopt(dev2, NNG_OPT_RAW, &raw, sizeof(raw)) ==
- 0);
+
+ So(nng_setopt_int(dev1, nng_optid_raw, 1) == 0);
+ So(nng_setopt_int(dev2, nng_optid_raw, 1) == 0);
struct dev_data ddata;
ddata.s1 = dev1;
@@ -77,11 +73,10 @@ Main({
So(nng_dial(end2, addr2, NULL, 0) == 0);
tmo = 1000000;
- So(nng_setopt(end1, NNG_OPT_RCVTIMEO, &tmo,
- sizeof(tmo)) == 0);
- tmo = 1000000;
- So(nng_setopt(end2, NNG_OPT_RCVTIMEO, &tmo,
- sizeof(tmo)) == 0);
+ So(nng_setopt_usec(end1, nng_optid_recvtimeo, tmo) ==
+ 0);
+ So(nng_setopt_usec(end2, nng_optid_recvtimeo, tmo) ==
+ 0);
nng_usleep(100000);
Convey("Device can send and receive", {