diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-04-04 12:37:34 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-04-04 13:13:24 -0700 |
| commit | 45f455064b5704f3d5ed8ecf9f197a18fe72ee59 (patch) | |
| tree | 76a626029f3a5a818b113b7e4342efaf6220a03f /tests/device.c | |
| parent | 505a9bce029e51540739c853a6c9eef0ecfb2e90 (diff) | |
| download | nng-45f455064b5704f3d5ed8ecf9f197a18fe72ee59.tar.gz nng-45f455064b5704f3d5ed8ecf9f197a18fe72ee59.tar.bz2 nng-45f455064b5704f3d5ed8ecf9f197a18fe72ee59.zip | |
fixes #331 replace NNG_OPT_RAW option with constructor
This makes the raw mode something that is immutable, determined
at socket construction. This is an enabling change for the
separate context support coming soon.
As a result, this is an API breaking change for users of the raw
mode option (NNG_OPT_RAW). There aren't many of them out there.
Cooked mode is entirely unaffected.
There are changes to tests and documentation included.
Diffstat (limited to 'tests/device.c')
| -rw-r--r-- | tests/device.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/device.c b/tests/device.c index c177a2e5..b1f97123 100644 --- a/tests/device.c +++ b/tests/device.c @@ -42,6 +42,12 @@ Main({ const char *addr1 = "inproc://dev1"; const char *addr2 = "inproc://dev2"; + Convey("We cannot create cooked mode device", { + nng_socket s1; + So(nng_pair1_open(&s1) == 0); + Reset({ nng_close(s1); }); + So(nng_device(s1, s1) == NNG_EINVAL); + }); Convey("We can create a PAIRv1 device", { nng_socket dev1; nng_socket dev2; @@ -51,11 +57,8 @@ Main({ nng_msg * msg; nng_thread * thr; - So(nng_pair1_open(&dev1) == 0); - So(nng_pair1_open(&dev2) == 0); - - So(nng_setopt_bool(dev1, NNG_OPT_RAW, true) == 0); - So(nng_setopt_bool(dev2, NNG_OPT_RAW, true) == 0); + So(nng_pair1_open_raw(&dev1) == 0); + So(nng_pair1_open_raw(&dev2) == 0); struct dev_data ddata; ddata.s1 = dev1; |
