psqlodbc.git / summary / log / commit / refs
commit e7ca897aa5f92aa1e2e3c62d2aff90ea5fc6a04d
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Mon Mar 24 06:49:26 2014 +0000
Avoid deprecated SQLAllocStmt/SQLFreeStmt in regression tests.
The deprecated functions have a test case of their own.
Michael Paquier
test/src/alter-test.c | 2 +-
test/src/arraybinding-test.c | 6 +++---
test/src/bindcol-test.c | 2 +-
test/src/boolsaschar-test.c | 2 +-
test/src/catalogfunctions-test.c | 2 +-
test/src/commands-test.c | 2 +-
test/src/common.c | 4 ++--
test/src/cte-test.c | 4 ++--
test/src/cursors-test.c | 2 +-
test/src/cvtnulldate-test.c | 2 +-
test/src/dataatexecution-test.c | 2 +-
test/src/deprecated-test.c | 2 +-
test/src/getresult-test.c | 2 +-
test/src/insertreturning-test.c | 6 +++---
test/src/lfconversion-test.c | 2 +-
test/src/multistmt-test.c | 2 +-
test/src/notice-test.c | 4 ++--
test/src/params-test.c | 2 +-
test/src/positioned-update-test.c | 2 +-
test/src/prepare-test.c | 4 ++--
test/src/quotes-test.c | 2 +-
test/src/select-test.c | 2 +-
test/src/stmthandles-test.c | 2 +-
23 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/test/src/alter-test.c b/test/src/alter-test.c
index b21a0b99..83991b8b 100644
--- a/test/src/alter-test.c
+++ b/test/src/alter-test.c
@@ -10,7 +10,7 @@ int main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/arraybinding-test.c b/test/src/arraybinding-test.c
index 9fcbe974..4db3b9bb 100644
--- a/test/src/arraybinding-test.c
+++ b/test/src/arraybinding-test.c
@@ -24,7 +24,7 @@ int main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
@@ -100,7 +100,7 @@ int main(int argc, char **argv)
rc = SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
CHECK_STMT_RESULT(rc, "SQLFreeHandle failed", hstmt);
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
@@ -198,7 +198,7 @@ int main(int argc, char **argv)
rc = SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
CHECK_STMT_RESULT(rc, "SQLFreeHandle failed", hstmt);
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/bindcol-test.c b/test/src/bindcol-test.c
index 0c0b42d1..7220dcc6 100644
--- a/test/src/bindcol-test.c
+++ b/test/src/bindcol-test.c
@@ -26,7 +26,7 @@ int main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/boolsaschar-test.c b/test/src/boolsaschar-test.c
index cd660f4f..90c646e9 100644
--- a/test/src/boolsaschar-test.c
+++ b/test/src/boolsaschar-test.c
@@ -16,7 +16,7 @@ int main(int argc, char **argv)
/* BoolsAsChar is the default, but just in case.. */
test_connect_ext("BoolsAsChar=1;UseServerSidePrepare=1");
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/catalogfunctions-test.c b/test/src/catalogfunctions-test.c
index 3d2d9ac3..f45e7bf3 100644
--- a/test/src/catalogfunctions-test.c
+++ b/test/src/catalogfunctions-test.c
@@ -33,7 +33,7 @@ main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/commands-test.c b/test/src/commands-test.c
index f0f11cab..96ca7ad2 100644
--- a/test/src/commands-test.c
+++ b/test/src/commands-test.c
@@ -14,7 +14,7 @@ int main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/common.c b/test/src/common.c
index 904b10d9..595bc42f 100644
--- a/test/src/common.c
+++ b/test/src/common.c
@@ -71,7 +71,7 @@ test_disconnect(void)
rc = SQLFreeHandle(SQL_HANDLE_DBC, conn);
if (!SQL_SUCCEEDED(rc))
{
- print_diag("SQLFreeConnect failed", SQL_HANDLE_DBC, conn);
+ print_diag("SQLFreeHandle failed", SQL_HANDLE_DBC, conn);
exit(1);
}
conn = NULL;
@@ -79,7 +79,7 @@ test_disconnect(void)
rc = SQLFreeHandle(SQL_HANDLE_ENV, env);
if (!SQL_SUCCEEDED(rc))
{
- print_diag("SQLFreeEnv failed", SQL_HANDLE_ENV, env);
+ print_diag("SQLFreeHandle failed", SQL_HANDLE_ENV, env);
exit(1);
}
env = NULL;
diff --git a/test/src/cte-test.c b/test/src/cte-test.c
index be740e1f..56603741 100644
--- a/test/src/cte-test.c
+++ b/test/src/cte-test.c
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
*/
test_connect_ext("UseDeclareFetch=0");
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
@@ -77,7 +77,7 @@ int main(int argc, char **argv)
/**** And then the same with UseDeclareFetch = 1 ****/
test_connect_ext("UseDeclareFetch=1;Fetch=1");
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/cursors-test.c b/test/src/cursors-test.c
index 201595d1..3fde5cb0 100644
--- a/test/src/cursors-test.c
+++ b/test/src/cursors-test.c
@@ -138,7 +138,7 @@ int main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/cvtnulldate-test.c b/test/src/cvtnulldate-test.c
index 3e1e1783..56c4af49 100644
--- a/test/src/cvtnulldate-test.c
+++ b/test/src/cvtnulldate-test.c
@@ -15,7 +15,7 @@ int main(int argc, char **argv)
test_connect_ext("AB=0x08;UseServerSidePrepare=1");
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/dataatexecution-test.c b/test/src/dataatexecution-test.c
index bd3ee13a..36627b0b 100644
--- a/test/src/dataatexecution-test.c
+++ b/test/src/dataatexecution-test.c
@@ -23,7 +23,7 @@ int main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/deprecated-test.c b/test/src/deprecated-test.c
index 923ac463..0883434a 100644
--- a/test/src/deprecated-test.c
+++ b/test/src/deprecated-test.c
@@ -307,7 +307,7 @@ main(int argc, char **argv)
/* Grab new connection and handle for the next tests */
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/getresult-test.c b/test/src/getresult-test.c
index 5967a5d3..2eeef7db 100644
--- a/test/src/getresult-test.c
+++ b/test/src/getresult-test.c
@@ -18,7 +18,7 @@ int main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/insertreturning-test.c b/test/src/insertreturning-test.c
index e0f8ef58..ef839e7f 100644
--- a/test/src/insertreturning-test.c
+++ b/test/src/insertreturning-test.c
@@ -18,7 +18,7 @@ int main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
@@ -75,10 +75,10 @@ int main(int argc, char **argv)
CHECK_STMT_RESULT(rc, "SQLFreeStmt failed", hstmt);
}
- rc = SQLFreeStmt(hstmt, SQL_DROP);
+ rc = SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
if (!SQL_SUCCEEDED(rc))
{
- print_diag("SQLFreeStmt failed", SQL_HANDLE_STMT, hstmt);
+ print_diag("SQLFreeHandle failed", SQL_HANDLE_STMT, hstmt);
exit(1);
}
diff --git a/test/src/lfconversion-test.c b/test/src/lfconversion-test.c
index 20f4b7fc..12893be3 100644
--- a/test/src/lfconversion-test.c
+++ b/test/src/lfconversion-test.c
@@ -23,7 +23,7 @@ int main(int argc, char **argv)
/* Enable LF -> CR+LF conversion */
test_connect_ext("CX=1");
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/multistmt-test.c b/test/src/multistmt-test.c
index cd55b669..f008050a 100644
--- a/test/src/multistmt-test.c
+++ b/test/src/multistmt-test.c
@@ -34,7 +34,7 @@ int main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/notice-test.c b/test/src/notice-test.c
index 777c7a8c..c4274f05 100644
--- a/test/src/notice-test.c
+++ b/test/src/notice-test.c
@@ -11,7 +11,7 @@ int main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
@@ -73,7 +73,7 @@ int main(int argc, char **argv)
if (rc == SQL_SUCCESS_WITH_INFO)
print_diag("got SUCCESS_WITH_INFO", SQL_HANDLE_STMT, hstmt);
- rc = SQLFreeStmt(hstmt, SQL_DROP);
+ rc = SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("SQLFreeStmt failed", SQL_HANDLE_STMT, hstmt);
diff --git a/test/src/params-test.c b/test/src/params-test.c
index eccd6263..df76d55f 100644
--- a/test/src/params-test.c
+++ b/test/src/params-test.c
@@ -19,7 +19,7 @@ int main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/positioned-update-test.c b/test/src/positioned-update-test.c
index 8b31233d..c66123f6 100644
--- a/test/src/positioned-update-test.c
+++ b/test/src/positioned-update-test.c
@@ -16,7 +16,7 @@ int main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/prepare-test.c b/test/src/prepare-test.c
index 0033caf7..f4e05ffb 100644
--- a/test/src/prepare-test.c
+++ b/test/src/prepare-test.c
@@ -18,7 +18,7 @@ int main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
@@ -231,7 +231,7 @@ int main(int argc, char **argv)
/* Fetch result */
print_result(hstmt);
- rc = SQLFreeStmt(hstmt, SQL_DROP);
+ rc = SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("SQLFreeStmt failed", SQL_HANDLE_STMT, hstmt);
diff --git a/test/src/quotes-test.c b/test/src/quotes-test.c
index 6c3238ce..0157d148 100644
--- a/test/src/quotes-test.c
+++ b/test/src/quotes-test.c
@@ -47,7 +47,7 @@ int main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/select-test.c b/test/src/select-test.c
index e4f09121..adeb80ef 100644
--- a/test/src/select-test.c
+++ b/test/src/select-test.c
@@ -14,7 +14,7 @@ int main(int argc, char **argv)
test_connect();
- rc = SQLAllocStmt(conn, &hstmt);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt);
if (!SQL_SUCCEEDED(rc))
{
print_diag("failed to allocate stmt handle", SQL_HANDLE_DBC, conn);
diff --git a/test/src/stmthandles-test.c b/test/src/stmthandles-test.c
index 3f8db14a..15b378ef 100644
--- a/test/src/stmthandles-test.c
+++ b/test/src/stmthandles-test.c
@@ -29,7 +29,7 @@ int main(int argc, char **argv)
/* Allocate a lot of stmt handles */
for (i = 0; i < NUM_STMT_HANDLES; i++)
{
- rc = SQLAllocStmt(conn, &hstmt[i]);
+ rc = SQLAllocHandle(SQL_HANDLE_STMT, conn, &hstmt[i]);
if (!SQL_SUCCEEDED(rc))
{
printf("failed to allocate stmt handle %d\n", i + 1);
[parent: 1a9c12729e7a]