summaryrefslogtreecommitdiff
path: root/tests/test_reqrep_tcp.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-03-24 10:03:49 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-03-24 10:03:49 +0100
commit7d87db05290e3fd742f381b6f419eb69518ca8cf (patch)
tree6eab93230f18a4bcd24286113b10ee357820f83b /tests/test_reqrep_tcp.cpp
parent941be8d2175332cb720f390f93d07a0870db8824 (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_reqrep_tcp.cpp')
-rw-r--r--tests/test_reqrep_tcp.cpp30
1 files changed, 25 insertions, 5 deletions
diff --git a/tests/test_reqrep_tcp.cpp b/tests/test_reqrep_tcp.cpp
index 9f1f3e6..9e00975 100644
--- a/tests/test_reqrep_tcp.cpp
+++ b/tests/test_reqrep_tcp.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 = "tcp://127.0.0.1:5555" ;
- basic_tests (transport, ZMQ_REQ, ZMQ_REP);
+ void *ctx = zmq_init (1);
+ assert (ctx);
+
+ void *sb = zmq_socket (ctx, ZMQ_REP);
+ assert (sb);
+ int rc = zmq_bind (sb, "tcp://127.0.0.1:5555");
+ assert (rc == 0);
+
+ void *sc = zmq_socket (ctx, ZMQ_REQ);
+ assert (sc);
+ rc = zmq_connect (sc, "tcp://127.0.0.1:5555");
+ 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 ;
}