[UXTHEME_APITEST] -Add a test to show that CloseThemeData doesn't use exception handling.
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Wed, 8 Mar 2017 15:15:19 +0000 (15:15 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Wed, 8 Mar 2017 15:15:19 +0000 (15:15 +0000)
svn path=/trunk/; revision=74128

rostests/apitests/uxtheme/CMakeLists.txt
rostests/apitests/uxtheme/CloseThemeData.c [new file with mode: 0644]
rostests/apitests/uxtheme/testlist.c

index ec125a5..a807a46 100644 (file)
@@ -1,5 +1,6 @@
 
 list(APPEND SOURCE
+    CloseThemeData.c
     DrawThemeParentBackground.c
     ../include/msgtrace.c
     testlist.c)
diff --git a/rostests/apitests/uxtheme/CloseThemeData.c b/rostests/apitests/uxtheme/CloseThemeData.c
new file mode 100644 (file)
index 0000000..367525b
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * PROJECT:         ReactOS api tests
+ * LICENSE:         GPL - See COPYING in the top level directory
+ * PURPOSE:         Test for CloseThemeData
+ * PROGRAMMERS:     Giannis Adamopoulos
+ */
+
+#include <apitest.h>
+#include <stdio.h>
+#include <windows.h>
+#include <uxtheme.h>
+
+static LONG WINAPI VEHandler(PEXCEPTION_POINTERS ExceptionInfo)
+{
+    ok(FALSE, "VEHandler called!\n");
+    return EXCEPTION_CONTINUE_SEARCH;
+}
+
+START_TEST(CloseThemeData)
+{
+    PVOID pVEH;
+    HRESULT hr;
+
+    pVEH = AddVectoredExceptionHandler(1, VEHandler);
+
+    hr = CloseThemeData((HTHEME)0xdeaddead);
+    ok( hr == E_HANDLE, "Expected E_HANDLE, got 0x%lx\n", hr);
+
+    RemoveVectoredExceptionHandler(pVEH);
+}
\ No newline at end of file
index ca9af1c..97ee80e 100644 (file)
@@ -4,9 +4,11 @@
 #include <apitest.h>
 
 extern void func_DrawThemeParentBackground(void);
+extern void func_CloseThemeData(void);
 
 const struct test winetest_testlist[] =
 {
     { "DrawThemeParentBackground", func_DrawThemeParentBackground },
+    { "CloseThemeData", func_CloseThemeData },
     { 0, 0 }
 };