X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=mon%2Ftests%2Ftest_mon_resp_encode.c;h=3c1dd831bdd2a21dfee59563e060fe80ffeb8178;hb=240db3f1e5143b5eae6d6d5b81bb83a128f8450c;hp=b4ecdfe55e186a78ca10e98ab0e2024027c5ff9a;hpb=34a48da22180b477dccb83cd5baa844f754ba9b9;p=trust_router.git diff --git a/mon/tests/test_mon_resp_encode.c b/mon/tests/test_mon_resp_encode.c index b4ecdfe..3c1dd83 100644 --- a/mon/tests/test_mon_resp_encode.c +++ b/mon/tests/test_mon_resp_encode.c @@ -11,41 +11,6 @@ #define JSON_DUMP_OPTS 0 -static char *reconfigure(MON_RESP_CODE code, const char *message) -{ - MON_REQ *req = NULL; - MON_RESP *resp = NULL; - json_t *resp_json = NULL; - char *result = NULL; - - req = mon_req_new(NULL, MON_CMD_RECONFIGURE); - assert(req); - - resp = mon_resp_new(NULL, req, code, message, NULL); - assert(resp); - - resp_json = mon_resp_encode(resp); - assert(resp_json); - - result = json_dumps(resp_json, JSON_DUMP_OPTS); - assert(result); - - json_decref(resp_json); - mon_resp_free(resp); - mon_req_free(req); - return result; -} - -static char *reconfigure_success() -{ - return reconfigure(MON_RESP_SUCCESS, "success"); -} - -static char *reconfigure_error() -{ - return reconfigure(MON_RESP_ERROR, "error"); -} - static char *show_success() { MON_REQ *req = NULL; @@ -64,19 +29,19 @@ static char *show_success() mon_opt_type_to_string(OPT_TYPE_SHOW_VERSION), json_string("1.2.3-4"))); assert(! json_object_set_new(payload, - mon_opt_type_to_string(OPT_TYPE_SHOW_SERIAL), + mon_opt_type_to_string(OPT_TYPE_SHOW_CONFIG_FILES), json_integer(1234567890))); assert(! json_object_set_new(payload, - mon_opt_type_to_string(OPT_TYPE_SHOW_SERIAL), + mon_opt_type_to_string(OPT_TYPE_SHOW_CONFIG_FILES), json_integer(86400))); assert(! json_object_set_new(payload, - mon_opt_type_to_string(OPT_TYPE_SHOW_TID_REQ_PENDING), + mon_opt_type_to_string(OPT_TYPE_SHOW_TID_REQS_PENDING), json_integer(13))); assert(! json_object_set_new(payload, - mon_opt_type_to_string(OPT_TYPE_SHOW_TID_REQ_COUNT), + mon_opt_type_to_string(OPT_TYPE_SHOW_TID_REQS_PROCESSED), json_integer(1432))); - resp = mon_resp_new(NULL, req, MON_RESP_SUCCESS, "success", payload); + resp = mon_resp_new(NULL, MON_RESP_SUCCESS, "success", payload); assert(resp); resp_json = mon_resp_encode(resp); @@ -123,8 +88,6 @@ int run_test(const char *filename, char *(generator)()) int main(void) { - assert(run_test("resp_reconfigure_success.test", reconfigure_success)); - assert(run_test("resp_reconfigure_error.test", reconfigure_error)); assert(run_test("resp_show_success.test", show_success)); return 0; }