Michael Karcher : ole32/tests: Test StringFromGUID2.

Alexandre Julliard julliard at winehq.org
Tue May 20 09:06:23 CDT 2008


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

Author: Michael Karcher <wine at mkarcher.dialup.fu-berlin.de>
Date:   Tue May 20 09:23:46 2008 +0200

ole32/tests: Test StringFromGUID2.

---

 dlls/ole32/tests/compobj.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c
index ad0a4cf..191424d 100644
--- a/dlls/ole32/tests/compobj.c
+++ b/dlls/ole32/tests/compobj.c
@@ -197,6 +197,27 @@ static void test_CLSIDFromString(void)
     ok(IsEqualCLSID(&clsid, &CLSID_NULL), "clsid wasn't equal to CLSID_NULL\n");
 }
 
+static void test_StringFromGUID2(void)
+{
+  WCHAR str[50];
+  int len;
+  /* Test corner cases for buffer size */
+  len = StringFromGUID2(&CLSID_CDeviceMoniker,str,50);
+  ok(len == 39, "len: %d (expected 39)",len);
+  ok(!lstrcmpiW(str, wszCLSID_CDeviceMoniker),"string wan't equal for CLSID_CDeviceMoniker\n");
+
+  memset(str,0,sizeof str);
+  len = StringFromGUID2(&CLSID_CDeviceMoniker,str,39);
+  ok(len == 39, "len: %d (expected 39)",len);
+  ok(!lstrcmpiW(str, wszCLSID_CDeviceMoniker),"string wan't equal for CLSID_CDeviceMoniker\n");
+
+  len = StringFromGUID2(&CLSID_CDeviceMoniker,str,38);
+  ok(len == 0, "len: %d (expected 0)",len);
+
+  len = StringFromGUID2(&CLSID_CDeviceMoniker,str,30);
+  ok(len == 0, "len: %d (expected 0)",len);
+}
+
 static void test_CoCreateInstance(void)
 {
     REFCLSID rclsid = &CLSID_MyComputer;
@@ -1008,6 +1029,7 @@ START_TEST(compobj)
     test_ProgIDFromCLSID();
     test_CLSIDFromProgID();
     test_CLSIDFromString();
+    test_StringFromGUID2();
     test_CoCreateInstance();
     test_ole_menu();
     test_CoGetClassObject();




More information about the wine-cvs mailing list