Rebase against 6a31983779479b42e0c2e5320a1dfa962767c28e.

This commit is contained in:
Alistair Leslie-Hughes 2024-05-15 08:24:14 +10:00
parent f76ea979db
commit d8260944be
4 changed files with 5551 additions and 1955 deletions

View File

@ -1,113 +1,51 @@
From 9491dc2b72947bef59d8fb191fdc27a96bcc1c68 Mon Sep 17 00:00:00 2001
From b129fd1a7b4de4959f8929f03ece4688b3e1a6fd Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 3 Feb 2023 14:16:21 +1100
Subject: [PATCH] odbc32: Add initial tests
---
configure | 1 +
configure.ac | 1 +
dlls/odbc32/tests/Makefile.in | 5 +
dlls/odbc32/tests/connection.c | 165 +++++++++++++++++++++++++++++++++
4 files changed, 172 insertions(+)
create mode 100644 dlls/odbc32/tests/Makefile.in
create mode 100644 dlls/odbc32/tests/connection.c
dlls/odbc32/tests/odbc32.c | 52 +++++++++++++++++++++++++++++++++++++-
1 file changed, 51 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index ca6e87d4740..027f3fbe53d 100755
--- a/configure
+++ b/configure
@@ -22137,6 +22137,7 @@ wine_fn_config_makefile dlls/ntprint enable_ntprint
wine_fn_config_makefile dlls/ntprint/tests enable_tests
wine_fn_config_makefile dlls/objsel enable_objsel
wine_fn_config_makefile dlls/odbc32 enable_odbc32
+wine_fn_config_makefile dlls/odbc32/tests enable_tests
wine_fn_config_makefile dlls/odbcbcp enable_odbcbcp
wine_fn_config_makefile dlls/odbccp32 enable_odbccp32
wine_fn_config_makefile dlls/odbccp32/tests enable_tests
diff --git a/configure.ac b/configure.ac
index cba55126869..fc09d145ee7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2954,6 +2954,7 @@ WINE_CONFIG_MAKEFILE(dlls/ntprint)
WINE_CONFIG_MAKEFILE(dlls/ntprint/tests)
WINE_CONFIG_MAKEFILE(dlls/objsel)
WINE_CONFIG_MAKEFILE(dlls/odbc32)
+WINE_CONFIG_MAKEFILE(dlls/odbc32/tests)
WINE_CONFIG_MAKEFILE(dlls/odbcbcp)
WINE_CONFIG_MAKEFILE(dlls/odbccp32)
WINE_CONFIG_MAKEFILE(dlls/odbccp32/tests)
diff --git a/dlls/odbc32/tests/Makefile.in b/dlls/odbc32/tests/Makefile.in
new file mode 100644
index 00000000000..d7a300417a0
--- /dev/null
+++ b/dlls/odbc32/tests/Makefile.in
@@ -0,0 +1,5 @@
+TESTDLL = odbc32.dll
+IMPORTS = odbc32
+
+SOURCES = \
+ connection.c
diff --git a/dlls/odbc32/tests/connection.c b/dlls/odbc32/tests/connection.c
new file mode 100644
index 00000000000..b04d93c42c5
--- /dev/null
+++ b/dlls/odbc32/tests/connection.c
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2018 Alistair Leslie-Hughes
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <wine/test.h>
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "sqlext.h"
+#include "sqlucode.h"
+#include "odbcinst.h"
+
+static void test_SQLAllocEnv(void)
+{
+ SQLRETURN ret;
+ SQLHENV sqlenv, sqlenv2;
+
+ ret = SQLAllocEnv(NULL);
+ ok(ret == SQL_ERROR, "got %d\n", ret);
+
+ ret = SQLAllocEnv(&sqlenv);
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
+
+ ret = SQLAllocEnv(&sqlenv2);
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
+ ok(sqlenv != sqlenv2, "got %d\n", ret);
+
+ ret = SQLFreeEnv(sqlenv2);
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
+
+ ret = SQLFreeEnv(sqlenv);
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
+
+ ret = SQLFreeEnv(sqlenv);
+ todo_wine ok(ret == SQL_INVALID_HANDLE, "got %d\n", ret);
+
+ ret = SQLFreeEnv(SQL_NULL_HENV);
+ todo_wine ok(ret == SQL_INVALID_HANDLE, "got %d\n", ret);
+}
diff --git a/dlls/odbc32/tests/odbc32.c b/dlls/odbc32/tests/odbc32.c
index 8a744f23834..7e1f62e559f 100644
--- a/dlls/odbc32/tests/odbc32.c
+++ b/dlls/odbc32/tests/odbc32.c
@@ -28,7 +28,7 @@
static void test_SQLAllocHandle( void )
{
SQLHANDLE handle;
- SQLHENV env;
+ SQLHENV env, env2;
SQLHDBC con;
SQLRETURN ret;
@@ -46,6 +46,12 @@ static void test_SQLAllocHandle( void )
ok( ret == SQL_SUCCESS, "got %d\n", ret );
ok( env != (void *)0xdeadbeef, "env not set\n" );
+ env2 = (void *)0xdeadbeef;
+ ret = SQLAllocEnv( &env2 );
+ ok( ret == SQL_SUCCESS, "got %d\n", ret );
+ ok( env2 != (void *)0xdeadbeef, "env2 not set\n" );
+ ok( env2 != env, "environment is the same\n" );
+
con = (void *)0xdeadbeef;
ret = SQLAllocConnect( env, &con );
ok( ret == SQL_SUCCESS, "got %d\n", ret );
@@ -57,6 +63,8 @@ static void test_SQLAllocHandle( void )
ok( ret == SQL_INVALID_HANDLE, "got %d\n", ret );
ret = SQLFreeEnv( env );
ok( ret == SQL_SUCCESS, "got %d\n", ret );
+ ret = SQLFreeEnv( env2 );
+ ok( ret == SQL_SUCCESS, "got %d\n", ret );
ret = SQLFreeEnv( 0 );
ok( ret == SQL_INVALID_HANDLE, "got %d\n", ret );
}
@@ -302,6 +310,47 @@ static void test_SQLExecDirect( void )
ok( ret == SQL_SUCCESS, "got %d\n", ret );
}
+void test_SQLGetEnvAttr(void)
+{
+ SQLRETURN ret;
@ -149,75 +87,15 @@ index 00000000000..b04d93c42c5
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
+}
+
+static void test_SQLDriver(void)
+{
+ SQLHENV henv = SQL_NULL_HENV;
+ SQLRETURN ret;
+ SQLCHAR driver[256];
+ SQLCHAR attr[256];
+ SQLSMALLINT driver_ret;
+ SQLSMALLINT attr_ret;
+ SQLUSMALLINT direction;
+
+ ret = SQLAllocEnv(&henv);
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
+ ok(henv != SQL_NULL_HENV, "NULL handle\n");
+
+ direction = SQL_FETCH_FIRST;
+
+ while(SQL_SUCCEEDED(ret = SQLDrivers(henv, direction, driver, sizeof(driver),
+ &driver_ret, attr, sizeof(attr), &attr_ret)))
+ {
+ direction = SQL_FETCH_NEXT;
+
+ trace("%s - %s\n", driver, attr);
+ }
+ todo_wine ok(ret == SQL_NO_DATA, "got %d\n", ret);
+
+ ret = SQLFreeEnv(henv);
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
+}
+
+static void test_SQLGetDiagRec(void)
+{
+ SQLHENV henv = SQL_NULL_HENV;
+ SQLHDBC connection;
+ SQLRETURN ret;
+ WCHAR version[11];
+ WCHAR SqlState[6], Msg[SQL_MAX_MESSAGE_LENGTH];
+ SQLINTEGER NativeError;
+ SQLSMALLINT MsgLen;
+
+ ret = SQLAllocEnv(&henv);
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
+ ok(henv != SQL_NULL_HENV, "NULL handle\n");
+
+ ret = SQLAllocConnect(henv, &connection);
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
+
+ ret = SQLGetInfoW(connection, SQL_ODBC_VER, version, 22, NULL);
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
+ trace("ODBC_VER=%s\n", wine_dbgstr_w(version));
+
+ ret = SQLFreeConnect(connection);
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
+
+ NativeError = 88;
+ ret = SQLGetDiagRecW( SQL_HANDLE_ENV, henv, 1, SqlState, &NativeError, Msg, sizeof(Msg), &MsgLen);
+ todo_wine ok(ret == SQL_NO_DATA, "got %d\n", ret);
+ ok(NativeError == 88, "got %d\n", NativeError);
+
+ ret = SQLFreeEnv(henv);
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
+}
+
+START_TEST(connection)
+{
+ test_SQLAllocEnv();
START_TEST(odbc32)
{
test_SQLAllocHandle();
@@ -309,4 +358,5 @@ START_TEST(odbc32)
test_SQLDataSources();
test_SQLDrivers();
test_SQLExecDirect();
+ test_SQLGetEnvAttr();
+ test_SQLDriver();
+ test_SQLGetDiagRec();
+}
}
--
2.43.0

