aboutsummaryrefslogtreecommitdiff
path: root/tests/device.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-04-23 07:39:59 -0700
committerGarrett D'Amore <garrett@damore.org>2024-04-23 07:39:59 -0700
commit01817988f4631bdd8ee5cec9c6b69039712a93fe (patch)
treec8c4259671fbb586a466a8c5d623fc8c183f8927 /tests/device.c
parentff00eac2401732e9efb6170ffb90100dcf6332a7 (diff)
downloadnng-01817988f4631bdd8ee5cec9c6b69039712a93fe.tar.gz
nng-01817988f4631bdd8ee5cec9c6b69039712a93fe.tar.bz2
nng-01817988f4631bdd8ee5cec9c6b69039712a93fe.zip
Move the rest of the functionality from platform.h into core.
This also deprecates supplemental/util/platform.h.
Diffstat (limited to 'tests/device.c')
-rw-r--r--tests/device.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/device.c b/tests/device.c
index 77da41b6..53f51ba3 100644
--- a/tests/device.c
+++ b/tests/device.c
@@ -1,5 +1,5 @@
//
-// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -12,7 +12,6 @@
#include <nng/nng.h>
#include <nng/protocol/pair1/pair.h>
-#include <nng/supplemental/util/platform.h>
#include "convey.h"
#include "stubs.h"
@@ -38,7 +37,6 @@ dodev(void *arg)
#define SECOND(x) ((x) *1000)
Main({
-
Test("PAIRv1 device", {
const char *addr1 = "inproc://dev1";
const char *addr2 = "inproc://dev2";
@@ -55,8 +53,8 @@ Main({
nng_socket end1;
nng_socket end2;
nng_duration tmo;
- nng_msg * msg;
- nng_thread * thr;
+ nng_msg *msg;
+ nng_thread *thr;
So(nng_pair1_open_raw(&dev1) == 0);
So(nng_pair1_open_raw(&dev2) == 0);
@@ -82,12 +80,13 @@ Main({
So(nng_dial(end2, addr2, NULL, 0) == 0);
tmo = SECOND(1);
- So(nng_socket_set_ms(end1, NNG_OPT_RECVTIMEO, tmo) == 0);
- So(nng_socket_set_ms(end2, NNG_OPT_RECVTIMEO, tmo) == 0);
+ So(nng_socket_set_ms(end1, NNG_OPT_RECVTIMEO, tmo) ==
+ 0);
+ So(nng_socket_set_ms(end2, NNG_OPT_RECVTIMEO, tmo) ==
+ 0);
nng_msleep(100);
Convey("Device can send and receive", {
-
So(nng_msg_alloc(&msg, 0) == 0);
APPENDSTR(msg, "ALPHA");
So(nng_sendmsg(end1, msg, 0) == 0);