mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 05:00:30 +00:00
setupapi: Added more tests for SetupDiGetINFClassA.
This commit is contained in:
parent
ddb033b7c0
commit
637fd3735a
@ -1443,10 +1443,31 @@ static void testSetupDiGetINFClassA(void)
|
||||
|
||||
WritePrivateProfileStringA("Version", "Class", "WINE", filename);
|
||||
|
||||
count = 0xdeadbeef;
|
||||
retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count);
|
||||
ok(retval, "expected SetupDiGetINFClassA to succeed! error %u\n", GetLastError());
|
||||
ok(count == 5, "expected count==5, got %u\n", count);
|
||||
|
||||
count = 0xdeadbeef;
|
||||
retval = SetupDiGetINFClassA(filename, &guid, cn, 5, &count);
|
||||
ok(retval, "expected SetupDiGetINFClassA to succeed! error %u\n", GetLastError());
|
||||
ok(count == 5, "expected count==5, got %u\n", count);
|
||||
|
||||
count = 0xdeadbeef;
|
||||
SetLastError(0xdeadbeef);
|
||||
retval = SetupDiGetINFClassA(filename, &guid, cn, 4, &count);
|
||||
ok(!retval, "expected SetupDiGetINFClassA to fail!\n");
|
||||
ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(),
|
||||
"expected error ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError());
|
||||
ok(count == 5, "expected count==5, got %u\n", count);
|
||||
|
||||
/* invalid parameter */
|
||||
SetLastError(0xdeadbeef);
|
||||
retval = SetupDiGetINFClassA(NULL, &guid, cn, MAX_PATH, &count);
|
||||
ok(!retval, "expected SetupDiGetINFClassA to fail!\n");
|
||||
ok(ERROR_INVALID_PARAMETER == GetLastError(),
|
||||
"expected error ERROR_INVALID_PARAMETER, got %u\n", GetLastError());
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
retval = SetupDiGetINFClassA(filename, NULL, cn, MAX_PATH, &count);
|
||||
ok(!retval, "expected SetupDiGetINFClassA to fail!\n");
|
||||
@ -1485,8 +1506,10 @@ static void testSetupDiGetINFClassA(void)
|
||||
"{4d36e972-e325-11ce-bfc1-08002be10318}", filename);
|
||||
|
||||
/* this test succeeds only if the guid is known to the system */
|
||||
count = 0xdeadbeef;
|
||||
retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count);
|
||||
ok(retval, "expected SetupDiGetINFClassA to succeed! error %u\n", GetLastError());
|
||||
ok(count == 4, "expected count==4, got %u(%s)\n", count, cn);
|
||||
|
||||
DeleteFileA(filename);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user