Jacek Caban : hlink: Added HlinkCreateExtensionServices tests.

Alexandre Julliard julliard at winehq.org
Wed Nov 21 07:47:42 CST 2007


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Nov 21 02:14:45 2007 +0100

hlink: Added HlinkCreateExtensionServices tests.

---

 dlls/hlink/tests/hlink.c |   53 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/dlls/hlink/tests/hlink.c b/dlls/hlink/tests/hlink.c
index 2eb63dd..4a59f63 100644
--- a/dlls/hlink/tests/hlink.c
+++ b/dlls/hlink/tests/hlink.c
@@ -2,6 +2,7 @@
  * Implementation of hyperlinking (hlink.dll)
  *
  * Copyright 2006 Mike McCormack
+ * Copyright 2007 Jacek Caban for CodeWeavers
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -342,6 +343,57 @@ static void test_special_reference(void)
     ok(ref == NULL, "ref=%p\n", ref);
 }
 
+static void test_HlinkCreateExtensionServices(void)
+{
+    IAuthenticate *authenticate;
+    LPWSTR password, username;
+    HWND hwnd;
+    HRESULT hres;
+
+    static const WCHAR usernameW[] = {'u','s','e','r',0};
+    static const WCHAR passwordW[] = {'p','a','s','s',0};
+
+    hres = HlinkCreateExtensionServices(NULL, NULL, NULL, NULL,
+                                        NULL, &IID_IAuthenticate, (void**)&authenticate);
+    ok(hres == S_OK, "HlinkCreateExtensionServices failed: %08x\n", hres);
+    ok(authenticate != NULL, "HlinkCreateExtensionServices returned NULL\n");
+
+    password = username = (void*)0xdeadbeef;
+    hwnd = (void*)0xdeadbeef;
+    hres = IAuthenticate_Authenticate(authenticate, &hwnd, &username, &password);
+    ok(hres == S_OK, "Authenticate failed: %08x\n", hres);
+    ok(!hwnd, "hwnd != NULL\n");
+    ok(!username, "username != NULL\n");
+    ok(!password, "password != NULL\n");
+
+    IAuthenticate_Release(authenticate);
+
+
+    hres = HlinkCreateExtensionServices(NULL, (HWND)0xfefefefe, usernameW, passwordW,
+                                        NULL, &IID_IAuthenticate, (void**)&authenticate);
+    ok(hres == S_OK, "HlinkCreateExtensionServices failed: %08x\n", hres);
+    ok(authenticate != NULL, "HlinkCreateExtensionServices returned NULL\n");
+
+    password = username = NULL;
+    hwnd = NULL;
+    hres = IAuthenticate_Authenticate(authenticate, &hwnd, &username, &password);
+    ok(hres == S_OK, "Authenticate failed: %08x\n", hres);
+    ok(hwnd == (HWND)0xfefefefe, "hwnd=%p\n", hwnd);
+    ok(!lstrcmpW(username, usernameW), "unexpected username\n");
+    ok(!lstrcmpW(password, passwordW), "unexpected password\n");
+    CoTaskMemFree(username);
+    CoTaskMemFree(password);
+
+    password = username = (void*)0xdeadbeef;
+    hwnd = (void*)0xdeadbeef;
+    hres = IAuthenticate_Authenticate(authenticate, &hwnd, NULL, &password);
+    ok(hres == E_INVALIDARG, "Authenticate failed: %08x\n", hres);
+    ok(password == (void*)0xdeadbeef, "password = %p\n", password);
+    ok(hwnd == (void*)0xdeadbeef, "hwnd = %p\n", hwnd);
+
+    IAuthenticate_Release(authenticate);
+}
+
 START_TEST(hlink)
 {
     CoInitialize(NULL);
@@ -350,6 +402,7 @@ START_TEST(hlink)
     test_reference();
     test_persist();
     test_special_reference();
+    test_HlinkCreateExtensionServices();
 
     CoUninitialize();
 }




More information about the wine-cvs mailing list