James Hawkins : setupapi: Fix a failing test in Vista.

Alexandre Julliard julliard at winehq.org
Thu Sep 11 08:00:34 CDT 2008


Module: wine
Branch: master
Commit: 9b96881163ea7c0780acf3166205d9668842079c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9b96881163ea7c0780acf3166205d9668842079c

Author: James Hawkins <jhawkins at codeweavers.com>
Date:   Wed Sep 10 23:01:25 2008 -0500

setupapi: Fix a failing test in Vista.

---

 dlls/setupapi/tests/query.c |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/dlls/setupapi/tests/query.c b/dlls/setupapi/tests/query.c
index 9c35767..c3dc46b 100644
--- a/dlls/setupapi/tests/query.c
+++ b/dlls/setupapi/tests/query.c
@@ -136,6 +136,7 @@ static void test_SetupGetInfInformation(void)
     PSP_INF_INFORMATION info;
     CHAR inf_filename[MAX_PATH];
     CHAR inf_one[MAX_PATH], inf_two[MAX_PATH];
+    LPSTR revfile;
     DWORD size;
     HINF hinf;
     BOOL ret;
@@ -240,11 +241,6 @@ static void test_SetupGetInfInformation(void)
     ok(check_info_filename(info, inf_filename), "Expected returned filename to be equal\n");
     SetupCloseInfFile(hinf);
 
-    lstrcpyA(inf_one, WIN_DIR);
-    lstrcatA(inf_one, "\\inf\\");
-    lstrcatA(inf_one, "test.inf");
-    create_inf_file(inf_one);
-
     lstrcpyA(inf_two, WIN_DIR);
     lstrcatA(inf_two, "\\system32\\");
     lstrcatA(inf_two, "test.inf");
@@ -253,9 +249,24 @@ static void test_SetupGetInfInformation(void)
     HeapFree(GetProcessHeap(), 0, info);
     info = alloc_inf_info("test.inf", INFINFO_DEFAULT_SEARCH, &size);
 
+    /* check if system32 is searched for inf */
+    ret = SetupGetInfInformationA("test.inf", INFINFO_DEFAULT_SEARCH, info, size, &size);
+    if (!ret && GetLastError() == ERROR_FILE_NOT_FOUND)
+        revfile = inf_one; /* Vista */
+    else
+        revfile = inf_two;
+
+    lstrcpyA(inf_one, WIN_DIR);
+    lstrcatA(inf_one, "\\inf\\");
+    lstrcatA(inf_one, "test.inf");
+    create_inf_file(inf_one);
+
+    HeapFree(GetProcessHeap(), 0, info);
+    info = alloc_inf_info("test.inf", INFINFO_DEFAULT_SEARCH, &size);
+
     /* test the INFINFO_DEFAULT_SEARCH search flag */
     ret = SetupGetInfInformationA("test.inf", INFINFO_DEFAULT_SEARCH, info, size, &size);
-    ok(ret == TRUE, "Expected SetupGetInfInformation to succeed\n");
+    ok(ret == TRUE, "Expected SetupGetInfInformation to succeed: %d\n", GetLastError());
     ok(check_info_filename(info, inf_one), "Expected returned filename to be equal\n");
 
     HeapFree(GetProcessHeap(), 0, info);
@@ -264,7 +275,7 @@ static void test_SetupGetInfInformation(void)
     /* test the INFINFO_REVERSE_DEFAULT_SEARCH search flag */
     ret = SetupGetInfInformationA("test.inf", INFINFO_REVERSE_DEFAULT_SEARCH, info, size, &size);
     ok(ret == TRUE, "Expected SetupGetInfInformation to succeed\n");
-    ok(check_info_filename(info, inf_two), "Expected returned filename to be equal\n");
+    ok(check_info_filename(info, revfile), "Expected returned filename to be equal\n");
 
     HeapFree(GetProcessHeap(), 0, info);
 




More information about the wine-cvs mailing list