aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-02-08 14:16:23 -0800
committerGarrett D'Amore <garrett@damore.org>2018-02-08 18:54:09 -0800
commitd606317f5c028fa8fba5d5384b0ccd90ffa4eab5 (patch)
tree3a6a70f6f2dc81b8722134752716f1c58bd1825c /tests
parente9efefca683b244b40f831c554d7c72a745b8372 (diff)
downloadnng-d606317f5c028fa8fba5d5384b0ccd90ffa4eab5.tar.gz
nng-d606317f5c028fa8fba5d5384b0ccd90ffa4eab5.tar.bz2
nng-d606317f5c028fa8fba5d5384b0ccd90ffa4eab5.zip
fixes #171 Refactor aio to use generic data fields
This addresses the use of the pipe special field, and eliminates it. The message APIs (recvmsg, sendmsg) need to be updated as well still, but I want to handle that as part of a separate issue. While here we fixed various compiler warnings, etc.
Diffstat (limited to 'tests')
-rw-r--r--tests/httpserver.c2
-rw-r--r--tests/resolv.c22
2 files changed, 12 insertions, 12 deletions
diff --git a/tests/httpserver.c b/tests/httpserver.c
index a62bae25..bbdd8423 100644
--- a/tests/httpserver.c
+++ b/tests/httpserver.c
@@ -200,7 +200,7 @@ TestMain("HTTP Server", {
nng_aio_wait(aio);
So(nng_aio_result(aio) == 0);
- h = nni_aio_get_output(aio, 0);
+ h = nng_aio_get_output(aio, 0);
So(h != NULL);
So(nng_http_req_alloc(&req, url) == 0);
So(nng_http_res_alloc(&res) == 0);
diff --git a/tests/resolv.c b/tests/resolv.c
index 607b3b11..9d83e6df 100644
--- a/tests/resolv.c
+++ b/tests/resolv.c
@@ -52,20 +52,20 @@ ip6tostr(void *addr)
// the normal assumptions on Linux do *not* hold true.
#if 0
Convey("Localhost IPv6 resolves", {
- nni_aio aio;
- memset(&aio, 0, sizeof (aio));
+ nng_aio *aio;
const char *str;
- nni_aio_init(&aio, NULL, NULL);
+ nng_sockaddr sa;
+ So(nng_aio_alloc(&aio, NULL, NULL) == 0);
+ So(nng_aio_set_input(aio, 0, &sa) == 0);
nni_plat_tcp_resolv("localhost", "80", NNG_AF_INET6, 1,
- &aio);
- nni_aio_wait(&aio);
- So(nni_aio_result(&aio) == 0);
- So(aio.a_naddrs == 1);
- So(aio.a_addrs[0].s_un.s_in6.sa_family == NNG_AF_INET6);
- So(aio.a_addrs[0].s_un.s_in6.sa_port == ntohs(80));
- str = ip6tostr(&aio.a_addrs[0].s_un.s_in6.sa_addr);
+ aio);
+ nng_aio_wait(aio);
+ So(nng_aio_result(aio) == 0);
+ So(sa.s_un.s_in6.sa_family == NNG_AF_INET6);
+ So(sa.s_un.s_in6.sa_port == ntohs(80));
+ str = ip6tostr(&sa.s_un.s_in6.sa_addr);
So(strcmp(str, "::1") == 0);
- nni_aio_fini(&aio);
+ nng_aio_free(aio);
}
#endif