fix(test): fix syntax error on windows.
This commit is contained in:
parent
d9db70faf2
commit
878d14052f
|
@ -47,7 +47,8 @@ void printSubResults(void* pRes, int32_t* totalRows) {
|
||||||
int32_t precision = taos_result_precision(pRes);
|
int32_t precision = taos_result_precision(pRes);
|
||||||
taos_print_row(buf, row, fields, numOfFields);
|
taos_print_row(buf, row, fields, numOfFields);
|
||||||
*totalRows += 1;
|
*totalRows += 1;
|
||||||
printf("vgId: %d, offset: %"PRId64", precision: %d, row content: %s\n", vgId, offset, precision, buf);
|
std::cout << "vgId:" << vgId << ", offset:" << offset << ", precision:" << precision << ", row content:" << buf
|
||||||
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// taos_free_result(pRes);
|
// taos_free_result(pRes);
|
||||||
|
@ -1167,16 +1168,19 @@ TEST(clientCase, tmq_commit) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < numOfAssign; i++){
|
for(int i = 0; i < numOfAssign; i++){
|
||||||
printf("assign i:%d, vgId:%d, offset:%"PRId64", start:%"PRId64", end:%"PRId64"\n", i, pAssign[i].vgId, pAssign[i].currentOffset, pAssign[i].begin, pAssign[i].end);
|
tmq_topic_assignment* pa = &pAssign[i];
|
||||||
|
std::cout << "assign i:" << i << ", vgId:" << pa->vgId << ", offset:" << pa->currentOffset << ", start:%"
|
||||||
|
<< pa->begin << ", end:%" << pa->end << std::endl;
|
||||||
|
|
||||||
int64_t committed = tmq_committed(tmq, topicName, pAssign[i].vgId);
|
int64_t committed = tmq_committed(tmq, topicName, pa->vgId);
|
||||||
printf("committed vgId:%d, committed:%"PRId64"\n", pAssign[i].vgId, committed);
|
std::cout << "committed vgId:" << pa->vgId << " committed:" << committed << std::endl;
|
||||||
|
|
||||||
int64_t position = tmq_position(tmq, topicName, pAssign[i].vgId);
|
int64_t position = tmq_position(tmq, topicName, pa->vgId);
|
||||||
printf("position vgId:%d, position:%"PRId64"\n", pAssign[i].vgId, position);
|
std::cout << "position vgId:" << pa->vgId << ", position:" << position << std::endl;
|
||||||
tmq_offset_seek(tmq, topicName, pAssign[i].vgId, 1);
|
|
||||||
position = tmq_position(tmq, topicName, pAssign[i].vgId);
|
tmq_offset_seek(tmq, topicName, pa->vgId, 1);
|
||||||
printf("after seek 1, position vgId:%d, position:%"PRId64"\n", pAssign[i].vgId, position);
|
position = tmq_position(tmq, topicName, pa->vgId);
|
||||||
|
std::cout << "after seek 1, position vgId:" << pa->vgId << " position:" << position << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
@ -1191,12 +1195,14 @@ TEST(clientCase, tmq_commit) {
|
||||||
tmq_commit_sync(tmq, pRes);
|
tmq_commit_sync(tmq, pRes);
|
||||||
for(int i = 0; i < numOfAssign; i++) {
|
for(int i = 0; i < numOfAssign; i++) {
|
||||||
int64_t committed = tmq_committed(tmq, topicName, pAssign[i].vgId);
|
int64_t committed = tmq_committed(tmq, topicName, pAssign[i].vgId);
|
||||||
printf("committed vgId:%d, committed:%"PRId64"\n", pAssign[i].vgId, committed);
|
std::cout << "committed vgId:" << pAssign[i].vgId << " , committed:" << committed << std::endl;
|
||||||
if(committed > 0){
|
if(committed > 0){
|
||||||
int32_t code = tmq_commit_offset_sync(tmq, topicName, pAssign[i].vgId, 4);
|
int32_t code = tmq_commit_offset_sync(tmq, topicName, pAssign[i].vgId, 4);
|
||||||
printf("tmq_commit_offset_sync vgId:%d, offset:4, code:%d\n", pAssign[i].vgId, code);
|
printf("tmq_commit_offset_sync vgId:%d, offset:4, code:%d\n", pAssign[i].vgId, code);
|
||||||
int64_t committed = tmq_committed(tmq, topicName, pAssign[i].vgId);
|
int64_t committed = tmq_committed(tmq, topicName, pAssign[i].vgId);
|
||||||
printf("after tmq_commit_offset_sync, committed vgId:%d, committed:%"PRId64"\n", pAssign[i].vgId, committed);
|
|
||||||
|
std::cout << "after tmq_commit_offset_sync, committed vgId:" << pAssign[i].vgId << ", committed:" << committed
|
||||||
|
<< std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pRes != NULL) {
|
if (pRes != NULL) {
|
||||||
|
@ -1212,7 +1218,12 @@ TEST(clientCase, tmq_commit) {
|
||||||
taos_close(pConn);
|
taos_close(pConn);
|
||||||
fprintf(stderr, "%d msg consumed, include %d rows\n", msgCnt, totalRows);
|
fprintf(stderr, "%d msg consumed, include %d rows\n", msgCnt, totalRows);
|
||||||
}
|
}
|
||||||
|
namespace {
|
||||||
|
void doPrintInfo(tmq_topic_assignment* pa, int32_t index) {
|
||||||
|
std::cout << "assign i:" << index << ", vgId:" << pa->vgId << ", offset:%" << pa->currentOffset << ", start:%"
|
||||||
|
<< pa->begin << ", end:%" << pa->end << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
TEST(clientCase, td_25129) {
|
TEST(clientCase, td_25129) {
|
||||||
// taos_options(TSDB_OPTION_CONFIGDIR, "~/first/cfg");
|
// taos_options(TSDB_OPTION_CONFIGDIR, "~/first/cfg");
|
||||||
|
|
||||||
|
@ -1264,7 +1275,7 @@ TEST(clientCase, td_25129) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < numOfAssign; i++){
|
for(int i = 0; i < numOfAssign; i++){
|
||||||
printf("assign i:%d, vgId:%d, offset:%"PRId64", start:%"PRId64", end:%"PRId64"\n", i, pAssign[i].vgId, pAssign[i].currentOffset, pAssign[i].begin, pAssign[i].end);
|
doPrintInfo(&pAssign[i], i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// tmq_offset_seek(tmq, "tp", pAssign[0].vgId, 4);
|
// tmq_offset_seek(tmq, "tp", pAssign[0].vgId, 4);
|
||||||
|
@ -1281,7 +1292,7 @@ TEST(clientCase, td_25129) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < numOfAssign; i++){
|
for(int i = 0; i < numOfAssign; i++){
|
||||||
printf("assign i:%d, vgId:%d, offset:%"PRId64", start:%"PRId64", end:%"PRId64"\n", i, pAssign[i].vgId, pAssign[i].currentOffset, pAssign[i].begin, pAssign[i].end);
|
doPrintInfo(&pAssign[i], i);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmq_free_assignment(pAssign);
|
tmq_free_assignment(pAssign);
|
||||||
|
@ -1298,7 +1309,7 @@ TEST(clientCase, td_25129) {
|
||||||
|
|
||||||
for(int i = 0; i < numOfAssign; i++){
|
for(int i = 0; i < numOfAssign; i++){
|
||||||
int64_t committed = tmq_committed(tmq, topicName, pAssign[i].vgId);
|
int64_t committed = tmq_committed(tmq, topicName, pAssign[i].vgId);
|
||||||
printf("assign i:%d, vgId:%d, committed:%"PRId64", offset:%"PRId64", start:%"PRId64", end:%"PRId64"\n", i, pAssign[i].vgId, committed, pAssign[i].currentOffset, pAssign[i].begin, pAssign[i].end);
|
doPrintInfo(&pAssign[i], i);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
@ -1328,7 +1339,7 @@ TEST(clientCase, td_25129) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < numOfAssign; i++){
|
for(int i = 0; i < numOfAssign; i++){
|
||||||
printf("assign i:%d, vgId:%d, offset:%"PRId64", start:%"PRId64", end:%"PRId64"\n", i, pAssign[i].vgId, pAssign[i].currentOffset, pAssign[i].begin, pAssign[i].end);
|
doPrintInfo(&pAssign[i], i);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for(int i = 0; i < numOfAssign; i++) {
|
for(int i = 0; i < numOfAssign; i++) {
|
||||||
|
@ -1364,8 +1375,7 @@ TEST(clientCase, td_25129) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < numOfAssign; i++){
|
for(int i = 0; i < numOfAssign; i++){
|
||||||
printf("assign i:%d, vgId:%d, offset:%"PRId64", start:%"PRId64", end:%"PRId64"\n", i, pAssign[i].vgId, pAssign[i].currentOffset,
|
doPrintInfo(&pAssign[i], i);
|
||||||
pAssign[i].begin, pAssign[i].end);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tmq_free_assignment(pAssign);
|
tmq_free_assignment(pAssign);
|
||||||
|
|
Loading…
Reference in New Issue