summaryrefslogtreecommitdiffstats
path: root/src/gtest
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-08-17 11:32:59 +0300
committerimarom <imarom@cisco.com>2015-08-17 11:32:59 +0300
commit396b54ea57308890c29c1d9746f0cce32d990cf8 (patch)
tree69e09f2636538f45e513bae4595790866e56adc8 /src/gtest
parentffb38cc6153c7938f02d9eb524bf3e58f0d4336b (diff)
draft
Diffstat (limited to 'src/gtest')
-rw-r--r--src/gtest/rpc_test.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gtest/rpc_test.cpp b/src/gtest/rpc_test.cpp
index 8cee0859..c616b7a6 100644
--- a/src/gtest/rpc_test.cpp
+++ b/src/gtest/rpc_test.cpp
@@ -187,8 +187,8 @@ TEST_F(RpcTest, batch_rpc_test) {
{\"jsonrpc\": \"2.0\", \"method\": \"test_rpc_sub\", \"params\": {\"x\": 22, \"y\": 17}, \"id\": \"2\"}, \
{\"jsonrpc\": \"2.0\", \"method\": \"test_rpc_add\", \"params\": {\"x\": 22, \"y\": \"itay\"}, \"id\": \"2\"}, \
{\"foo\": \"boo\"}, \
- {\"jsonrpc\": \"2.0\", \"method\": \"foo.get\", \"params\": {\"name\": \"myself\"}, \"id\": \"5\"}, \
- {\"jsonrpc\": \"2.0\", \"method\": \"get_data\", \"id\": \"9\"} \
+ {\"jsonrpc\": \"2.0\", \"method\": \"test_rpc_sheker\", \"params\": {\"name\": \"myself\"}, \"id\": 5}, \
+ {\"jsonrpc\": \"2.0\", \"method\": \"test_rpc_add\", \"params\": {\"x\": 22, \"y\": 17} } \
]";
resp_str = send_msg(req_str);
@@ -214,5 +214,13 @@ TEST_F(RpcTest, batch_rpc_test) {
// message 4
EXPECT_TRUE(response[3] == Json::Value::null);
+ // message 5
+ EXPECT_TRUE(response[4]["jsonrpc"] == "2.0");
+ EXPECT_TRUE(response[4]["id"] == 5);
+ EXPECT_TRUE(response[4]["error"]["code"] == -32601);
+
+ // message 6 - no ID but a valid command
+ EXPECT_TRUE(response[5] == Json::Value::null);
+
return;
}