Stefan Leichter : setupapi: Added more tests for SetupDiGetINFClassA.

Alexandre Julliard julliard at winehq.org
Thu Sep 30 11:23:35 CDT 2010


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

Author: Stefan Leichter <Stefan.Leichter at camline.com>
Date:   Wed Sep 29 23:05:03 2010 +0200

setupapi: Added more tests for SetupDiGetINFClassA.

---

 dlls/setupapi/tests/devinst.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c
index 21fbb01..7005ef0 100644
--- a/dlls/setupapi/tests/devinst.c
+++ b/dlls/setupapi/tests/devinst.c
@@ -1443,11 +1443,32 @@ 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");
     ok(ERROR_INVALID_PARAMETER == GetLastError(),
@@ -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);
 }




More information about the wine-cvs mailing list