Hans Leidekker : msi/tests: Avoid test failures when running with insufficient rights.
Module: wine Branch: master Commit: 79ec3d9fb8551e84e9ff71dcf18861430246278a URL: https://gitlab.winehq.org/wine/wine/-/commit/79ec3d9fb8551e84e9ff71dcf188614... Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Jan 31 16:34:06 2023 +0100 msi/tests: Avoid test failures when running with insufficient rights. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51040 --- dlls/msi/tests/package.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index cad396aa05a..43ee28fdc21 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -5066,6 +5066,7 @@ static void test_appsearch_inilocator(void) } ok(r == ERROR_SUCCESS, "Expected a valid package handle %u\n", r); + MsiCloseHandle( hdb ); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); r = MsiDoActionA(hpkg, "AppSearch"); @@ -5074,6 +5075,12 @@ static void test_appsearch_inilocator(void) size = MAX_PATH; r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + if (!prop[0]) + { + win_skip("broken result\n"); + MsiCloseHandle(hpkg); + goto error; + } ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop); size = MAX_PATH; @@ -5628,7 +5635,12 @@ static void test_installprops(void) ok( !lstrcmpA(buf, path), "Expected %s, got %s\n", path, buf); RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\MS Setup (ACME)\\User Info", &hkey1); - RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey2); + res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, access, &hkey2); + if (res == ERROR_ACCESS_DENIED) + { + win_skip("no access\n"); + goto done; + } RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion", 0, KEY_QUERY_VALUE | KEY_WOW64_64KEY, &pathkey); @@ -5800,6 +5812,7 @@ static void test_installprops(void) check_prop(hpkg, "CommonFiles64Dir", "", 0, 0); } +done: CloseHandle(hkey1); CloseHandle(hkey2); RegCloseKey(pathkey);
participants (1)
-
Alexandre Julliard