@@ -51,7 +51,42 @@ TEST(SQLAllocEnv, TestSQLAllocEnv) {
5151 EXPECT_TRUE (return_value == SQL_SUCCESS);
5252}
5353
54+ TEST (SQLAllocHandle, TestSQLAllocHandleConnect) {
55+
56+ // ODBC Environment
57+ SQLHENV env;
58+ SQLHDBC conn;
59+
60+ // Allocate an environment handle
61+ SQLRETURN return_value = SQLAllocEnv (&env);
62+
63+ EXPECT_TRUE (return_value == SQL_SUCCESS);
64+
65+ // Allocate a connection using alloc handle
66+ SQLRETURN return_alloc_handle = SQLAllocHandle (SQL_HANDLE_DBC, env, &conn);
67+
68+ EXPECT_TRUE (return_alloc_handle == SQL_SUCCESS);
69+ }
70+
71+ TEST (SQLAllocConnect, TestSQLAllocHandleConnect) {
72+
73+ // ODBC Environment
74+ SQLHENV env;
75+ SQLHDBC conn;
76+
77+ // Allocate an environment handle
78+ SQLRETURN return_value = SQLAllocEnv (&env);
79+
80+ EXPECT_TRUE (return_value == SQL_SUCCESS);
81+
82+ // Allocate a connection using alloc handle
83+ SQLRETURN return_alloc_connect = SQLAllocConnect (env, &conn);
84+
85+ EXPECT_TRUE (return_alloc_connect == SQL_SUCCESS);
86+ }
87+
5488TEST (SQLFreeHandle, TestSQLFreeHandleEnv) {
89+
5590 // ODBC Environment
5691 SQLHENV env;
5792
@@ -65,6 +100,7 @@ TEST(SQLFreeHandle, TestSQLFreeHandleEnv) {
65100}
66101
67102TEST (SQLFreeEnv, TestSQLFreeEnv) {
103+
68104 // ODBC Environment
69105 SQLHENV env;
70106
@@ -77,6 +113,50 @@ TEST(SQLFreeEnv, TestSQLFreeEnv) {
77113 EXPECT_TRUE (return_value == SQL_SUCCESS);
78114}
79115
116+ TEST (SQLFreeHandle, TestSQLFreeHandleConnect) {
117+
118+ // ODBC Environment
119+ SQLHENV env;
120+ SQLHDBC conn;
121+
122+ // Allocate an environment handle
123+ SQLRETURN return_value = SQLAllocEnv (&env);
124+
125+ EXPECT_TRUE (return_value == SQL_SUCCESS);
126+
127+ // Allocate a connection using alloc handle
128+ SQLRETURN return_alloc_handle = SQLAllocHandle (SQL_HANDLE_DBC, env, &conn);
129+
130+ EXPECT_TRUE (return_alloc_handle == SQL_SUCCESS);
131+
132+ // Free the created connection using free handle
133+ SQLRETURN return_free_handle = SQLFreeHandle (SQL_HANDLE_DBC, conn);
134+
135+ EXPECT_TRUE (return_free_handle == SQL_SUCCESS);
136+ }
137+
138+ TEST (SQLFreeConnect, TestSQLFreeConnect) {
139+
140+ // ODBC Environment
141+ SQLHENV env;
142+ SQLHDBC conn;
143+
144+ // Allocate an environment handle
145+ SQLRETURN return_env = SQLAllocEnv (&env);
146+
147+ EXPECT_TRUE (return_env == SQL_SUCCESS);
148+
149+ // Allocate a connection using alloc handle
150+ SQLRETURN return_alloc_handle = SQLAllocHandle (SQL_HANDLE_DBC, env, &conn);
151+
152+ EXPECT_TRUE (return_alloc_handle == SQL_SUCCESS);
153+
154+ // Free the created connection using free connect
155+ SQLRETURN return_free_connect = SQLFreeConnect (conn);
156+
157+ EXPECT_TRUE (return_free_connect == SQL_SUCCESS);
158+ }
159+
80160} // namespace integration_tests
81161} // namespace odbc
82162} // namespace flight
0 commit comments