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