setupapi/tests: Uninstall .pnf if uninstall of .inf failed.

This commit is contained in:
Greg Geldorp 2010-12-29 00:07:26 +01:00 committed by Alexandre Julliard
parent b00117d4b6
commit f6990085cc

View File

@ -312,17 +312,34 @@ static void test_SetupCopyOEMInf(void)
if (pSetupUninstallOEMInfA)
{
char pnf[MAX_PATH];
char *pnffile;
char *destfile = strrchr(dest, '\\') + 1;
strcpy(pnf, dest);
*(strrchr(pnf, '.') + 1) = 'p';
pnffile = strrchr(pnf, '\\') + 1;
SetLastError(0xdeadbeef);
res = pSetupUninstallOEMInfA(destfile, 0, NULL);
ok(res, "Failed to uninstall '%s' : %d\n", destfile, GetLastError());
if(!res)
res = pSetupUninstallOEMInfA(pnffile, 0, NULL);
ok(res, "Failed to uninstall '%s'/'%s' : %d\n", destfile,
pnffile, GetLastError());
todo_wine ok(!file_exists(dest), "Expected inf '%s' to not exist\n", dest);
if(file_exists(dest))
{
SetLastError(0xdeadbeef);
res = DeleteFileA(dest);
ok(res, "Failed to delete file '%s' : %d\n", dest, GetLastError());
}
ok(!file_exists(pnf), "Expected pnf '%s' to not exist\n", pnf);
if(file_exists(pnf))
{
SetLastError(0xdeadbeef);
res = DeleteFileA(pnf);
ok(res, "Failed to delete file '%s' : %d\n", pnf, GetLastError());
}
}
else
{