Solution: remove temporarily until proper message limits have been
implemented, then a more granular test case can be added without
such high requirements which are problematic in embedded environment,
build systems, VMs and CI systems
Solution: Add precompiled flags to CMakeList.txt for faster compiles
+ bonus - removed compilation warning on Windows by adding
add_definitions (-D_WINSOCK_DEPRECATED_NO_WARNINGS)
Solution: Modified CMakelist.txt to build correctly for Windows
- corrected CMake required version to make sure it builds in
Ubuntu 14.04 LTS with no warnings.
Solution: add msleep (SETTLE_TIME) to test_immediate, test_spec_rep
and test_spec_router after the sockets are created and connected to
avoid failing when running in slower environment like through
Valgrind in underpowered VMs.
Solution: use msleep (SETTLE_TIME) everywhere when waiting for the
connections/sockets to be settled instead of a variety of patterns
and functions to make tests more coherent.
There were numerous small issues with test cases:
- some lacked the right source file header
- some were not portable at all
- some were using internal libzmq APIs (headers)
Solution: fixed and cleaned up.
There were numerous small issues with test cases:
- some lacked the right source file header
- some were not portable at all
- some were using internal libzmq APIs (headers)
Solution: fixed and cleaned up.
Solution: it's a lot of work to define the tests in project.gyp
so I did this using gsl to generate the JSON, from a small XML
list of the test cases.
To keep this, and the hundreds of .mk files, away from the root
directory, I've moved the gyp files into builds/gyp, where you
would run them.
It all seems to work now. Next up, OS/X and Windows :)
It's unclear which we need and in the source code, conditional code
treats tweetnacl as a subclass of libsodium, which is inaccurate.
Solution: redesign the configure/cmake API for this:
* tweetnacl is present by default and cannot be enabled
* libsodium can be enabled using --with-libsodium, which replaces
the built-in tweetnacl
* CURVE encryption can be disabled entirely using --enable-curve=no
The macros we define in platform.hpp are:
ZMQ_HAVE_CURVE 1 // When CURVE is enabled
HAVE_LIBSODIUM 1 // When we are using libsodium
HAVE_TWEETNACL 1 // When we're using tweetnacl (default)
As of this patch, the default build of libzmq always has CURVE
security, and always uses tweetnacl.
And I'm on a reasonably sized laptop. I think allocating INT_MAX
memory is dangerous in a test case.
Solution: expose this as a context option. I've used ZMQ_MAX_MSGSZ
and documented it and implemented the API. However I don't know how
to get the parent context for a socket, so the code in zmq.cpp is
still unfinished.
Solution: be more explicit in the code, and in the zmq_recv man
page (which is the most unobvious case). Assert if length is not
zero and buffer is nonetheless null.
It is poor style for test cases to use the internal API (i.e.
libzmq classes or header files), as this code serves the purpose
of teaching developers how to use the library (it doesn't do this
very well, it's an ambition).
Also, including headers in src/ creates problems when compiling.
Solution: remove use of src/macros.hpp.
Solution: parse the value set by the ZMQ_PRE_ALLOCATED_FD sockopt
when creating a new TCP socket and use it if valid.
Add new tests/test_pre_allocated_fd_tcp.cpp unit test.
Solution: parse the value set by the ZMQ_PRE_ALLOCATED_FD sockopt
when creating a new IPC socket and use it if valid.
Add new tests/test_pre_allocated_fd_ipc.cpp unit test.
Solution: add new [set|get]sockopt ZMQ_PRE_ALLOCATED_FD to allow
users to let ZMQ use a pre-allocated file descriptor instead of
allocating a new one. Update [set|get]sockopt documentation and
test accordingly.
The main use case for this feature is a socket-activated systemd
service. For more information about this feature see:
http://0pointer.de/blog/projects/socket-activation.html
This commit addresses the following warnings reported on gcc 5.2.1. In
the future, this will help reduce the "noise" and help catch warnings
revealing a serious problem.
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
/path/to/libzmq/tests/test_stream_exceeds_buffer.cpp: In function ‘int main()’:
/path/to/libzmq/tests/test_stream_exceeds_buffer.cpp:19:9: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
int rc = setsockopt(server_sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable));
^
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---