Module: wine
Branch: master
Commit: 261bc3859ff9b0747dda592a1f8722264371677b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=261bc3859ff9b0747dda592a1…
Author: Detlef Riekenberg <wine.dev(a)web.de>
Date: Mon Apr 19 00:45:17 2010 +0200
shlwapi/tests: Add initial test for SHGetThreadRef.
---
dlls/shlwapi/tests/Makefile.in | 1 +
dlls/shlwapi/tests/thread.c | 66 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 67 insertions(+), 0 deletions(-)
diff --git a/dlls/shlwapi/tests/Makefile.in b/dlls/shlwapi/tests/Makefile.in
index 585607c..038d76c 100644
--- a/dlls/shlwapi/tests/Makefile.in
+++ b/dlls/shlwapi/tests/Makefile.in
@@ -15,6 +15,7 @@ C_SRCS = \
path.c \
shreg.c \
string.c \
+ thread.c \
url.c
@MAKE_TEST_RULES@
diff --git a/dlls/shlwapi/tests/thread.c b/dlls/shlwapi/tests/thread.c
new file mode 100644
index 0000000..b345604
--- /dev/null
+++ b/dlls/shlwapi/tests/thread.c
@@ -0,0 +1,66 @@
+/* Tests for Thread and SHGlobalCounter functions
+ *
+ * Copyright 2010 Detlef Riekenberg
+ *
+ * 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 <stdio.h>
+#include <stdarg.h>
+
+#define COBJMACROS
+#include "windef.h"
+#include "winbase.h"
+#include "winerror.h"
+#include "ole2.h"
+#include "shlwapi.h"
+
+#include "wine/test.h"
+
+static HRESULT (WINAPI *pSHGetThreadRef)(IUnknown**);
+
+/* ##### */
+
+static void test_SHGetThreadRef(void)
+{
+ IUnknown *punk;
+ HRESULT hr;
+
+ /* Not present before IE 5 */
+ if (!pSHGetThreadRef) {
+ win_skip("SHGetThreadRef not found\n");
+ return;
+ }
+
+ punk = NULL;
+ hr = pSHGetThreadRef(&punk);
+ ok( (hr == E_NOINTERFACE) && (punk == NULL),
+ "got 0x%x and %p (expected E_NOINTERFACE and NULL)\n", hr, punk);
+
+ if (0) {
+ /* this crash on Windows */
+ hr = pSHGetThreadRef(NULL);
+ }
+}
+
+START_TEST(thread)
+{
+ HMODULE hshlwapi = GetModuleHandleA("shlwapi.dll");
+
+ pSHGetThreadRef = (void *) GetProcAddress(hshlwapi, "SHGetThreadRef");
+
+ test_SHGetThreadRef();
+
+}