Commit 6f8fb2f4 authored by Stefan Leichter's avatar Stefan Leichter Committed by Alexandre Julliard

setupapi32/tests: More tests for SetupGetInfFileListW.

parent d90aca35
......@@ -473,9 +473,16 @@ static void test_inffilelist(void)
static const char inffile2[] = "test2.inf";
static const WCHAR inffile2W[] = {'t','e','s','t','2','.','i','n','f',0};
static const char invalid_inf[] = "invalid.inf";
static const WCHAR invalid_infW[] = {'i','n','v','a','l','i','d','.','i','n','f',0};
static const char *inf =
"[Version]\n"
"Signature=\"$Chicago$\"";
static const char *inf2 =
"[Version]\n"
"Signature=\"$CHICAGO$\"";
static const char *infNT =
"[Version]\n"
"Signature=\"$WINDOWS NT$\"";
WCHAR *p, *ptr;
char dirA[MAX_PATH];
......@@ -587,6 +594,55 @@ static void test_inffilelist(void)
ok(!lstrcmpW(p,inffile2W) || !lstrcmpW(p,inffileW),
"unexpected filename %s\n",wine_dbgstr_w(p));
/* upper case value
*/
create_inf_file(inffile2, inf2);
ret = pSetupGetInfFileListW(dir, INF_STYLE_WIN4, buffer, MAX_PATH, &outsize);
ok(ret, "expected SetupGetInfFileListW to succeed!\n");
todo_wine
ok(expected == outsize, "expected required buffersize to be %d, got %d\n",
expected, outsize);
for(p = buffer; lstrlenW(p) && (outsize > (p - buffer)); p+=lstrlenW(p) + 1)
ok(!lstrcmpW(p,inffile2W) || !lstrcmpW(p,inffileW),
"unexpected filename %s\n",wine_dbgstr_w(p));
/* signature Windows NT is also inf style win4
*/
create_inf_file(inffile2, infNT);
expected = 3 + strlen(inffile) + strlen(inffile2);
ret = pSetupGetInfFileListW(dir, INF_STYLE_WIN4, buffer, MAX_PATH, &outsize);
ok(ret, "expected SetupGetInfFileListW to succeed!\n");
todo_wine
ok(expected == outsize, "expected required buffersize to be %d, got %d\n",
expected, outsize);
for(p = buffer; lstrlenW(p) && (outsize > (p - buffer)); p+=lstrlenW(p) + 1)
ok(!lstrcmpW(p,inffile2W) || !lstrcmpW(p,inffileW),
"unexpected filename %s\n",wine_dbgstr_w(p));
/* old style
*/
expected = 2 + strlen(invalid_inf);
ret = pSetupGetInfFileListW(dir, INF_STYLE_OLDNT, buffer, MAX_PATH, &outsize);
ok(ret, "expected SetupGetInfFileListW to succeed!\n");
todo_wine
ok(expected == outsize, "expected required buffersize to be %d, got %d\n",
expected, outsize);
for(p = buffer; lstrlenW(p) && (outsize > (p - buffer)); p+=lstrlenW(p) + 1)
ok(!lstrcmpW(p,invalid_infW), "unexpected filename %s\n",wine_dbgstr_w(p));
/* mixed style
*/
expected = 4 + strlen(inffile) + strlen(inffile2) + strlen(invalid_inf);
ret = pSetupGetInfFileListW(dir, INF_STYLE_OLDNT | INF_STYLE_WIN4, buffer,
MAX_PATH, &outsize);
ok(ret, "expected SetupGetInfFileListW to succeed!\n");
todo_wine
ok(expected == outsize, "expected required buffersize to be %d, got %d\n",
expected, outsize);
for(p = buffer; lstrlenW(p) && (outsize > (p - buffer)); p+=lstrlenW(p) + 1)
ok(!lstrcmpW(p,inffile2W) || !lstrcmpW(p,inffileW) || !lstrcmpW(p,invalid_infW),
"unexpected filename %s\n",wine_dbgstr_w(p));
DeleteFile(inffile);
DeleteFile(inffile2);
DeleteFile(invalid_inf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment