“bf5a3e106bd90fb9a96b55373945e2ffac9b2592”上不存在“tests/pytest/client/client.py”
提交 d147cf29 编写于 作者: Z zhaoyanggh

fix return

上级 2549b72b
...@@ -185,9 +185,10 @@ extern char configDir[]; ...@@ -185,9 +185,10 @@ extern char configDir[];
#define errorPrint(fmt, ...) \ #define errorPrint(fmt, ...) \
do { \ do { \
fprintf(stderr, " \033[31m"); \ fprintf(stderr, "\033[31m"); \
fprintf(stderr, "%s(%d) ", __FILE__, __LINE__); \
fprintf(stderr, "ERROR: " fmt, __VA_ARGS__); \ fprintf(stderr, "ERROR: " fmt, __VA_ARGS__); \
fprintf(stderr, " \033[0m"); \ fprintf(stderr, "\033[0m"); \
} while (0) } while (0)
enum TEST_MODE { enum TEST_MODE {
......
...@@ -5534,26 +5534,17 @@ int insertTestProcess() { ...@@ -5534,26 +5534,17 @@ int insertTestProcess() {
// create database and super tables // create database and super tables
char *cmdBuffer = calloc(1, BUFFER_SIZE); char *cmdBuffer = calloc(1, BUFFER_SIZE);
assert(cmdBuffer); assert(cmdBuffer);
code = createDatabasesAndStables(cmdBuffer); if (createDatabasesAndStables(cmdBuffer)) {
if (code) {
errorPrint("%s() LN%d, createDatabasesAndStables() failed\n", __func__,
__LINE__);
goto end_insert_process; goto end_insert_process;
} }
// pretreatment // pretreatment
code = prepareSampleData(); if (prepareSampleData()) {
if (code) {
errorPrint("%s() LN%d, prepareSampleData() failed\n", __func__,
__LINE__);
goto end_insert_process; goto end_insert_process;
} }
if (g_args.iface != SML_IFACE && g_totalChildTables > 0) { if (g_args.iface != SML_IFACE && g_totalChildTables > 0) {
code = createChildTables(); if (createChildTables()) {
if (code) {
errorPrint("%s() LN%d, createChildTables() failed\n", __func__,
__LINE__);
goto end_insert_process; goto end_insert_process;
} }
} }
...@@ -5566,14 +5557,9 @@ int insertTestProcess() { ...@@ -5566,14 +5557,9 @@ int insertTestProcess() {
SSuperTable *stbInfo = &g_Dbs.db[i].superTbls[j]; SSuperTable *stbInfo = &g_Dbs.db[i].superTbls[j];
if (stbInfo && (stbInfo->insertRows > 0)) { if (stbInfo && (stbInfo->insertRows > 0)) {
code = startMultiThreadInsertData( if (startMultiThreadInsertData(
g_Dbs.threadCount, g_Dbs.db[i].dbName, g_Dbs.threadCount, g_Dbs.db[i].dbName,
g_Dbs.db[i].dbCfg.precision, stbInfo); g_Dbs.db[i].dbCfg.precision, stbInfo)) {
if (code) {
errorPrint(
"%s() LN%d, startMultiThreadInsertData failed "
"for db %d stb %" PRIu64 "\n",
__func__, __LINE__, i, j);
goto end_insert_process; goto end_insert_process;
} }
} }
...@@ -5585,12 +5571,9 @@ int insertTestProcess() { ...@@ -5585,12 +5571,9 @@ int insertTestProcess() {
errorPrint("%s\n", "Schemaless insertion must include stable"); errorPrint("%s\n", "Schemaless insertion must include stable");
goto end_insert_process; goto end_insert_process;
} else { } else {
code = startMultiThreadInsertData( if (startMultiThreadInsertData(
g_Dbs.threadCount, g_Dbs.db[i].dbName, g_Dbs.threadCount, g_Dbs.db[i].dbName,
g_Dbs.db[i].dbCfg.precision, NULL); g_Dbs.db[i].dbCfg.precision, NULL)) {
if (code) {
errorPrint("%s() LN%d, startMultiThreadInsertData failed\n",
__func__, __LINE__);
goto end_insert_process; goto end_insert_process;
} }
} }
...@@ -5598,8 +5581,5 @@ int insertTestProcess() { ...@@ -5598,8 +5581,5 @@ int insertTestProcess() {
} }
end_insert_process: end_insert_process:
tmfree(cmdBuffer); tmfree(cmdBuffer);
if (g_fpOfInsertResult) {
fclose(g_fpOfInsertResult);
}
return code; return code;
} }
\ No newline at end of file
...@@ -674,7 +674,7 @@ int getMetaFromInsertJsonFile(cJSON *root) { ...@@ -674,7 +674,7 @@ int getMetaFromInsertJsonFile(cJSON *root) {
} else if (!quorum) { } else if (!quorum) {
g_Dbs.db[i].dbCfg.quorum = 1; g_Dbs.db[i].dbCfg.quorum = 1;
} else { } else {
printf("failed to read json, quorum input mistake"); errorPrint("%s", "failed to read json, quorum input mistake");
goto PARSE_OVER; goto PARSE_OVER;
} }
...@@ -1144,9 +1144,8 @@ int getMetaFromInsertJsonFile(cJSON *root) { ...@@ -1144,9 +1144,8 @@ int getMetaFromInsertJsonFile(cJSON *root) {
goto PARSE_OVER; goto PARSE_OVER;
} }
int retVal = getColumnAndTagTypeFromInsertJsonFile( if (getColumnAndTagTypeFromInsertJsonFile(
stbInfo, &g_Dbs.db[i].superTbls[j]); stbInfo, &g_Dbs.db[i].superTbls[j])) {
if (false == retVal) {
goto PARSE_OVER; goto PARSE_OVER;
} }
} }
...@@ -1705,21 +1704,10 @@ int getInfoFromJsonFile(char *file) { ...@@ -1705,21 +1704,10 @@ int getInfoFromJsonFile(char *file) {
memset(&g_Dbs, 0, sizeof(SDbs)); memset(&g_Dbs, 0, sizeof(SDbs));
g_Dbs.use_metric = g_args.use_metric; g_Dbs.use_metric = g_args.use_metric;
code = getMetaFromInsertJsonFile(root); code = getMetaFromInsertJsonFile(root);
if (code) {
errorPrint("%s() LN%d, getMetaFromInsertJsonFile() failed\n",
__func__, __LINE__);
goto PARSE_OVER;
}
} else if ((QUERY_TEST == g_args.test_mode) || } else if ((QUERY_TEST == g_args.test_mode) ||
(SUBSCRIBE_TEST == g_args.test_mode)) { (SUBSCRIBE_TEST == g_args.test_mode)) {
memset(&g_queryInfo, 0, sizeof(SQueryMetaInfo)); memset(&g_queryInfo, 0, sizeof(SQueryMetaInfo));
code = getMetaFromQueryJsonFile(root); code = getMetaFromQueryJsonFile(root);
if (code) {
errorPrint("%s() LN%d, getMetaFromQueryJsonFile() failed\n",
__func__, __LINE__);
goto PARSE_OVER;
}
} else { } else {
errorPrint("%s", errorPrint("%s",
"input json file type error! please input correct file " "input json file type error! please input correct file "
......
...@@ -66,26 +66,17 @@ SArguments g_args = { ...@@ -66,26 +66,17 @@ SArguments g_args = {
}; };
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
int32_t code = parse_args(argc, argv, &g_args); if (parse_args(argc, argv, &g_args)) {
if (code) {
errorPrint("%s() LN%d, parse_args() failed\n", __func__, __LINE__);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
debugPrint("meta file: %s\n", g_args.metaFile); debugPrint("meta file: %s\n", g_args.metaFile);
if (g_args.metaFile) { if (g_args.metaFile) {
g_totalChildTables = 0; g_totalChildTables = 0;
if (getInfoFromJsonFile(g_args.metaFile)) {
code = getInfoFromJsonFile(g_args.metaFile);
if (code) {
errorPrint("%s() LN%d, getInfoFromJsonFile(%s) failed\n", __func__,
__LINE__, g_args.metaFile);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
code = testMetaFile(); if (testMetaFile()) {
if (code) {
errorPrint("%s() LN%d, testMetaFile() failed\n", __func__,
__LINE__);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} else { } else {
...@@ -101,7 +92,6 @@ int main(int argc, char *argv[]) { ...@@ -101,7 +92,6 @@ int main(int argc, char *argv[]) {
g_Dbs.db[0].dbName, g_Dbs.port); g_Dbs.db[0].dbName, g_Dbs.port);
querySqlFile(qtaos, g_args.sqlFile); querySqlFile(qtaos, g_args.sqlFile);
taos_close(qtaos); taos_close(qtaos);
} else { } else {
testCmdLine(); testCmdLine();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册