未验证 提交 aac3d30d 编写于 作者: wmmhello's avatar wmmhello 提交者: GitHub

Merge pull request #12772 from taosdata/feature/TD-13041

fix: unit test in json scalar operator
...@@ -17,7 +17,7 @@ TARGET_INCLUDE_DIRECTORIES( ...@@ -17,7 +17,7 @@ TARGET_INCLUDE_DIRECTORIES(
PUBLIC "${TD_SOURCE_DIR}/source/libs/parser/inc" PUBLIC "${TD_SOURCE_DIR}/source/libs/parser/inc"
PRIVATE "${TD_SOURCE_DIR}/source/libs/scalar/inc" PRIVATE "${TD_SOURCE_DIR}/source/libs/scalar/inc"
) )
#add_test( add_test(
# NAME scalarTest NAME scalarTest
# COMMAND scalarTest COMMAND scalarTest
#) )
...@@ -1238,8 +1238,8 @@ TEST(columnTest, json_column_logic_op) { ...@@ -1238,8 +1238,8 @@ TEST(columnTest, json_column_logic_op) {
printf("--------------------json null---------------------\n"); printf("--------------------json null---------------------\n");
key = "k3"; key = "k3"; // (null is true) return NULL, so use DBL_MAX represent NULL
bool eRes2[len+len1] = {false, false, false, false, false, false, true, false, false, false, false, false, false}; double eRes2[len+len1] = {false, false, false, false, false, false, true, false, DBL_MAX, false, false, false, false};
for(int i = 0; i < len; i++){ for(int i = 0; i < len; i++){
makeCalculate(row, key, TSDB_DATA_TYPE_INT, &input[i], eRes2[i], op[i]); makeCalculate(row, key, TSDB_DATA_TYPE_INT, &input[i], eRes2[i], op[i]);
} }
...@@ -1290,8 +1290,8 @@ TEST(columnTest, json_column_logic_op) { ...@@ -1290,8 +1290,8 @@ TEST(columnTest, json_column_logic_op) {
printf("---------------------json not exist--------------------\n"); printf("---------------------json not exist--------------------\n");
key = "k10"; key = "k10"; // (NULL is true) return NULL, so use DBL_MAX represent NULL
double eRes10[len+len1] = {false, false, false, false, false, false, true, false, false, false, false, false, false}; double eRes10[len+len1] = {false, false, false, false, false, false, true, false, DBL_MAX, false, false, false, false};
for(int i = 0; i < len; i++){ for(int i = 0; i < len; i++){
makeCalculate(row, key, TSDB_DATA_TYPE_INT, &input[i], eRes10[i], op[i]); makeCalculate(row, key, TSDB_DATA_TYPE_INT, &input[i], eRes10[i], op[i]);
} }
...@@ -3456,7 +3456,7 @@ TEST(ScalarFunctionTest, powFunction_column) { ...@@ -3456,7 +3456,7 @@ TEST(ScalarFunctionTest, powFunction_column) {
//TINYINT AND FLOAT //TINYINT AND FLOAT
int8_t param0[] = {2, 3, 4}; int8_t param0[] = {2, 3, 4};
float param1[] = {3.0, 3.0, 2.0}; float param1[] = {3.0, 3.0, 3.0};
scltMakeDataBlock(&input[0], TSDB_DATA_TYPE_TINYINT, 0, rowNum, false); scltMakeDataBlock(&input[0], TSDB_DATA_TYPE_TINYINT, 0, rowNum, false);
pInput[0] = *input[0]; pInput[0] = *input[0];
for (int32_t i = 0; i < rowNum; ++i) { for (int32_t i = 0; i < rowNum; ++i) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册