Merge pull request #99 from painless-security/jennifer/count_failed_reqs
[trust_router.git] / mon / tests / test_mon_req_decode.c
index 63570b9..360be1f 100644 (file)
 #include <mon_internal.h>
 
 /**
- * @return reconfigure command
- */
-static MON_REQ *reconfigure()
-{
-  MON_REQ *req = mon_req_new(NULL, MON_CMD_RECONFIGURE);
-  assert(req);
-  return req;
-}
-
-/**
  * @return show command with no options
  */
 static MON_REQ *show_plain()
@@ -52,11 +42,11 @@ static MON_REQ *show_options(const MON_OPT_TYPE *opts)
 static MON_REQ *show_all_options()
 {
   MON_OPT_TYPE opts[] = {
-      OPT_TYPE_SHOW_SERIAL,
+      OPT_TYPE_SHOW_CONFIG_FILES,
       OPT_TYPE_SHOW_VERSION,
       OPT_TYPE_SHOW_UPTIME,
-      OPT_TYPE_SHOW_TID_REQ_COUNT,
-      OPT_TYPE_SHOW_TID_REQ_PENDING,
+      OPT_TYPE_SHOW_TID_REQS_PROCESSED,
+      OPT_TYPE_SHOW_TID_REQS_PENDING,
       OPT_TYPE_SHOW_ROUTES,
       OPT_TYPE_SHOW_COMMUNITIES,
       OPT_TYPE_UNKNOWN // terminator
@@ -110,7 +100,7 @@ static int run_test(const char *filename, MON_REQ *(generator)())
   req_json_str = read_file(filename);
   assert(req_json_str);
 
-  req = mon_req_decode(NULL, req_json_str);
+  req = mon_req_parse(NULL, req_json_str);
   assert(req);
   assert(equal(req, expected));
 
@@ -124,9 +114,6 @@ static int run_test(const char *filename, MON_REQ *(generator)())
 int main(void)
 {
 
-  // Test reconfigure command
-  assert(run_test("req_reconfigure.test", reconfigure));
-
   // Test show command with no options
   assert(run_test("req_show_no_options.test", show_plain));