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

[TD-5992] modify return msg

上级 ea17b403
......@@ -478,11 +478,11 @@ static setConfRet taos_set_config_imp(const char *config){
if(!taosReadConfigOption(item->string, item->valuestring, NULL, NULL, TAOS_CFG_CSTATUS_OPTION, TSDB_CFG_CTYPE_B_CLIENT)){
ret.retCode = -1;
if (strlen(ret.retMsg) == 0){
snprintf(ret.retMsg, 1000, "part error|%s", item->string);
snprintf(ret.retMsg, 1024, "part error|%s", item->string);
}else{
char tmp[1024] = {0};
strcpy(tmp, ret.retMsg);
snprintf(ret.retMsg, 1000, "%s|%s", tmp, item->string);
char tmp[1000] = {0};
strncpy(tmp, ret.retMsg, 1000);
snprintf(ret.retMsg, 1024, "%s|%s", tmp, item->string);
}
}
}
......
......@@ -14,7 +14,7 @@ TEST(testCase, set_config_test1) {
const char *config2 = "{\"debugFlag\":\"199\"}";
ret = taos_set_config(config2); // not take effect
ASSERT_EQ(ret.retCode, -5)
ASSERT_EQ(ret.retCode, -5);
printf("msg:%d->%s", ret.retCode, ret.retMsg);
bool readResult = taosReadGlobalCfg(); // load file config, debugFlag not take effect
......@@ -57,7 +57,7 @@ TEST(testCase, set_config_test4) {
}
TEST(testCase, set_config_test5) {
const char *config = "ddd";
const char *config = "\"ddd\"";
setConfRet ret = taos_set_config(config);
ASSERT_EQ(ret.retCode, -3);
printf("msg:%d->%s", ret.retCode, ret.retMsg);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册