msi/tests: Avoid test failures caused by broken MsiGetFileVersionA.
This commit is contained in:
parent
cd51d513c4
commit
407584fd3e
|
@ -4010,8 +4010,15 @@ static void test_MsiGetFileVersion(void)
|
||||||
lstrcpyA(lang, "lang");
|
lstrcpyA(lang, "lang");
|
||||||
r = MsiGetFileVersionA(path, version, &versz, lang, &langsz);
|
r = MsiGetFileVersionA(path, version, &versz, lang, &langsz);
|
||||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
if (langchecksz && !langsz)
|
||||||
|
{
|
||||||
|
win_skip("broken MsiGetFileVersionA detected\n");
|
||||||
|
HeapFree(GetProcessHeap(), 0, vercheck);
|
||||||
|
HeapFree(GetProcessHeap(), 0, langcheck);
|
||||||
|
return;
|
||||||
|
}
|
||||||
ok(versz == verchecksz, "Expected %d, got %d\n", verchecksz, versz);
|
ok(versz == verchecksz, "Expected %d, got %d\n", verchecksz, versz);
|
||||||
ok(strstr(lang, langcheck) != NULL, "Expected %s in %s\n", langcheck, lang);
|
ok(strstr(lang, langcheck) != NULL, "Expected \"%s\" in \"%s\"\n", langcheck, lang);
|
||||||
ok(!lstrcmpA(version, vercheck),
|
ok(!lstrcmpA(version, vercheck),
|
||||||
"Expected %s, got %s\n", vercheck, version);
|
"Expected %s, got %s\n", vercheck, version);
|
||||||
|
|
||||||
|
@ -4029,7 +4036,7 @@ static void test_MsiGetFileVersion(void)
|
||||||
lstrcpyA(lang, "lang");
|
lstrcpyA(lang, "lang");
|
||||||
r = MsiGetFileVersionA(path, NULL, NULL, lang, &langsz);
|
r = MsiGetFileVersionA(path, NULL, NULL, lang, &langsz);
|
||||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
ok(strstr(lang, langcheck) != NULL, "Expected %s in %s\n", langcheck, lang);
|
ok(strstr(lang, langcheck) != NULL, "Expected \"%s\" in \"%s\"\n", langcheck, lang);
|
||||||
|
|
||||||
/* check neither version nor language */
|
/* check neither version nor language */
|
||||||
r = MsiGetFileVersionA(path, NULL, NULL, NULL, NULL);
|
r = MsiGetFileVersionA(path, NULL, NULL, NULL, NULL);
|
||||||
|
@ -4053,7 +4060,7 @@ static void test_MsiGetFileVersion(void)
|
||||||
r = MsiGetFileVersionA(path, version, &versz, NULL, NULL);
|
r = MsiGetFileVersionA(path, version, &versz, NULL, NULL);
|
||||||
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
|
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
|
||||||
ok(!strncmp(version, vercheck, 4),
|
ok(!strncmp(version, vercheck, 4),
|
||||||
"Expected first 4 characters of %s, got %s\n", vercheck, version);
|
"Expected first 4 characters of \"%s\", got \"%s\"\n", vercheck, version);
|
||||||
ok(versz == verchecksz, "Expected %d, got %d\n", verchecksz, versz);
|
ok(versz == verchecksz, "Expected %d, got %d\n", verchecksz, versz);
|
||||||
|
|
||||||
/* pcchLangBuf not big enough */
|
/* pcchLangBuf not big enough */
|
||||||
|
@ -4062,7 +4069,7 @@ static void test_MsiGetFileVersion(void)
|
||||||
r = MsiGetFileVersionA(path, NULL, NULL, lang, &langsz);
|
r = MsiGetFileVersionA(path, NULL, NULL, lang, &langsz);
|
||||||
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
|
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
|
||||||
ok(!strncmp(lang, langcheck, 2),
|
ok(!strncmp(lang, langcheck, 2),
|
||||||
"Expected first character of %s, got %s\n", langcheck, lang);
|
"Expected first character of \"%s\", got \"%s\"\n", langcheck, lang);
|
||||||
ok(langsz >= langchecksz, "Expected %d >= %d\n", langsz, langchecksz);
|
ok(langsz >= langchecksz, "Expected %d >= %d\n", langsz, langchecksz);
|
||||||
|
|
||||||
/* pcchVersionBuf big enough, pcchLangBuf not big enough */
|
/* pcchVersionBuf big enough, pcchLangBuf not big enough */
|
||||||
|
@ -4072,7 +4079,7 @@ static void test_MsiGetFileVersion(void)
|
||||||
r = MsiGetFileVersionA(path, version, &versz, NULL, &langsz);
|
r = MsiGetFileVersionA(path, version, &versz, NULL, &langsz);
|
||||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
ok(versz == verchecksz, "Expected %d, got %d\n", verchecksz, versz);
|
ok(versz == verchecksz, "Expected %d, got %d\n", verchecksz, versz);
|
||||||
ok(!lstrcmpA(version, vercheck), "Expected %s, got %s\n", vercheck, version);
|
ok(!lstrcmpA(version, vercheck), "Expected \"%s\", got \"%s\"\n", vercheck, version);
|
||||||
ok(langsz >= langchecksz && langsz < MAX_PATH, "Expected %d >= %d\n", langsz, langchecksz);
|
ok(langsz >= langchecksz && langsz < MAX_PATH, "Expected %d >= %d\n", langsz, langchecksz);
|
||||||
|
|
||||||
/* pcchVersionBuf not big enough, pcchLangBuf big enough */
|
/* pcchVersionBuf not big enough, pcchLangBuf big enough */
|
||||||
|
|
Loading…
Reference in New Issue