Jacek Caban : win32u/tests: Add NtUserCloseWindowStation test.

Alexandre Julliard julliard at winehq.org
Tue Oct 12 16:12:48 CDT 2021


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Oct 12 15:33:30 2021 +0200

win32u/tests: Add NtUserCloseWindowStation test.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 configure                     |  1 +
 configure.ac                  |  1 +
 dlls/win32u/tests/Makefile.in |  5 +++++
 dlls/win32u/tests/win32u.c    | 42 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+)

diff --git a/configure b/configure
index 7f863aa38c0..d9dfe3e9c89 100755
--- a/configure
+++ b/configure
@@ -20773,6 +20773,7 @@ wine_fn_config_makefile dlls/wiaservc/tests enable_tests
 wine_fn_config_makefile dlls/wimgapi enable_wimgapi
 wine_fn_config_makefile dlls/win32s16.dll16 enable_win16
 wine_fn_config_makefile dlls/win32u enable_win32u
+wine_fn_config_makefile dlls/win32u/tests enable_tests
 wine_fn_config_makefile dlls/win87em.dll16 enable_win16
 wine_fn_config_makefile dlls/winaspi.dll16 enable_win16
 wine_fn_config_makefile dlls/windebug.dll16 enable_win16
diff --git a/configure.ac b/configure.ac
index 1821feefa49..44f8a1e2af6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3659,6 +3659,7 @@ WINE_CONFIG_MAKEFILE(dlls/wiaservc/tests)
 WINE_CONFIG_MAKEFILE(dlls/wimgapi)
 WINE_CONFIG_MAKEFILE(dlls/win32s16.dll16,enable_win16)
 WINE_CONFIG_MAKEFILE(dlls/win32u)
+WINE_CONFIG_MAKEFILE(dlls/win32u/tests)
 WINE_CONFIG_MAKEFILE(dlls/win87em.dll16,enable_win16)
 WINE_CONFIG_MAKEFILE(dlls/winaspi.dll16,enable_win16)
 WINE_CONFIG_MAKEFILE(dlls/windebug.dll16,enable_win16)
diff --git a/dlls/win32u/tests/Makefile.in b/dlls/win32u/tests/Makefile.in
new file mode 100644
index 00000000000..c0fa70e4e08
--- /dev/null
+++ b/dlls/win32u/tests/Makefile.in
@@ -0,0 +1,5 @@
+TESTDLL   = win32u.dll
+IMPORTS   = user32 win32u
+
+C_SRCS = \
+	win32u.c
diff --git a/dlls/win32u/tests/win32u.c b/dlls/win32u/tests/win32u.c
new file mode 100644
index 00000000000..2f5014b80b4
--- /dev/null
+++ b/dlls/win32u/tests/win32u.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2021 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
+ * 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 "wine/test.h"
+
+#include "winbase.h"
+#include "ntuser.h"
+
+
+static void test_NtUserCloseWindowStation(void)
+{
+    BOOL ret;
+
+    SetLastError( 0xdeadbeef );
+    ret = NtUserCloseWindowStation( 0 );
+    ok( !ret && GetLastError() == ERROR_INVALID_HANDLE,
+        "NtUserCloseWindowStation returned %x %u\n", ret, GetLastError() );
+}
+
+
+START_TEST(win32u)
+{
+    /* native win32u.dll fails if user32 is not loaded, so make sure it's fully initialized */
+    GetDesktopWindow();
+
+    test_NtUserCloseWindowStation();
+}




More information about the wine-cvs mailing list