https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a76e7d13e2b52f91a52a62...
commit a76e7d13e2b52f91a52a62150906b84fed7d6a21 Author: Amine Khaldi amine.khaldi@reactos.org AuthorDate: Wed Dec 20 13:07:06 2017 +0100
[NTDLL_WINETEST] Add a PCH. --- modules/rostests/winetests/ntdll/CMakeLists.txt | 9 ++++----- modules/rostests/winetests/ntdll/atom.c | 17 +---------------- modules/rostests/winetests/ntdll/change.c | 9 +-------- modules/rostests/winetests/ntdll/directory.c | 13 +------------ modules/rostests/winetests/ntdll/env.c | 2 -- modules/rostests/winetests/ntdll/error.c | 14 ++------------ modules/rostests/winetests/ntdll/exception.c | 19 ++----------------- modules/rostests/winetests/ntdll/file.c | 14 +------------- modules/rostests/winetests/ntdll/generated.c | 8 -------- modules/rostests/winetests/ntdll/info.c | 2 -- modules/rostests/winetests/ntdll/large_int.c | 3 --- modules/rostests/winetests/ntdll/ntdll_test.h | 22 ++++++++++++++-------- modules/rostests/winetests/ntdll/om.c | 4 ---- modules/rostests/winetests/ntdll/pipe.c | 14 +------------- modules/rostests/winetests/ntdll/port.c | 13 +------------ modules/rostests/winetests/ntdll/process.c | 5 ----- modules/rostests/winetests/ntdll/reg.c | 7 ++----- modules/rostests/winetests/ntdll/rtl.c | 12 ++++++------ modules/rostests/winetests/ntdll/rtlstr.c | 8 ++------ modules/rostests/winetests/ntdll/string.c | 3 --- modules/rostests/winetests/ntdll/time.c | 3 +-- 21 files changed, 39 insertions(+), 162 deletions(-)
diff --git a/modules/rostests/winetests/ntdll/CMakeLists.txt b/modules/rostests/winetests/ntdll/CMakeLists.txt index 0bbc8d33a1..2e9a5ef2d2 100644 --- a/modules/rostests/winetests/ntdll/CMakeLists.txt +++ b/modules/rostests/winetests/ntdll/CMakeLists.txt @@ -24,15 +24,13 @@ list(APPEND SOURCE rtlstr.c string.c time.c - testlist.c) + ntdll_test.h)
if(ARCH STREQUAL "i386") - list(APPEND SOURCE - generated.c - ) + list(APPEND SOURCE generated.c) endif()
-add_executable(ntdll_winetest ${SOURCE}) +add_executable(ntdll_winetest ${SOURCE} testlist.c)
if(USE_CLANG_CL OR (NOT MSVC)) add_target_compile_flags(ntdll_winetest "-Wno-format") @@ -40,4 +38,5 @@ endif()
set_module_type(ntdll_winetest win32cui) add_importlibs(ntdll_winetest user32 ole32 advapi32 msvcrt kernel32 ntdll) +add_pch(ntdll_winetest ntdll_test.h SOURCE) add_rostests_file(TARGET ntdll_winetest) diff --git a/modules/rostests/winetests/ntdll/atom.c b/modules/rostests/winetests/ntdll/atom.c index 6a16a8d0b6..e8ad049aa9 100755 --- a/modules/rostests/winetests/ntdll/atom.c +++ b/modules/rostests/winetests/ntdll/atom.c @@ -21,22 +21,7 @@ * windows. */
-#include <stdio.h> -#include <stdarg.h> - -#include "ntstatus.h" -/* Define WIN32_NO_STATUS so MSVC does not give us duplicate macro - * definition errors when we get to winnt.h - */ -#define WIN32_NO_STATUS - -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "winnls.h" -#include "winuser.h" -#include "wine/test.h" -#include "wine/winternl.h" +#include "ntdll_test.h"
#ifndef __WINE_WINTERNL_H typedef unsigned short RTL_ATOM, *PRTL_ATOM; diff --git a/modules/rostests/winetests/ntdll/change.c b/modules/rostests/winetests/ntdll/change.c index fc9a18185a..8dfc68d788 100644 --- a/modules/rostests/winetests/ntdll/change.c +++ b/modules/rostests/winetests/ntdll/change.c @@ -18,14 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include <ntstatus.h> -#define WIN32_NO_STATUS -#include <windows.h> -#include <winnt.h> -#include <wine/winternl.h> -#include <winerror.h> -#include <stdio.h> -#include "wine/test.h" +#include "ntdll_test.h"
static NTSTATUS (WINAPI *pNtNotifyChangeDirectoryFile)( HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID, diff --git a/modules/rostests/winetests/ntdll/directory.c b/modules/rostests/winetests/ntdll/directory.c index 21f22ad043..75f371cfa3 100644 --- a/modules/rostests/winetests/ntdll/directory.c +++ b/modules/rostests/winetests/ntdll/directory.c @@ -24,18 +24,7 @@ * windows. */
-#include <stdio.h> -#include <stdarg.h> - -#include "ntstatus.h" -/* Define WIN32_NO_STATUS so MSVC does not give us duplicate macro - * definition errors when we get to winnt.h - */ -#define WIN32_NO_STATUS - -#include "wine/test.h" -#include "winnls.h" -#include "wine/winternl.h" +#include "ntdll_test.h"
static NTSTATUS (WINAPI *pNtClose)( PHANDLE ); static NTSTATUS (WINAPI *pNtOpenFile) ( PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PIO_STATUS_BLOCK, ULONG, ULONG ); diff --git a/modules/rostests/winetests/ntdll/env.c b/modules/rostests/winetests/ntdll/env.c index 8989760f43..5d024ec319 100755 --- a/modules/rostests/winetests/ntdll/env.c +++ b/modules/rostests/winetests/ntdll/env.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include <stdio.h> - #include "ntdll_test.h"
static NTSTATUS (WINAPI *pRtlMultiByteToUnicodeN)( LPWSTR dst, DWORD dstlen, LPDWORD reslen, diff --git a/modules/rostests/winetests/ntdll/error.c b/modules/rostests/winetests/ntdll/error.c index 8a7732bdba..5f725e647f 100755 --- a/modules/rostests/winetests/ntdll/error.c +++ b/modules/rostests/winetests/ntdll/error.c @@ -19,19 +19,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include <stdarg.h> -#include <stdio.h> +#include "ntdll_test.h"
-#include "ntstatus.h" -#define WIN32_NO_STATUS - -#include "wine/test.h" - -#include "windef.h" -#include "winbase.h" -#include "rpcnterr.h" -#include "winreg.h" -#include "wine/winternl.h" +#include <rpcnterr.h>
/* FIXME!!! this test checks only mappings, defined by MSDN * It is necessary to add other mappings and to test them diff --git a/modules/rostests/winetests/ntdll/exception.c b/modules/rostests/winetests/ntdll/exception.c index 8dc2d90482..1fb7786f29 100644 --- a/modules/rostests/winetests/ntdll/exception.c +++ b/modules/rostests/winetests/ntdll/exception.c @@ -18,24 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include <stdarg.h> -#include <stdio.h> +#include "ntdll_test.h"
-#ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x500 /* For NTSTATUS */ -#endif - -#define NONAMELESSUNION -#define NONAMELESSSTRUCT -#include "ntstatus.h" -#define WIN32_NO_STATUS -#include "windef.h" -#include "winbase.h" -#include "winnt.h" -#include "winreg.h" -#include "wine/winternl.h" -#include "wine/exception.h" -#include "wine/test.h" +#include <wine/exception.h>
static void *code_mem;
diff --git a/modules/rostests/winetests/ntdll/file.c b/modules/rostests/winetests/ntdll/file.c index 3316399c2f..36ca9fc0cf 100644 --- a/modules/rostests/winetests/ntdll/file.c +++ b/modules/rostests/winetests/ntdll/file.c @@ -24,19 +24,7 @@ * windows. */
-#include <stdio.h> -#include <stdarg.h> - -#include "ntstatus.h" -/* Define WIN32_NO_STATUS so MSVC does not give us duplicate macro - * definition errors when we get to winnt.h - */ -#define WIN32_NO_STATUS - -#include "wine/test.h" -#include "wine/winternl.h" -#include "winuser.h" -#include "wine/winioctl.h" +#include "ntdll_test.h"
/* FIXME */ typedef struct _REPARSE_DATA_BUFFER { diff --git a/modules/rostests/winetests/ntdll/generated.c b/modules/rostests/winetests/ntdll/generated.c index b099a5c084..54b43a3374 100755 --- a/modules/rostests/winetests/ntdll/generated.c +++ b/modules/rostests/winetests/ntdll/generated.c @@ -5,16 +5,8 @@ * Unit tests for data structure packing */
-#define WINVER 0x0501 -#define _WIN32_IE 0x0501 -#define _WIN32_WINNT 0x0501 - -#define WINE_NOWINSOCK - #include "ntdll_test.h"
-#include "wine/test.h" - /*********************************************************************** * Compatibility macros */ diff --git a/modules/rostests/winetests/ntdll/info.c b/modules/rostests/winetests/ntdll/info.c index d03d26c0b9..f42619a820 100755 --- a/modules/rostests/winetests/ntdll/info.c +++ b/modules/rostests/winetests/ntdll/info.c @@ -19,8 +19,6 @@ */
#include "ntdll_test.h" -#include <winnls.h> -#include <stdio.h>
static NTSTATUS (WINAPI * pRtlDowncaseUnicodeString)(UNICODE_STRING *, const UNICODE_STRING *, BOOLEAN); static NTSTATUS (WINAPI * pNtQuerySystemInformation)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG); diff --git a/modules/rostests/winetests/ntdll/large_int.c b/modules/rostests/winetests/ntdll/large_int.c index 4562e6768e..2313f9eab8 100755 --- a/modules/rostests/winetests/ntdll/large_int.c +++ b/modules/rostests/winetests/ntdll/large_int.c @@ -21,11 +21,8 @@ * windows. */
-#include <stdlib.h> - #include "ntdll_test.h"
- /* Function ptrs for ntdll calls */ static HMODULE hntdll = 0; static LONGLONG (WINAPI *pRtlExtendedMagicDivide)(LONGLONG, LONGLONG, INT); diff --git a/modules/rostests/winetests/ntdll/ntdll_test.h b/modules/rostests/winetests/ntdll/ntdll_test.h index 84ed6a4a71..d192e332dd 100755 --- a/modules/rostests/winetests/ntdll/ntdll_test.h +++ b/modules/rostests/winetests/ntdll/ntdll_test.h @@ -18,14 +18,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include <stdarg.h> +#ifndef _NTDLL_TEST_H_ +#define _NTDLL_TEST_H_ + +#include <stdio.h> +#include <ntstatus.h>
-#include "ntstatus.h" #define WIN32_NO_STATUS -#include "windef.h" -#include "winbase.h" -#include "winnt.h" -#include "winreg.h" +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#include <wine/test.h> +#include <winuser.h> +#include <winnls.h> +#include <winioctl.h> +#include <wine/winternl.h>
-#include "wine/winternl.h" -#include "wine/test.h" +#endif /* !_NTDLL_TEST_H_ */ diff --git a/modules/rostests/winetests/ntdll/om.c b/modules/rostests/winetests/ntdll/om.c index 651db0a1ee..49784e5964 100644 --- a/modules/rostests/winetests/ntdll/om.c +++ b/modules/rostests/winetests/ntdll/om.c @@ -20,10 +20,6 @@ */
#include "ntdll_test.h" -#include "wine/winternl.h" -#include "stdio.h" -#include "winnt.h" -#include "stdlib.h"
static HANDLE (WINAPI *pCreateWaitableTimerA)(SECURITY_ATTRIBUTES*, BOOL, LPCSTR); static BOOLEAN (WINAPI *pRtlCreateUnicodeStringFromAsciiz)(PUNICODE_STRING, LPCSTR); diff --git a/modules/rostests/winetests/ntdll/pipe.c b/modules/rostests/winetests/ntdll/pipe.c index a3984e1a9e..48cfad03b5 100644 --- a/modules/rostests/winetests/ntdll/pipe.c +++ b/modules/rostests/winetests/ntdll/pipe.c @@ -17,19 +17,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include <stdio.h> -#include <stdarg.h> - -#include "ntstatus.h" -#define WIN32_NO_STATUS -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "winreg.h" -#include "winnls.h" -#include "wine/test.h" -#include "wine/winternl.h" -#include "winioctl.h" +#include "ntdll_test.h"
#ifndef __WINE_WINTERNL_H
diff --git a/modules/rostests/winetests/ntdll/port.c b/modules/rostests/winetests/ntdll/port.c index e5bb3edc28..1b47718049 100644 --- a/modules/rostests/winetests/ntdll/port.c +++ b/modules/rostests/winetests/ntdll/port.c @@ -17,18 +17,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include <stdio.h> -#include <stdarg.h> - -#include "ntstatus.h" -#define WIN32_NO_STATUS -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "winreg.h" -#include "winnls.h" -#include "wine/test.h" -#include "wine/winternl.h" +#include "ntdll_test.h"
#ifndef __WINE_WINTERNL_H
diff --git a/modules/rostests/winetests/ntdll/process.c b/modules/rostests/winetests/ntdll/process.c index 41303b7e9a..8187f637e3 100644 --- a/modules/rostests/winetests/ntdll/process.c +++ b/modules/rostests/winetests/ntdll/process.c @@ -18,13 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include <stdio.h> - #include "ntdll_test.h"
-#include "windef.h" -#include "winbase.h" - static NTSTATUS (WINAPI *pNtResumeProcess)(HANDLE); static NTSTATUS (WINAPI *pNtSuspendProcess)(HANDLE); static NTSTATUS (WINAPI *pNtSuspendThread)(HANDLE,PULONG); diff --git a/modules/rostests/winetests/ntdll/reg.c b/modules/rostests/winetests/ntdll/reg.c index 67833b18f5..1f3bd0acb4 100755 --- a/modules/rostests/winetests/ntdll/reg.c +++ b/modules/rostests/winetests/ntdll/reg.c @@ -23,11 +23,8 @@ */
#include "ntdll_test.h" -#include "wine/winternl.h" -#include "stdio.h" -#include "winnt.h" -#include "winnls.h" -#include "stdlib.h" + +#include <winreg.h>
/* A test string */ static const WCHAR stringW[] = {'s', 't', 'r', 'i', 'n', 'g', 'W', 0}; diff --git a/modules/rostests/winetests/ntdll/rtl.c b/modules/rostests/winetests/ntdll/rtl.c index 5ba6b1159d..147fd2d116 100755 --- a/modules/rostests/winetests/ntdll/rtl.c +++ b/modules/rostests/winetests/ntdll/rtl.c @@ -21,14 +21,14 @@ * windows. */
-#include <stdlib.h> - #include "ntdll_test.h" -#include "inaddr.h" -#include "in6addr.h" -#include "initguid.h" + +#include <inaddr.h> +#include <in6addr.h> +#include <objbase.h> +#include <initguid.h> #define COBJMACROS -#include "shobjidl.h" +#include <shobjidl.h>
#ifndef __WINE_WINTERNL_H
diff --git a/modules/rostests/winetests/ntdll/rtlstr.c b/modules/rostests/winetests/ntdll/rtlstr.c index 7f889dfa0d..c113f76a89 100755 --- a/modules/rostests/winetests/ntdll/rtlstr.c +++ b/modules/rostests/winetests/ntdll/rtlstr.c @@ -22,13 +22,9 @@ * windows. */
-#include <stdlib.h> - -#define INITGUID - #include "ntdll_test.h" -#include "winnls.h" -#include "guiddef.h" + +#include <initguid.h>
#define HASH_STRING_ALGORITHM_X65599 1 #define HASH_STRING_ALGORITHM_INVALID 0xffffffff diff --git a/modules/rostests/winetests/ntdll/string.c b/modules/rostests/winetests/ntdll/string.c index 9bbaddd415..9de0039fe9 100755 --- a/modules/rostests/winetests/ntdll/string.c +++ b/modules/rostests/winetests/ntdll/string.c @@ -21,11 +21,8 @@ * windows. */
-#include <stdlib.h> - #include "ntdll_test.h"
- /* Function ptrs for ntdll calls */ static HMODULE hntdll = 0; static NTSTATUS (WINAPI *pRtlUnicodeStringToAnsiString)(STRING *, const UNICODE_STRING *, BOOLEAN); diff --git a/modules/rostests/winetests/ntdll/time.c b/modules/rostests/winetests/ntdll/time.c index dc570e14ce..7d9e65148e 100755 --- a/modules/rostests/winetests/ntdll/time.c +++ b/modules/rostests/winetests/ntdll/time.c @@ -18,7 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define NONAMELESSUNION #include "ntdll_test.h"
/* FIXME: Inspect */ @@ -203,7 +202,7 @@ static void test_NtGetTickCount(void)
for (i = 0; i < 5; ++i) { - diff = (user_shared_data->u.TickCountQuad * user_shared_data->TickCountMultiplier) >> 24; + diff = (user_shared_data->TickCountQuad * user_shared_data->TickCountMultiplier) >> 24; diff = pNtGetTickCount() - diff; ok(diff < 32, "NtGetTickCount - TickCountQuad too high, expected < 32 got %d\n", diff); Sleep(50);