Paul Vriens : msi/tests: Skip tests on win9x by checking functionality instead of registry keys.

Alexandre Julliard julliard at winehq.org
Mon Nov 17 09:14:17 CST 2008


Module: wine
Branch: master
Commit: 3c533397e94e2e48fc201587b588ed373854178d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3c533397e94e2e48fc201587b588ed373854178d

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Sun Nov 16 14:35:50 2008 +0100

msi/tests: Skip tests on win9x by checking functionality instead of registry keys.

---

 dlls/msi/tests/install.c |   31 ++++++++++++++++++++-----------
 1 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index bc98840..56d36e1 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -44,6 +44,8 @@ static HMODULE hsrclient = 0;
 static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
 static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
 
+static BOOL on_win9x = FALSE;
+
 static const char *msifile = "msitest.msi";
 static const char *msifile2 = "winetest2.msi";
 static const char *mstfile = "winetest.mst";
@@ -1331,6 +1333,19 @@ static void init_functionpointers(void)
 #undef GET_PROC
 }
 
+static BOOL check_win9x(void)
+{
+    SC_HANDLE scm;
+
+    scm = OpenSCManager(NULL, NULL, GENERIC_ALL);
+    if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
+        return TRUE;
+
+    CloseServiceHandle(scm);
+
+    return FALSE;
+}
+
 static void get_user_sid(LPSTR *usersid)
 {
     HANDLE token;
@@ -1698,15 +1713,12 @@ static void test_MsiInstallProduct(void)
     LONG res;
     HKEY hkey;
     DWORD num, size, type;
-    SC_HANDLE scm;
 
-    scm = OpenSCManager(NULL, NULL, GENERIC_ALL);
-    if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
+    if (on_win9x)
     {
-        skip("Services are not implemented, we are most likely on win9x\n");
+        win_skip("Services are not implemented on Win9x and WinMe\n");
         return;
     }
-    CloseServiceHandle(scm);
 
     create_test_files();
     create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
@@ -5185,16 +5197,11 @@ static void test_MsiConfigureProductEx(void)
     CHAR keypath[MAX_PATH * 2];
     CHAR localpack[MAX_PATH];
 
-    /* skip these tests if we are on Win9x or WinMe */
-    lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\");
-    lstrcatA(keypath, "Installer\\UserData");
-    res = RegOpenKeyA(HKEY_LOCAL_MACHINE, keypath, &props);
-    if (res == ERROR_FILE_NOT_FOUND)
+    if (on_win9x)
     {
         win_skip("Different registry keys on Win9x and WinMe\n");
         return;
     }
-    RegCloseKey(props);
 
     CreateDirectoryA("msitest", NULL);
     create_file("msitest\\hydrogen", 500);
@@ -5613,6 +5620,8 @@ START_TEST(install)
 
     init_functionpointers();
 
+    on_win9x = check_win9x();
+
     GetCurrentDirectoryA(MAX_PATH, prev_path);
     GetTempPath(MAX_PATH, temp_path);
     SetCurrentDirectoryA(temp_path);




More information about the wine-cvs mailing list