From f6990085ccc7d1f485a3738eed238c83d3815f8b Mon Sep 17 00:00:00 2001 From: Greg Geldorp Date: Wed, 29 Dec 2010 00:07:26 +0100 Subject: [PATCH] setupapi/tests: Uninstall .pnf if uninstall of .inf failed. --- dlls/setupapi/tests/misc.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/dlls/setupapi/tests/misc.c b/dlls/setupapi/tests/misc.c index 59a8d6b17de..493e6cb5747 100644 --- a/dlls/setupapi/tests/misc.c +++ b/dlls/setupapi/tests/misc.c @@ -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 {