aboutsummaryrefslogtreecommitdiff
path: root/tests/ws.c
diff options
context:
space:
mode:
authorEdward Rudd <urkle@outoforder.cc>2021-12-29 10:13:09 -0500
committerGitHub <noreply@github.com>2021-12-29 07:13:09 -0800
commit44fadb7042fbfdf75f20572c59e410f406bb82f4 (patch)
treeaa8380a652d7666f9f51732361494db79ec7114a /tests/ws.c
parent6cf5acb15147766eebdd6cf2731eacd8e0e31518 (diff)
downloadnng-44fadb7042fbfdf75f20572c59e410f406bb82f4.tar.gz
nng-44fadb7042fbfdf75f20572c59e410f406bb82f4.tar.bz2
nng-44fadb7042fbfdf75f20572c59e410f406bb82f4.zip
don't use deprecated functions in tests (#1560)
Diffstat (limited to 'tests/ws.c')
-rw-r--r--tests/ws.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/ws.c b/tests/ws.c
index 548521bd..c7f057f1 100644
--- a/tests/ws.c
+++ b/tests/ws.c
@@ -33,14 +33,14 @@ check_props_v4(nng_msg *msg)
p = nng_msg_get_pipe(msg);
So(nng_pipe_id(p) > 0);
- So(nng_pipe_getopt_sockaddr(p, NNG_OPT_LOCADDR, &la) == 0);
+ So(nng_pipe_get_addr(p, NNG_OPT_LOCADDR, &la) == 0);
So(la.s_family == NNG_AF_INET);
So(la.s_in.sa_port == htons(trantest_port - 1));
So(la.s_in.sa_port != 0);
So(la.s_in.sa_addr == htonl(0x7f000001));
z = sizeof(nng_sockaddr);
- So(nng_pipe_getopt(p, NNG_OPT_REMADDR, &ra, &z) == 0);
+ So(nng_pipe_get(p, NNG_OPT_REMADDR, &ra, &z) == 0);
So(z == sizeof(ra));
So(ra.s_family == NNG_AF_INET);
So(ra.s_in.sa_port != 0);
@@ -49,32 +49,32 @@ check_props_v4(nng_msg *msg)
// Request Header
z = 0;
buf = NULL;
- So(nng_pipe_getopt(p, NNG_OPT_WS_REQUEST_HEADERS, buf, &z) ==
+ So(nng_pipe_get(p, NNG_OPT_WS_REQUEST_HEADERS, buf, &z) ==
NNG_EINVAL);
So(z > 0);
len = z;
So((buf = nng_alloc(len)) != NULL);
- So(nng_pipe_getopt(p, NNG_OPT_WS_REQUEST_HEADERS, buf, &z) == 0);
+ So(nng_pipe_get(p, NNG_OPT_WS_REQUEST_HEADERS, buf, &z) == 0);
So(strstr(buf, "Sec-WebSocket-Key") != NULL);
So(z == len);
nng_free(buf, len);
- So(nng_pipe_getopt_string(p, NNG_OPT_WS_REQUEST_HEADERS, &buf) == 0);
+ So(nng_pipe_get_string(p, NNG_OPT_WS_REQUEST_HEADERS, &buf) == 0);
So(strlen(buf) == len - 1);
nng_strfree(buf);
// Response Header
z = 0;
buf = NULL;
- So(nng_pipe_getopt(p, NNG_OPT_WS_RESPONSE_HEADERS, buf, &z) ==
+ So(nng_pipe_get(p, NNG_OPT_WS_RESPONSE_HEADERS, buf, &z) ==
NNG_EINVAL);
So(z > 0);
len = z;
So((buf = nng_alloc(len)) != NULL);
- So(nng_pipe_getopt(p, NNG_OPT_WS_RESPONSE_HEADERS, buf, &z) == 0);
+ So(nng_pipe_get(p, NNG_OPT_WS_RESPONSE_HEADERS, buf, &z) == 0);
So(strstr(buf, "Sec-WebSocket-Accept") != NULL);
So(z == len);
nng_free(buf, len);
- So(nng_pipe_getopt_string(p, NNG_OPT_WS_RESPONSE_HEADERS, &buf) == 0);
+ So(nng_pipe_get_string(p, NNG_OPT_WS_RESPONSE_HEADERS, &buf) == 0);
So(strlen(buf) == len - 1);
nng_strfree(buf);