Commit Graph

8 Commits

Author SHA1 Message Date
Alberto Invernizzi
b6420aa22f fix header 2021-06-30 07:14:13 +02:00
Gudmundur Adalsteinsson
e9c5546e04 Add CHECK_THROWS_ZMQ_ERROR and check error codes 2020-05-24 22:16:55 +00:00
Gudmundur Adalsteinsson
a3e5b54c3c
Problem: Socket options lack type-safety (#393)
Solution: Implement a type for each socket option.

Each option has an associated type, therefore they
can't be simply defined as an enum class.

Use new sockopt getter in test util

Add socket option get function for strings and tests
2020-03-24 09:33:50 +01:00
Pawel Kurdybacha
ae15964907 Problem: Dependency on googletest framework
Currently cppzmq as relatively simple and header only library depends on rather
complex unit test framework googletest.
Current issues:
- Googletest requires downloading and building it every time on travis
as cache support is limited there
- Googletest build is signifficant with comparison to cppzmq unittests
total runtime

Solution: Port existing tests to Catch - header only C++ framework and
gain ~20% build speed up on travis.

Why Catch?
It is well know C++ header only testing framework. It works well, it is
being kept up to date and maintainers seem to pay attention to
community's comments and issues.
We can not use Catch2 currently as we still support pre-C++11 compilers.
2018-10-17 15:22:07 +01:00
Pawel Kurdybacha
57454dff4b Problem: monitor_t tests not event driven
Solution: instead of waiting for fixed amount of time for events, react
as soon as events are triggered.

- Total running time of unittest reduced 10x (from ~300ms to 30ms).
- Reduced code duplication by reusing testutil's constructs.
2018-07-05 00:23:31 +01:00
Pawel Kurdybacha
099bcfc4a4 Problem: cppzmq build broken with C++11 compiler and git cloned repo.
Default build, ./ci_build.sh without any arguments, which causes to run
with draft disabled, does not work properly for git cloned repository and
C++11 compiler.

Two issues:
1. For git cloned repository ENABLE_DRAFTS is ON by default but libzmq
compiled build without drafts .Travis did not catch that because default build
runs on non C++11 compiler.
2. testutil.hpp does not build because of missing draft guards.

Solution 1: Remove check for presence of .git for enabling draft API as it
is confusing to use with ENABLE_DRAFTS flag and there should be only one
explicit way to enable draft build.

Solution 2: add missing draft guards in testutil.hpp for server/client
socket in use there.

Solution 3: add extra Travis build covering C++11 compiler and non
draft enabled build.
2018-05-20 07:53:56 +01:00
Pawel Kurdybacha
ff3c221516 Problem: whitespace style too restrictive.
For header only library like cppzmq, whitespace style inherited from
libzmq is too restrictive.

Solution: relaxing whitespace before parens from always to in control
statements only, increased max column width from 80 to 85 and removing
requirement of whitespace after template keyword.
2018-05-12 17:28:28 +01:00
Simon Giesecke
762b0131e8 Problem: no tests for poller_t
Solution: add tests
2018-05-11 12:31:17 +02:00