提交 51e168fe 编写于 作者: wmmhello's avatar wmmhello

[TD-5992] add test case

上级 6df8b54c
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "taos.h" #include "taos.h"
#include "tglobal.h" #include "tglobal.h"
#include "tconfig.h"
/* test parse time function */ /* test parse time function */
TEST(testCase, set_config_test) { TEST(testCase, set_config_test) {
...@@ -12,10 +13,13 @@ TEST(testCase, set_config_test) { ...@@ -12,10 +13,13 @@ TEST(testCase, set_config_test) {
const char *config2 = "{\"debugFlag\":\"199\"}"; const char *config2 = "{\"debugFlag\":\"199\"}";
taos_set_config(config2); // not take effect taos_set_config(config2); // not take effect
ASSERT_EQ(taosReadGlobalCfg(), true); // load file config, not take effect bool readResult = taosReadGlobalCfg();
ASSERT_EQ(taosCheckGlobalCfg(), 0); ASSERT_TRUE(readResult); // load file config, not take effect
int32_t checkResult = taosCheckGlobalCfg();
ASSERT_EQ(checkResult, 0);
SGlobalCfg *cfg = taosGetConfigOption("debugFlag"); SGlobalCfg *cfg = taosGetConfigOption("debugFlag");
ASSERT_EQ(cfg->cfgStatus, TAOS_CFG_CSTATUS_OPTION); ASSERT_EQ(cfg->cfgStatus, TAOS_CFG_CSTATUS_OPTION);
ASSERT_EQ(*(int32_t*)cfg.ptr, 135); int32_t result = *(int32_t*)cfg.ptr;
ASSERT_EQ(result, 131);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册