diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2011-03-24 10:03:49 +0100 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-03-24 10:03:49 +0100 |
commit | 7d87db05290e3fd742f381b6f419eb69518ca8cf (patch) | |
tree | 6eab93230f18a4bcd24286113b10ee357820f83b /tests/test_pair_inproc.cpp | |
parent | 941be8d2175332cb720f390f93d07a0870db8824 (diff) |
Auto-tests modified to use C API instead of C++ binding
As a side effect, broker HWM test was fixed.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'tests/test_pair_inproc.cpp')
-rw-r--r-- | tests/test_pair_inproc.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/tests/test_pair_inproc.cpp b/tests/test_pair_inproc.cpp index 5736674..17c37e0 100644 --- a/tests/test_pair_inproc.cpp +++ b/tests/test_pair_inproc.cpp @@ -18,14 +18,34 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <assert.h> #include "testutil.hpp" -using namespace std; -using namespace zmqtestutil; - int main (int argc, char *argv []) { - const char *transport = "inproc://tester" ; - basic_tests (transport, ZMQ_PAIR, ZMQ_PAIR); + void *ctx = zmq_init (1); + assert (ctx); + + void *sb = zmq_socket (ctx, ZMQ_PAIR); + assert (sb); + int rc = zmq_bind (sb, "inproc://a"); + assert (rc == 0); + + void *sc = zmq_socket (ctx, ZMQ_PAIR); + assert (sc); + rc = zmq_connect (sc, "inproc://a"); + assert (rc == 0); + + bounce (sb, sc); + + rc = zmq_close (sc); + assert (rc == 0); + + rc = zmq_close (sb); + assert (rc == 0); + + rc = zmq_term (ctx); + assert (rc == 0); + return 0 ; } |