diff options
| author | Garrett D'Amore <garrett@damore.org> | 2020-05-23 16:41:26 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2020-05-23 17:29:54 -0700 |
| commit | 20fd6f2b50b804deb9edf7a5ee82a32d8835138d (patch) | |
| tree | a3a1d3fa4c19365fb277f006d70a344406ced061 /tests/testutil.h | |
| parent | 01c087818a31519922b2c21d87c9ac3b35dbfb36 (diff) | |
| download | nng-20fd6f2b50b804deb9edf7a5ee82a32d8835138d.tar.gz nng-20fd6f2b50b804deb9edf7a5ee82a32d8835138d.tar.bz2 nng-20fd6f2b50b804deb9edf7a5ee82a32d8835138d.zip | |
Tests for sending large amounts of data over NNG TLS streams.
This also starts the test framework NNG streams, so that we can
test those more directly.
Diffstat (limited to 'tests/testutil.h')
| -rw-r--r-- | tests/testutil.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/testutil.h b/tests/testutil.h index a297b603..15028106 100644 --- a/tests/testutil.h +++ b/tests/testutil.h @@ -56,6 +56,24 @@ extern int testutil_marry(nng_socket, nng_socket); extern int testutil_marry_ex( nng_socket, nng_socket, const char *, nng_pipe *, nng_pipe *); +// testutil_stream_send_start and testutil_stream_recv_start are used +// to initiate transfers asynchronously. They return a token which can +// be used with testutil_stream_send_wait and testutil_stream_recv_wait. +// Those wait functions will return the result of operation (0 on +// success, an NNG error number otherwise.) +extern void *testutil_stream_send_start(nng_stream *, void *, size_t); +extern void *testutil_stream_recv_start(nng_stream *, void *, size_t); +extern int testutil_stream_send_wait(void *); +extern int testutil_stream_recv_wait(void *); + +// These are TLS certificates. The client and server are signed with the +// root. The server uses CN 127.0.0.1. Other details are bogus, but +// designed to prevent accidental use elsewhere. +extern const char *testutil_server_key; +extern const char *testutil_server_crt; +extern const char *testutil_client_key; +extern const char *testutil_client_crt; + // TEST_NNG_PASS tests for NNG success. It reports the failure if it // did not. #define TEST_NNG_PASS(cond) \ |