View File

@ -1,4 +1,4 @@
From 5e22907c02cb6778555995421a0b8eb8e382ff3a Mon Sep 17 00:00:00 2001
From 98419c58be94ecff277ad08c503affd6ffa133ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 16 Mar 2014 03:19:39 +0100
Subject: [PATCH] wineboot: Add some generic hardware in HKEY_DYN_DATA\Config
@ -9,11 +9,11 @@ Subject: [PATCH] wineboot: Add some generic hardware in HKEY_DYN_DATA\Config
1 file changed, 100 insertions(+)
diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c
index 728c41fffa9..beb29db4653 100644
index dfa3f6dd738..77708b40122 100644
--- a/programs/wineboot/wineboot.c
+++ b/programs/wineboot/wineboot.c
@@ -763,16 +763,116 @@ static void create_hardware_registry_keys(void)
free( power_info );
@@ -912,16 +912,116 @@ static void create_hardware_registry_keys(void)
free( buf );
}
+struct dyndata_enum_key{
@ -128,7 +128,7 @@ index 728c41fffa9..beb29db4653 100644
+ }
}
/* create the platform-specific environment registry keys */
/* create the ComputerName registry keys */
--
2.40.1
2.43.0

View File

@ -1 +1 @@
040b2a9c75666527af6ca79d9146095c8ed6a3cf
6a31983779479b42e0c2e5320a1dfa962767c28e