ole32/tests: Test StringFromGUID2.

This commit is contained in:
Michael Karcher 2008-05-20 09:23:46 +02:00 committed by Alexandre Julliard
parent a2880cc61d
commit 3d5ea20190
1 changed files with 22 additions and 0 deletions

View File

@ -197,6 +197,27 @@ static void test_CLSIDFromString(void)
ok(IsEqualCLSID(&clsid, &CLSID_NULL), "clsid wasn't equal to CLSID_NULL\n"); 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) static void test_CoCreateInstance(void)
{ {
REFCLSID rclsid = &CLSID_MyComputer; REFCLSID rclsid = &CLSID_MyComputer;
@ -1008,6 +1029,7 @@ START_TEST(compobj)
test_ProgIDFromCLSID(); test_ProgIDFromCLSID();
test_CLSIDFromProgID(); test_CLSIDFromProgID();
test_CLSIDFromString(); test_CLSIDFromString();
test_StringFromGUID2();
test_CoCreateInstance(); test_CoCreateInstance();
test_ole_menu(); test_ole_menu();
test_CoGetClassObject(); test_CoGetClassObject();