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

[TD-5992] add test case

上级 3a8bf9ad
...@@ -16,6 +16,6 @@ IF (HEADER_GTEST_INCLUDE_DIR AND (LIB_GTEST_STATIC_DIR OR LIB_GTEST_SHARED_DIR)) ...@@ -16,6 +16,6 @@ IF (HEADER_GTEST_INCLUDE_DIR AND (LIB_GTEST_STATIC_DIR OR LIB_GTEST_SHARED_DIR))
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCE_LIST) AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCE_LIST)
ADD_EXECUTABLE(cliTest ${SOURCE_LIST}) ADD_EXECUTABLE(cliTest setConfigTest ${SOURCE_LIST})
TARGET_LINK_LIBRARIES(cliTest taos cJson tutil common gtest pthread) TARGET_LINK_LIBRARIES(cliTest taos cJson tutil common gtest pthread)
ENDIF() ENDIF()
...@@ -259,9 +259,6 @@ void validateResultFields() { ...@@ -259,9 +259,6 @@ void validateResultFields() {
} }
/* test parse time function */ /* test parse time function */
TEST(testCase, result_field_test) { TEST(testCase, result_field_test) {
const char *config = "{\"debugFlag\":\"135\"}";
taos_set_config(config);
taos_set_config(config);
taos_options(TSDB_OPTION_CONFIGDIR, "~/first/cfg"); taos_options(TSDB_OPTION_CONFIGDIR, "~/first/cfg");
taos_init(); taos_init();
......
#include <gtest/gtest.h>
#include <inttypes.h>
#include "taos.h"
#include "tglobal.h"
/* test parse time function */
TEST(testCase, result_field_test) {
const char *config = "{\"debugFlag\":\"131\"}";
taos_set_config(config);
const char *config2 = "{\"debugFlag\":\"199\"}";
taos_set_config(config2); // not take effect
ASSERT_EQ(taosReadGlobalCfg(), true); // load file config, not take effect
ASSERT_EQ(taosCheckGlobalCfg(), 0);
SGlobalCfg *cfg = taosGetConfigOption("debugFlag");
ASSERT_EQ(cfg->cfgStatus, TAOS_CFG_CSTATUS_OPTION);
ASSERT_EQ(*(int32_t*)cfg.ptr, 135);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册