diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-03-19 16:02:37 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-03-20 09:53:58 -0700 |
| commit | 9ca901c1b70b17d851426483d9f54611cfa8e395 (patch) | |
| tree | a26b11e16f505ccdc77b5ac6681e0f9de705ff20 /tests/sock.c | |
| parent | 9b886a9999247d87c9f6d389c3e65a4bd39be010 (diff) | |
| download | nng-9ca901c1b70b17d851426483d9f54611cfa8e395.tar.gz nng-9ca901c1b70b17d851426483d9f54611cfa8e395.tar.bz2 nng-9ca901c1b70b17d851426483d9f54611cfa8e395.zip | |
fixes #296 Typed options should validate option type
fixes #302 nng_dialer/listener/pipe_getopt_sockaddr desired
This adds plumbing to pass and check the type of options
all the way through.
NNG_ZT_OPT_ORBIT is type UINT64, but you can use the untyped form to
pass two of them if needed.
No typed access for retrieving strings yet. I think this should allocate
a pointer and copy that out, but that's for later.
Diffstat (limited to 'tests/sock.c')
| -rw-r--r-- | tests/sock.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/sock.c b/tests/sock.c index 8ff8b002..75d7c140 100644 --- a/tests/sock.c +++ b/tests/sock.c @@ -254,11 +254,11 @@ TestMain("Socket Operations", { Convey("Bogus raw fails", { // Bool type is 1 byte. So(nng_setopt_int(s1, NNG_OPT_RAW, 42) == - NNG_EINVAL); + NNG_EBADTYPE); So(nng_setopt_int(s1, NNG_OPT_RAW, -42) == - NNG_EINVAL); + NNG_EBADTYPE); So(nng_setopt_int(s1, NNG_OPT_RAW, 0) == - NNG_EINVAL); + NNG_EBADTYPE); So(nng_setopt(s1, NNG_OPT_RAW, "abcd", 4) == NNG_EINVAL); }); |
