setupapi32/tests: More tests for SetupGetInfFileListW.

This commit is contained in:
Stefan Leichter 2009-12-08 08:57:44 +01:00 committed by Alexandre Julliard
parent d90aca35c4
commit 6f8fb2f4e7
1 changed files with 56 additions and 0 deletions

View File

@ -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);