summaryrefslogtreecommitdiffstats
path: root/src/gtest
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-08-12 17:50:34 +0300
committerimarom <imarom@cisco.com>2015-08-12 17:50:34 +0300
commit877eba6c21febeafd1122b60768c5ca5f4a69945 (patch)
tree532e58e849eb184e8a77c3907f63ab6eb1503c3a /src/gtest
parent218b12788ace0683918dc335639cdd92c4e33ab5 (diff)
just a checkpoint - not stable
Diffstat (limited to 'src/gtest')
-rw-r--r--src/gtest/rpc_test.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gtest/rpc_test.cpp b/src/gtest/rpc_test.cpp
index 7f78efd0..59b4b189 100644
--- a/src/gtest/rpc_test.cpp
+++ b/src/gtest/rpc_test.cpp
@@ -47,19 +47,19 @@ TEST_F(RpcTest, basic_rpc_test) {
zmq_connect (requester, "tcp://localhost:5050");
- char buffer[50];
+ char buffer[250];
Json::Value request;
int id = 1;
request["jsonrpc"] = "2.0";
- request["method"] = "test_func";
+ //request["method"] = "test_func";
Json::Value &params = request["params"];
params["num"] = 12;
params["msg"] = "hello, method test_func";
- for (int request_nbr = 0; request_nbr != 10; request_nbr++) {
- request["id"] = id++;
+ for (int request_nbr = 0; request_nbr != 1; request_nbr++) {
+ //request["id"] = "itay_id";
std::stringstream ss;
ss << request;
@@ -68,8 +68,9 @@ TEST_F(RpcTest, basic_rpc_test) {
zmq_send (requester, ss.str().c_str(), ss.str().size(), 0);
- zmq_recv (requester, buffer, 50, 0);
- printf ("Received ACK\n");
+ int len = zmq_recv (requester, buffer, 250, 0);
+ std::string resp(buffer, buffer + len);
+ std::cout << "Got: " << resp << "\n";
}
zmq_close (requester);
zmq_ctx_destroy (context);