提交 a39ec185 编写于 作者: H Haojun Liao

[td-11818] enable some unittest cases.

上级 3d2e4569
...@@ -49,101 +49,101 @@ int main(int argc, char** argv) { ...@@ -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);
//
// 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));
// }
//
// taos_free_result(pRes);
// taos_close(pConn);
//}
//
// TEST(testCase, create_account_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 account aabc 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, drop_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, "drop account aabc"); 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, 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;
// TEST(testCase, drop_user_Test) {
// TAOS_FIELD* pFields = taos_fetch_fields(pRes); TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
// int32_t numOfFields = taos_num_fields(pRes); assert(pConn != NULL);
//
// char str[512] = {0}; TAOS_RES* pRes = taos_query(pConn, "drop user abc");
// while((pRow = taos_fetch_row(pRes)) != NULL) { if (taos_errno(pRes) != TSDB_CODE_SUCCESS) {
// int32_t code = taos_print_row(str, pRow, pFields, numOfFields); printf("failed to create user, reason:%s\n", taos_errstr(pRes));
// printf("%s\n", str); }
// }
// taos_free_result(pRes);
// taos_close(pConn); taos_close(pConn);
//} }
//
// TEST(testCase, drop_user_Test) { TEST(testCase, show_db_Test) {
// TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0); TAOS* pConn = taos_connect("ubuntu", "root", "taosdata", NULL, 0);
// assert(pConn != NULL); // assert(pConn != NULL);
//
// TAOS_RES* pRes = taos_query(pConn, "drop user abc"); 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_db_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 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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册