https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d15d81da99ace72ddf246…
commit d15d81da99ace72ddf24662e5af83d2825644455
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sat Mar 12 15:12:24 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:27:48 2022 +0100
[WINESYNC] msi/tests: Test installation of ODBC driver.
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 7f69ea3c57b9caa0fd39e6cb3c0164d7b37aa21b by Zebediah Figura
<z.figura12(a)gmail.com>
---
modules/rostests/winetests/msi/CMakeLists.txt | 2 +-
modules/rostests/winetests/msi/action.c | 35 +++++++++++++++++++++++++++
2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/modules/rostests/winetests/msi/CMakeLists.txt
b/modules/rostests/winetests/msi/CMakeLists.txt
index 5090555bf35..e44cb08c6f8 100644
--- a/modules/rostests/winetests/msi/CMakeLists.txt
+++ b/modules/rostests/winetests/msi/CMakeLists.txt
@@ -43,7 +43,7 @@ endif()
target_link_libraries(msi_winetest uuid)
set_module_type(msi_winetest win32cui)
-add_importlibs(msi_winetest cabinet msi shell32 ole32 oleaut32 user32 advapi32 version
msvcrt kernel32)
+add_importlibs(msi_winetest cabinet msi shell32 ole32 oleaut32 odbccp32 user32 advapi32
version msvcrt kernel32)
add_pch(msi_winetest precomp.h "${PCH_SKIP_SOURCE}")
add_rostests_file(TARGET msi_winetest)
add_dependencies(msi_winetest custom)
diff --git a/modules/rostests/winetests/msi/action.c
b/modules/rostests/winetests/msi/action.c
index d2fad6cf812..e33decc5733 100644
--- a/modules/rostests/winetests/msi/action.c
+++ b/modules/rostests/winetests/msi/action.c
@@ -32,6 +32,7 @@
#include <wtypes.h>
#include <shellapi.h>
#include <winsvc.h>
+#include <odbcinst.h>
#include "wine/test.h"
#include "utils.h"
@@ -825,18 +826,22 @@ static const char odbc_feature_comp_dat[] =
"Feature_\tComponent_\n"
"s38\ts72\n"
"FeatureComponents\tFeature_\tComponent_\n"
+ "odbc\todbc64\n"
"odbc\todbc\n";
static const char odbc_component_dat[] =
"Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
"s72\tS38\ts72\ti2\tS255\tS72\n"
"Component\tComponent\n"
+
"odbc64\t{B6F3E4AF-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t256\tMsix64\tODBCdriver.dll\n"
"odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n";
static const char odbc_driver_dat[] =
"Driver\tComponent_\tDescription\tFile_\tFile_Setup\n"
"s72\ts72\ts255\ts72\tS72\n"
"ODBCDriver\tDriver\n"
+ "64-bit driver\todbc64\tODBC test driver\tODBCdriver.dll\t\n"
+ "64-bit driver2\todbc64\tODBC test
driver2\tODBCdriver2.dll\tODBCsetup.dll\n"
"ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n"
"ODBC test driver2\todbc\tODBC test
driver2\tODBCdriver2.dll\tODBCsetup.dll\n";
@@ -5347,6 +5352,9 @@ error:
static void test_install_remove_odbc(void)
{
+ int gotdriver = 0, gotdriver2 = 0;
+ char buffer[1000], *p;
+ WORD len;
UINT r;
if (is_process_limited())
@@ -5379,6 +5387,19 @@ static void test_install_remove_odbc(void)
ok(pf_exists("msitest\\ODBCtranslator2.dll"), "file not
created\n");
ok(pf_exists("msitest\\ODBCsetup.dll"), "file not created\n");
+ r = SQLGetInstalledDrivers(buffer, sizeof(buffer), &len);
+ ok(len < sizeof(buffer), "buffer too small\n");
+ ok(r, "SQLGetInstalledDrivers failed\n");
+ for (p = buffer; *p; p += strlen(p) + 1)
+ {
+ if (!strcmp(p, "ODBC test driver"))
+ gotdriver = 1;
+ if (!strcmp(p, "ODBC test driver2"))
+ gotdriver2 = 1;
+ }
+ ok(gotdriver, "driver not installed\n");
+ ok(gotdriver2, "driver 2 not installed\n");
+
r = MsiInstallProductA(msifile, "REMOVE=ALL");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@@ -5389,6 +5410,20 @@ static void test_install_remove_odbc(void)
ok(!delete_pf("msitest\\ODBCsetup.dll", TRUE), "file not
removed\n");
ok(!delete_pf("msitest", FALSE), "directory not removed\n");
+ gotdriver = gotdriver2 = 0;
+ r = SQLGetInstalledDrivers(buffer, sizeof(buffer), &len);
+ ok(len < sizeof(buffer), "buffer too small\n");
+ ok(r, "SQLGetInstalledDrivers failed\n");
+ for (p = buffer; *p; p += strlen(p) + 1)
+ {
+ if (!strcmp(p, "ODBC test driver"))
+ gotdriver = 1;
+ if (!strcmp(p, "ODBC test driver2"))
+ gotdriver2 = 1;
+ }
+ ok(!gotdriver, "driver not installed\n");
+ ok(!gotdriver2, "driver 2 not installed\n");
+
error:
DeleteFileA("msitest\\ODBCdriver.dll");
DeleteFileA("msitest\\ODBCdriver2.dll");