[PATCH 5/5] adsldp/tests: Add some tests for LDAPNamespace.

Dmitry Timoshkov dmitry at baikal.ru
Sun Dec 15 19:42:36 CST 2019


Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/adsldp/tests/Makefile.in |  1 +
 dlls/adsldp/tests/ldap.c      | 76 +++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)
 create mode 100644 dlls/adsldp/tests/ldap.c

diff --git a/dlls/adsldp/tests/Makefile.in b/dlls/adsldp/tests/Makefile.in
index 777d2aa9de..52141139d5 100644
--- a/dlls/adsldp/tests/Makefile.in
+++ b/dlls/adsldp/tests/Makefile.in
@@ -2,4 +2,5 @@ TESTDLL   = adsldp.dll
 IMPORTS   = ole32 oleaut32 secur32 advapi32 uuid
 
 C_SRCS = \
+	ldap.c \
 	sysinfo.c
diff --git a/dlls/adsldp/tests/ldap.c b/dlls/adsldp/tests/ldap.c
new file mode 100644
index 0000000000..9e4dc2c1eb
--- /dev/null
+++ b/dlls/adsldp/tests/ldap.c
@@ -0,0 +1,76 @@
+/*
+ * LDAPNamespace Tests
+ *
+ * Copyright 2019 Dmitry Timoshkov
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "objbase.h"
+#include "iads.h"
+
+#include "wine/test.h"
+
+#include "initguid.h"
+DEFINE_GUID(CLSID_LDAPNamespace,0x228d9a82,0xc302,0x11cf,0x9a,0xa4,0x00,0xaa,0x00,0x4a,0x56,0x91);
+
+static void test_LDAP(void)
+{
+    HRESULT hr;
+    IUnknown *unk;
+    IADs *ads;
+    IADsOpenDSObject *ads_open;
+    IDispatch *disp;
+
+    hr = CoCreateInstance(&CLSID_LDAPNamespace, 0, CLSCTX_INPROC_SERVER, &IID_IADs, (void **)&ads);
+    ok(hr == S_OK, "got %#x\n", hr);
+    IADs_Release(ads);
+
+    hr = CoCreateInstance(&CLSID_LDAPNamespace, 0, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&unk);
+    ok(hr == S_OK, "got %#x\n", hr);
+
+    hr = IUnknown_QueryInterface(unk, &IID_IDispatch, (void **)&disp);
+    ok(hr == S_OK, "got %#x\n", hr);
+    IDispatch_Release(disp);
+
+    hr = IUnknown_QueryInterface(unk, &IID_IADsOpenDSObject, (void **)&ads_open);
+    ok(hr == S_OK, "got %#x\n", hr);
+    IADsOpenDSObject_Release(ads_open);
+
+    hr = IADsOpenDSObject_OpenDSObject(ads_open, (BSTR)L"LDAP:", NULL, NULL, ADS_SECURE_AUTHENTICATION, &disp);
+todo_wine
+    ok(hr == S_OK, "got %#x\n", hr);
+if (hr == S_OK)
+    IDispatch_Release(disp);
+
+    IUnknown_Release(unk);
+}
+
+START_TEST(ldap)
+{
+    HRESULT hr;
+
+    hr = CoInitialize(NULL);
+    ok(hr == S_OK, "got %#x\n", hr);
+
+    test_LDAP();
+}
-- 
2.20.1




More information about the wine-devel mailing list