提交 8778c55f 编写于 作者: A Alex Duan

fixed build error test case

上级 19839996
...@@ -985,7 +985,7 @@ void splitStreamSql(const char *str, char **sql, char **to, char **split) { ...@@ -985,7 +985,7 @@ void splitStreamSql(const char *str, char **sql, char **to, char **split) {
strcpy(*to, p); strcpy(*to, p);
return ; return ;
} }
len = p2 - p1 - LABEL_TO_LEN; len = (int32_t)(p2 - p1 - LABEL_TO_LEN);
*to = (char *)tmalloc(len + 1); *to = (char *)tmalloc(len + 1);
strncpy(*to, p1 + LABEL_TO_LEN, len); strncpy(*to, p1 + LABEL_TO_LEN, len);
(*to)[len] = 0; // str end (*to)[len] = 0; // str end
......
...@@ -27,14 +27,14 @@ class TDTestCase: ...@@ -27,14 +27,14 @@ class TDTestCase:
def run(self): def run(self):
rowNum = 200 rowNum = 200
tdSql.prepare() tdSql.prepare()
ts_begin = 1633017600000 ts_now = 1633017600000
tdLog.info("=============== step1") tdLog.info("=============== step1")
tdSql.execute("create table mt(ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)") tdSql.execute("create table mt(ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)")
for i in range(5): for i in range(5):
tdSql.execute("create table tb%d using mt tags(%d)" % (i, i)) tdSql.execute("create table tb%d using mt tags(%d)" % (i, i))
for j in range(rowNum): for j in range(rowNum):
tdSql.execute("insert into tb%d values(%d, %d, %d)" % (i, ts_begin+j*1000, j, j)) tdSql.execute("insert into tb%d values(%d, %d, %d)" % (i, ts_now, j, j))
ts_now += 1000
time.sleep(0.1) time.sleep(0.1)
tdLog.info("=============== step2") tdLog.info("=============== step2")
...@@ -46,14 +46,15 @@ class TDTestCase: ...@@ -46,14 +46,15 @@ class TDTestCase:
tdSql.waitedQuery("select * from st", 1, 180) tdSql.waitedQuery("select * from st", 1, 180)
delay = int(time.time() - start) + 80 delay = int(time.time() - start) + 80
v = tdSql.getData(0, 3) v = tdSql.getData(0, 3)
if v >= 51: if v != 10:
tdLog.exit("value is %d, which is larger than 51" % v) tdLog.exit("value is %d, expect is 10." % v)
tdLog.info("=============== step4") tdLog.info("=============== step4")
for i in range(5, 10): for i in range(5, 10):
tdSql.execute("create table tb%d using mt tags(%d)" % (i, i)) tdSql.execute("create table tb%d using mt tags(%d)" % (i, i))
for j in range(rowNum): for j in range(rowNum):
tdSql.execute("insert into tb%d values(%d, %d, %d)" % (i, ts_begin+j*1000, j, j)) tdSql.execute("insert into tb%d values(%d, %d, %d)" % (i, ts_now, j, j))
ts_now += 1000
tdLog.info("=============== step5") tdLog.info("=============== step5")
maxValue = 0 maxValue = 0
...@@ -63,11 +64,11 @@ class TDTestCase: ...@@ -63,11 +64,11 @@ class TDTestCase:
v = tdSql.getData(0, 3) v = tdSql.getData(0, 3)
if v > maxValue: if v > maxValue:
maxValue = v maxValue = v
if v > 51: if v >= 10:
break break
if maxValue <= 51: if maxValue < 10:
tdLog.exit("value is %d, which is smaller than 51" % maxValue) tdLog.exit("value is %d, expect is 10" % maxValue)
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册