diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-03 00:51:15 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-03 00:58:37 -0700 |
| commit | b3fc8a44119d7ab90366a1b92a5e1327ebcb8145 (patch) | |
| tree | 994c0199184fdea3d56eeb61b252e10733588947 /src/sp/protocol/pubsub0/xsub_test.c | |
| parent | 02ec0b55cbee5de4d0fd688ce0ebddf08178dc98 (diff) | |
| download | nng-b3fc8a44119d7ab90366a1b92a5e1327ebcb8145.tar.gz nng-b3fc8a44119d7ab90366a1b92a5e1327ebcb8145.tar.bz2 nng-b3fc8a44119d7ab90366a1b92a5e1327ebcb8145.zip | |
Replace NNG_OPT_SUB_SUBSCRIBE/UNSUBSCRIBE with functions.
The main purpose is to eliminate the NNI_TYPE_OPAQUE options,
by putting these into their own first class, protocol-specific, functions.
Diffstat (limited to 'src/sp/protocol/pubsub0/xsub_test.c')
| -rw-r--r-- | src/sp/protocol/pubsub0/xsub_test.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/sp/protocol/pubsub0/xsub_test.c b/src/sp/protocol/pubsub0/xsub_test.c index eec73505..fdbc5632 100644 --- a/src/sp/protocol/pubsub0/xsub_test.c +++ b/src/sp/protocol/pubsub0/xsub_test.c @@ -7,7 +7,8 @@ // found online at https://opensource.org/licenses/MIT. // -#include "nng/nng.h" +#include <nng/nng.h> +#include <nng/protocol/pubsub0/sub.h> #include <nuts.h> static void @@ -257,22 +258,20 @@ test_xsub_recv_buf_option(void) static void test_xsub_subscribe_option(void) { - nng_socket sub; - const char *opt = NNG_OPT_SUB_SUBSCRIBE; + nng_socket sub; NUTS_PASS(nng_sub0_open_raw(&sub)); - NUTS_FAIL(nng_socket_set(sub, opt, "abc", 3), NNG_ENOTSUP); + NUTS_FAIL(nng_sub0_socket_subscribe(sub, "abc", 3), NNG_ENOTSUP); NUTS_CLOSE(sub); } static void test_xsub_unsubscribe_option(void) { - nng_socket sub; - const char *opt = NNG_OPT_SUB_UNSUBSCRIBE; + nng_socket sub; NUTS_PASS(nng_sub0_open_raw(&sub)); - NUTS_FAIL(nng_socket_set(sub, opt, "abc", 3), NNG_ENOTSUP); + NUTS_FAIL(nng_sub0_socket_unsubscribe(sub, "abc", 3), NNG_ENOTSUP); NUTS_CLOSE(sub); } |
