diff options
| author | Garrett D'Amore <garrett@damore.org> | 2019-12-21 10:20:55 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2019-12-24 00:34:29 -0800 |
| commit | 3f7561417bec08226bcfeb107d94be0dbf71b09e (patch) | |
| tree | 409901d7929df5eeb7295ab971b34c2e1040f507 /tests/stubs.h | |
| parent | 9e7a4aff25139703bbc375b6dda263d6d42341a8 (diff) | |
| download | nng-3f7561417bec08226bcfeb107d94be0dbf71b09e.tar.gz nng-3f7561417bec08226bcfeb107d94be0dbf71b09e.tar.bz2 nng-3f7561417bec08226bcfeb107d94be0dbf71b09e.zip | |
fixes #1032 Figure out Darwin bustedness
fixes #1035 Convey is awkward -- consider acutest.h
This represents a rather large effort towards cleaning up our
testing and optional configuration infrastructure.
A separate test library is built by default, which is static, and
includes some useful utilities design to make it easier to write
shorter and more robust (not timing dependent) tests. This also means
that we can cover pretty nearly all the tests (protocols etc.) in
every case, even if the shipped image will be minimized.
Subsystems which are optional can now use a few new macros to configure
what they need see nng_sources_if, nng_headers_if, and nng_defines_if.
This goes a long way to making the distributed CMakefiles a lot simpler.
Additionally, tests for different parts of the tree can now be located
outside of the tests/ tree, so that they can be placed next to the code
that they are testing.
Beyond the enabling work, the work has only begun, but these changes
have resolved the most often failing tests for Darwin in the cloud.
Diffstat (limited to 'tests/stubs.h')
| -rw-r--r-- | tests/stubs.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/tests/stubs.h b/tests/stubs.h index a8fa59e9..f178a9bc 100644 --- a/tests/stubs.h +++ b/tests/stubs.h @@ -72,7 +72,11 @@ fdready(int fd) case 1: return (true); default: +#ifdef CONVEY_H ConveyError("BAD POLL RETURN!"); +#elif defined(TEST_CHECK) + TEST_ASSERT(0); +#endif return (false); } } @@ -81,7 +85,9 @@ int nosocket(nng_socket *s) { (void) s; // not used +#ifdef CONVEY_H ConveySkip("Protocol unconfigured"); +#endif return (NNG_ENOTSUP); } @@ -94,14 +100,6 @@ test_htons(uint16_t in) return (in); } -#ifndef NNG_HAVE_REQ0 -#define nng_req0_open nosocket -#endif - -#ifndef NNG_HAVE_REP0 -#define nng_rep0_open nosocket -#endif - #ifndef NNG_HAVE_PUB0 #define nng_pub0_open nosocket #endif @@ -114,10 +112,6 @@ test_htons(uint16_t in) #define nng_pair0_open nosocket #endif -#ifndef NNG_HAVE_PAIR1 -#define nng_pair1_open nosocket -#endif - #ifndef NNG_HAVE_PUSH0 #define nng_push0_open nosocket #endif |
