From 7bf7340eb6e7135d45c7f233649cfe4989eaf3d2 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Sat, 14 May 2022 12:16:46 +0200 Subject: [PATCH] msi/tests: Fix an intermittent test failure. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52993 Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/msi/tests/action.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c index 224637eb286..e5c862e206c 100644 --- a/dlls/msi/tests/action.c +++ b/dlls/msi/tests/action.c @@ -3690,9 +3690,10 @@ static void test_publish(void) LONG res; HKEY uninstall, prodkey, uninstall_32node = NULL; INSTALLSTATE state; - char date[MAX_PATH], temp[MAX_PATH], prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"; + char date[MAX_PATH], date2[MAX_PATH], temp[MAX_PATH], buf[MAX_PATH]; + const char prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"; REGSAM access = KEY_ALL_ACCESS; - DWORD error; + DWORD error, type, size; if (!pMsiQueryFeatureStateExA) { @@ -4216,7 +4217,15 @@ static void test_publish(void) CHECK_REG_STR(prodkey, "DisplayName", "MSITEST"); CHECK_REG_STR(prodkey, "DisplayVersion", "1.1.1"); - CHECK_REG_STR(prodkey, "InstallDate", date); + + get_date_str(date2); + size = ARRAY_SIZE(buf); + buf[0] = '\0'; + res = RegQueryValueExA(prodkey, "InstallDate", NULL, &type, (BYTE *)buf, &size); + ok(!res, "Failed to query value, error %ld\n", res); + ok(type == REG_SZ, "Got wrong type %lu\n", type); + ok(!strcmp(buf, date) || !strcmp(buf, date2), "got %s\n", debugstr_a(buf)); + CHECK_REG_STR(prodkey, "InstallSource", temp); CHECK_REG_ISTR(prodkey, "ModifyPath", "MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"); CHECK_REG_STR(prodkey, "Publisher", "Wine");