Alistair Leslie-Hughes : wbemdisp/tests: Add ISWbemSecurity tests.

Alexandre Julliard julliard at winehq.org
Tue Jun 5 17:06:41 CDT 2018


Module: wine
Branch: master
Commit: b5627d742cf14f2579648e57e35c4e47da0bd2f6
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=b5627d742cf14f2579648e57e35c4e47da0bd2f6

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Tue Jun  5 10:40:14 2018 +0200

wbemdisp/tests: Add ISWbemSecurity tests.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wbemdisp/tests/wbemdisp.c | 43 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/dlls/wbemdisp/tests/wbemdisp.c b/dlls/wbemdisp/tests/wbemdisp.c
index 171a91e..1ce0456 100644
--- a/dlls/wbemdisp/tests/wbemdisp.c
+++ b/dlls/wbemdisp/tests/wbemdisp.c
@@ -265,7 +265,10 @@ static void test_locator(void)
     ISWbemObject *object;
     ISWbemPropertySet *prop_set;
     ISWbemProperty *prop;
+    ISWbemSecurity *security;
     VARIANT var;
+    WbemImpersonationLevelEnum imp_level;
+    WbemAuthenticationLevelEnum auth_level;
 
     hr = CoCreateInstance( &CLSID_SWbemLocator, NULL, CLSCTX_INPROC_SERVER, &IID_ISWbemLocator, (void **)&locator );
     ok( hr == S_OK, "got %x\n", hr );
@@ -284,6 +287,34 @@ static void test_locator(void)
     SysFreeString( lang_bstr );
     SysFreeString( query_bstr );
 
+    hr = ISWbemLocator_get_Security_( locator, &security );
+    ok( hr == S_OK, "got %x\n", hr );
+    imp_level = 0xdeadbeef;
+    hr = ISWbemSecurity_get_ImpersonationLevel( security, &imp_level );
+    ok( hr == S_OK, "got %x\n", hr );
+    ok( imp_level == wbemImpersonationLevelImpersonate, "got %u\n", imp_level );
+    hr = ISWbemSecurity_put_ImpersonationLevel( security, wbemImpersonationLevelAnonymous );
+    ok( hr == S_OK, "got %x\n", hr );
+    imp_level = 0xdeadbeef;
+    hr = ISWbemSecurity_get_ImpersonationLevel( security, &imp_level );
+    ok( hr == S_OK, "got %x\n", hr );
+    ok( imp_level == wbemImpersonationLevelAnonymous, "got %u\n", imp_level );
+
+    auth_level = 0xdeadbeef;
+    hr = ISWbemSecurity_get_AuthenticationLevel( security, &auth_level );
+    todo_wine {
+    ok( hr == WBEM_E_FAILED, "got %x\n", hr );
+    ok( auth_level == 0xdeadbeef, "got %u\n", auth_level );
+    }
+    hr = ISWbemSecurity_put_AuthenticationLevel( security, wbemAuthenticationLevelNone );
+    ok( hr == S_OK, "got %x\n", hr );
+    auth_level = 0xdeadbeef;
+    hr = ISWbemSecurity_get_AuthenticationLevel( security, &auth_level );
+    ok( hr == S_OK, "got %x\n", hr );
+    ok( auth_level == wbemAuthenticationLevelNone, "got %u\n", auth_level );
+    ISWbemSecurity_Release( security );
+    security = NULL;
+
     hr = ISWbemObjectSet_get__NewEnum( object_set, (IUnknown**)&enum_var );
     ok( hr == S_OK, "got %x\n", hr );
 
@@ -318,6 +349,18 @@ static void test_locator(void)
     ok( V_VT(&var) == VT_BSTR, "got %x\n", V_VT(&var) );
     VariantClear( &var );
 
+    hr = ISWbemServices_get_Security_( services, &security );
+    ok( hr == S_OK, "got %x\n", hr );
+    imp_level = 0xdeadbeef;
+    hr = ISWbemSecurity_get_ImpersonationLevel( security, &imp_level );
+    ok( hr == S_OK, "got %x\n", hr );
+    ok( imp_level == wbemImpersonationLevelImpersonate, "got %u\n", imp_level );
+    auth_level = 0xdeadbeef;
+    hr = ISWbemSecurity_get_AuthenticationLevel( security, &auth_level );
+    ok( hr == S_OK, "got %x\n", hr );
+    ok( auth_level == wbemAuthenticationLevelPktPrivacy, "got %u\n", auth_level );
+
+    ISWbemSecurity_Release(security);
     ISWbemProperty_Release( prop );
     ISWbemPropertySet_Release( prop_set );
     ISWbemObject_Release( object );




More information about the wine-cvs mailing list