[td-11818] enable some unittest cases.
This commit is contained in:
parent
3d2e4569c1
commit
a39ec185dc
|
@ -49,101 +49,101 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
TEST(testCase, driverInit_Test) { taos_init(); }
|
TEST(testCase, driverInit_Test) { taos_init(); }
|
||||||
|
|
||||||
// TEST(testCase, connect_Test) {
|
TEST(testCase, connect_Test) {
|
||||||
// TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
||||||
//// assert(pConn != NULL);
|
|
||||||
// taos_close(pConn);
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
// TEST(testCase, create_user_Test) {
|
|
||||||
// TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
|
||||||
// assert(pConn != NULL);
|
// assert(pConn != NULL);
|
||||||
//
|
taos_close(pConn);
|
||||||
// TAOS_RES* pRes = taos_query(pConn, "create user abc pass 'abc'");
|
}
|
||||||
// if (taos_errno(pRes) != TSDB_CODE_SUCCESS) {
|
|
||||||
// printf("failed to create user, reason:%s\n", taos_errstr(pRes));
|
TEST(testCase, create_user_Test) {
|
||||||
// }
|
TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
||||||
//
|
assert(pConn != NULL);
|
||||||
// taos_free_result(pRes);
|
|
||||||
// taos_close(pConn);
|
TAOS_RES* pRes = taos_query(pConn, "create user abc pass 'abc'");
|
||||||
//}
|
if (taos_errno(pRes) != TSDB_CODE_SUCCESS) {
|
||||||
//
|
printf("failed to create user, reason:%s\n", taos_errstr(pRes));
|
||||||
// TEST(testCase, create_account_Test) {
|
}
|
||||||
// TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
|
||||||
|
taos_free_result(pRes);
|
||||||
|
taos_close(pConn);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(testCase, create_account_Test) {
|
||||||
|
TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
||||||
|
assert(pConn != NULL);
|
||||||
|
|
||||||
|
TAOS_RES* pRes = taos_query(pConn, "create account aabc pass 'abc'");
|
||||||
|
if (taos_errno(pRes) != TSDB_CODE_SUCCESS) {
|
||||||
|
printf("failed to create user, reason:%s\n", taos_errstr(pRes));
|
||||||
|
}
|
||||||
|
|
||||||
|
taos_free_result(pRes);
|
||||||
|
taos_close(pConn);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(testCase, drop_account_Test) {
|
||||||
|
TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
||||||
|
assert(pConn != NULL);
|
||||||
|
|
||||||
|
TAOS_RES* pRes = taos_query(pConn, "drop account aabc");
|
||||||
|
if (taos_errno(pRes) != TSDB_CODE_SUCCESS) {
|
||||||
|
printf("failed to create user, reason:%s\n", taos_errstr(pRes));
|
||||||
|
}
|
||||||
|
|
||||||
|
taos_free_result(pRes);
|
||||||
|
taos_close(pConn);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(testCase, show_user_Test) {
|
||||||
|
TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
||||||
// assert(pConn != NULL);
|
// assert(pConn != NULL);
|
||||||
//
|
|
||||||
// TAOS_RES* pRes = taos_query(pConn, "create account aabc pass 'abc'");
|
TAOS_RES* pRes = taos_query(pConn, "show users");
|
||||||
// if (taos_errno(pRes) != TSDB_CODE_SUCCESS) {
|
TAOS_ROW pRow = NULL;
|
||||||
// printf("failed to create user, reason:%s\n", taos_errstr(pRes));
|
|
||||||
// }
|
TAOS_FIELD* pFields = taos_fetch_fields(pRes);
|
||||||
//
|
int32_t numOfFields = taos_num_fields(pRes);
|
||||||
// taos_free_result(pRes);
|
|
||||||
// taos_close(pConn);
|
char str[512] = {0};
|
||||||
//}
|
while((pRow = taos_fetch_row(pRes)) != NULL) {
|
||||||
//
|
int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
|
||||||
// TEST(testCase, drop_account_Test) {
|
printf("%s\n", str);
|
||||||
// TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
}
|
||||||
|
|
||||||
|
taos_close(pConn);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(testCase, drop_user_Test) {
|
||||||
|
TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
||||||
|
assert(pConn != NULL);
|
||||||
|
|
||||||
|
TAOS_RES* pRes = taos_query(pConn, "drop user abc");
|
||||||
|
if (taos_errno(pRes) != TSDB_CODE_SUCCESS) {
|
||||||
|
printf("failed to create user, reason:%s\n", taos_errstr(pRes));
|
||||||
|
}
|
||||||
|
|
||||||
|
taos_free_result(pRes);
|
||||||
|
taos_close(pConn);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(testCase, show_db_Test) {
|
||||||
|
TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
||||||
// assert(pConn != NULL);
|
// assert(pConn != NULL);
|
||||||
//
|
|
||||||
// TAOS_RES* pRes = taos_query(pConn, "drop account aabc");
|
TAOS_RES* pRes = taos_query(pConn, "show databases");
|
||||||
// if (taos_errno(pRes) != TSDB_CODE_SUCCESS) {
|
TAOS_ROW pRow = NULL;
|
||||||
// printf("failed to create user, reason:%s\n", taos_errstr(pRes));
|
|
||||||
// }
|
TAOS_FIELD* pFields = taos_fetch_fields(pRes);
|
||||||
//
|
int32_t numOfFields = taos_num_fields(pRes);
|
||||||
// taos_free_result(pRes);
|
|
||||||
// taos_close(pConn);
|
char str[512] = {0};
|
||||||
//}
|
while((pRow = taos_fetch_row(pRes)) != NULL) {
|
||||||
//
|
int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
|
||||||
// TEST(testCase, show_user_Test) {
|
printf("%s\n", str);
|
||||||
// TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
}
|
||||||
//// assert(pConn != NULL);
|
|
||||||
//
|
taos_close(pConn);
|
||||||
// TAOS_RES* pRes = taos_query(pConn, "show users");
|
}
|
||||||
// TAOS_ROW pRow = NULL;
|
|
||||||
//
|
|
||||||
// TAOS_FIELD* pFields = taos_fetch_fields(pRes);
|
|
||||||
// int32_t numOfFields = taos_num_fields(pRes);
|
|
||||||
//
|
|
||||||
// char str[512] = {0};
|
|
||||||
// while((pRow = taos_fetch_row(pRes)) != NULL) {
|
|
||||||
// int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
|
|
||||||
// printf("%s\n", str);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// taos_close(pConn);
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
// TEST(testCase, drop_user_Test) {
|
|
||||||
// TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
|
||||||
// assert(pConn != NULL);
|
|
||||||
//
|
|
||||||
// TAOS_RES* pRes = taos_query(pConn, "drop user abc");
|
|
||||||
// if (taos_errno(pRes) != TSDB_CODE_SUCCESS) {
|
|
||||||
// printf("failed to create user, reason:%s\n", taos_errstr(pRes));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// taos_free_result(pRes);
|
|
||||||
// taos_close(pConn);
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
// TEST(testCase, show_db_Test) {
|
|
||||||
// TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
|
||||||
//// assert(pConn != NULL);
|
|
||||||
//
|
|
||||||
// TAOS_RES* pRes = taos_query(pConn, "show databases");
|
|
||||||
// TAOS_ROW pRow = NULL;
|
|
||||||
//
|
|
||||||
// TAOS_FIELD* pFields = taos_fetch_fields(pRes);
|
|
||||||
// int32_t numOfFields = taos_num_fields(pRes);
|
|
||||||
//
|
|
||||||
// char str[512] = {0};
|
|
||||||
// while((pRow = taos_fetch_row(pRes)) != NULL) {
|
|
||||||
// int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
|
|
||||||
// printf("%s\n", str);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// taos_close(pConn);
|
|
||||||
//}
|
|
||||||
|
|
||||||
TEST(testCase, create_db_Test) {
|
TEST(testCase, create_db_Test) {
|
||||||
TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
|
||||||
|
|
Loading…
Reference in New Issue