lichao
2021-05-21 11f6c600e55ca5677f93624efe44d2605cdd908d
utest/api_test.cpp
@@ -176,8 +176,21 @@
      int reply_len = 0;
      bool r = BHRegisterTopics(s.data(), s.size(), &reply, &reply_len, 1000);
      DEFER1(BHFree(reply, reply_len));
      // printf("register topic : %s\n", r ? "ok" : "failed");
      // Sleep(1s);
   }
   { // Server Register Topics
      MsgTopicList topics;
      topics.add_topic_list("@should_fail");
      std::string s = topics.SerializeAsString();
      void *reply = 0;
      int reply_len = 0;
      bool r = BHRegisterTopics(s.data(), s.size(), &reply, &reply_len, 1000);
      DEFER1(BHFree(reply, reply_len));
      if (!r) {
         int ec = 0;
         std::string msg;
         GetApiError(ec, msg);
         printf("register rpc failed, %d, %s\n", ec, msg.c_str());
      }
   }
   auto PrintProcs = [](MsgQueryProcReply const &result) {
      printf("query proc result: %d\n", result.proc_list().size());
@@ -214,7 +227,7 @@
   {
      // query procs with normal topic request
      MsgRequestTopic req;
      req.set_topic("@center_query_procs");
      req.set_topic("#center_query_procs");
      // req.set_data("{\"proc_id\":\"#center.node\"}");
      std::string s(req.SerializeAsString());
      // Sleep(10ms, false);