summaryrefslogtreecommitdiffstats
path: root/src/rpc-server/commands/trex_rpc_cmd_test.cpp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-08-31 13:42:03 +0300
committerimarom <imarom@cisco.com>2015-08-31 13:42:03 +0300
commit499b4d6221c023d656663fe441bbf5d194886efb (patch)
tree971c0738a56adfd9d39790b843ef1d1a83b88229 /src/rpc-server/commands/trex_rpc_cmd_test.cpp
parentc9381643e7bf9b3dc690bf3e012ad6176ee32b8c (diff)
SOOO DRAFT....
Diffstat (limited to 'src/rpc-server/commands/trex_rpc_cmd_test.cpp')
-rw-r--r--src/rpc-server/commands/trex_rpc_cmd_test.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/rpc-server/commands/trex_rpc_cmd_test.cpp b/src/rpc-server/commands/trex_rpc_cmd_test.cpp
index e67de286..473cbb70 100644
--- a/src/rpc-server/commands/trex_rpc_cmd_test.cpp
+++ b/src/rpc-server/commands/trex_rpc_cmd_test.cpp
@@ -36,10 +36,9 @@ TrexRpcCmdTestAdd::_run(const Json::Value &params, Json::Value &result) {
const Json::Value &y = params["y"];
check_param_count(params, 2, result);
- check_field_type(params, "x", FIELD_TYPE_INT, result);
- check_field_type(params, "y", FIELD_TYPE_INT, result);
- result["result"] = x.asInt() + y.asInt();
+ result["result"] = parse_int(params, "x", result) + parse_int(params, "y", result);
+
return (TREX_RPC_CMD_OK);
}
@@ -55,10 +54,9 @@ TrexRpcCmdTestSub::_run(const Json::Value &params, Json::Value &result) {
const Json::Value &y = params["y"];
check_param_count(params, 2, result);
- check_field_type(params, "x", TrexRpcCommand::FIELD_TYPE_INT, result);
- check_field_type(params, "y", TrexRpcCommand::FIELD_TYPE_INT, result);
- result["result"] = x.asInt() - y.asInt();
+ result["result"] = parse_int(params, "x", result) - parse_int(params, "y", result);
+
return (TREX_RPC_CMD_OK);
}