Hans Leidekker : wmiutils/tests: Add more tests.

Alexandre Julliard julliard at winehq.org
Thu Jan 3 13:31:15 CST 2013


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Thu Jan  3 14:36:36 2013 +0100

wmiutils/tests: Add more tests.

---

 dlls/wmiutils/tests/path.c |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/dlls/wmiutils/tests/path.c b/dlls/wmiutils/tests/path.c
index 4d59129..6824d25 100644
--- a/dlls/wmiutils/tests/path.c
+++ b/dlls/wmiutils/tests/path.c
@@ -55,6 +55,11 @@ static const WCHAR path14[] =
     {'W','i','n','3','2','_','O','p','e','r','a','t','i','n','g','S','y','s','t','e','m',0};
 static const WCHAR path15[] =
     {'r','o','o','t','\\','c','i','m','v','2',0};
+static const WCHAR path16[] =
+    {'\\','\\','.','\\','r','o','o','t','\\','c','i','m','v','2',0};
+static const WCHAR path17[] =
+    {'\\','\\','.','\\','r','o','o','t','\\','c','i','m','v','2',':','W','i','n','3','2','_',
+     'L','o','g','i','c','a','l','D','i','s','k','.','D','e','v','i','c','e','I','d','=','"','C',':','"',0};
 
 static void test_IWbemPath_SetText(void)
 {
@@ -238,6 +243,36 @@ static void test_IWbemPath_GetText(void)
     ok( hr == S_OK, "got %08x\n", hr );
     ok( !count, "got %u\n", count );
 
+    hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, path6 );
+    ok( hr == S_OK, "got %08x\n", hr );
+
+    count = 0xdeadbeef;
+    hr = IWbemPath_GetNamespaceCount( path, &count );
+    ok( hr == S_OK, "got %08x\n", hr );
+    ok( count == 2, "got %u\n", count );
+
+    len = 0;
+    hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_TOO, &len, NULL );
+    ok( hr == S_OK, "got %08x\n", hr );
+    ok( len == lstrlenW( path16 ) + 1, "unexpected length %u\n", len );
+
+    len = sizeof(buf)/sizeof(buf[0]);
+    memset( buf, 0x55, sizeof(buf) );
+    hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_TOO, &len, buf );
+    ok( hr == S_OK, "got %08x\n", hr );
+    ok( !lstrcmpW( buf, path16 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) );
+    ok( len == lstrlenW( path16 ) + 1, "unexpected length %u\n", len );
+
+    hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, path17 );
+    ok( hr == S_OK, "got %08x\n", hr );
+
+    len = sizeof(buf)/sizeof(buf[0]);
+    memset( buf, 0x55, sizeof(buf) );
+    hr = IWbemPath_GetText( path, WBEMPATH_GET_SERVER_TOO, &len, buf );
+    ok( hr == S_OK, "got %08x\n", hr );
+    todo_wine ok( !lstrcmpW( buf, path17 ), "unexpected buffer contents %s\n", wine_dbgstr_w(buf) );
+    todo_wine ok( len == lstrlenW( path17 ) + 1, "unexpected length %u\n", len );
+
     IWbemPath_Release( path );
     CoUninitialize();
 }




More information about the wine-cvs mailing list