- add kmt_platform.h that includes user or kernel headers as appropriate and allows Rtl tests to run in user mode without modification
- include kmt_platform.h from kmt_test.h, so that tests don't have to include separate headers. This also allows for a PCH
svn path=/branches/GSoC_2011/KMTestSuite/; revision=53021
* PROGRAMMER: Thomas Faber <thfabba@gmx.de>
*/
-#include <ntddk.h>
#include <kmt_test.h>
START_TEST(Example)
* PROGRAMMER: Thomas Faber <thfabba@gmx.de>
*/
-#include <ntddk.h>
-
#include <kmt_test.h>
//#define NDEBUG
* PROGRAMMER: Thomas Faber <thfabba@gmx.de>
*/
-#define UNICODE
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
#include <kmt_test.h>
#include "Example.h"
* PROGRAMMER: Thomas Faber <thfabba@gmx.de>
*/
-#include <ntddk.h>
#include <kmt_test.h>
START_TEST(KernelType)
--- /dev/null
+/*
+ * PROJECT: ReactOS kernel-mode tests
+ * LICENSE: GPLv2+ - See COPYING in the top level directory
+ * PURPOSE: Kernel-Mode Test Suite platform declarations
+ * PROGRAMMER: Thomas Faber <thfabba@gmx.de>
+ */
+
+#ifndef _KMTEST_PLATFORM_H_
+#define _KMTEST_PLATFORM_H_
+
+#if defined KMT_KERNEL_MODE || defined KMT_STANDALONE_DRIVER
+#include <ntddk.h>
+#include <ntifs.h>
+#include <ndk/ntndk.h>
+#include <ntstrsafe.h>
+
+#elif defined KMT_USER_MODE
+#define WIN32_LEAN_AND_MEAN
+#define WIN32_NO_STATUS
+#define UNICODE
+#include <windows.h>
+#include <ndk/ntndk.h>
+#include <strsafe.h>
+#include <winioctl.h>
+
+#ifdef KMT_EMULATE_KERNEL
+#define ok_irql(i)
+#ifdef __GNUC__
+#define KIRQL __attribute__((__unused__)) int
+#elif !defined __GNUC__
+#define KIRQL int
+#endif /* !defined __GNUC__ */
+
+#undef KeRaiseIrql
+#define KeRaiseIrql(new, old)
+#undef KeLowerIrql
+#define KeLowerIrql(i)
+#define ExAllocatePool(type, size) HeapAlloc(GetProcessHeap(), 0, size)
+#define ExAllocatePoolWithTag(type, size, tag) HeapAlloc(GetProcessHeap(), 0, size)
+#define ExFreePool(p) HeapFree(GetProcessHeap(), 0, p)
+#define ExFreePoolWithTag(p, tag) HeapFree(GetProcessHeap(), 0, p)
+#endif /* defined KMT_EMULATE_KERNEL */
+
+#endif /* defined KMT_USER_MODE */
+
+#include <pseh/pseh2.h>
+
+#endif /* !defined _KMTEST_PLATFORM_H_ */
#ifndef _KMTEST_TEST_H_
#define _KMTEST_TEST_H_
+#include <kmt_platform.h>
+
#include <stdarg.h>
typedef VOID KMT_TESTFUNC(VOID);
* PROGRAMMER: Thomas Faber <thfabba@gmx.de>
*/
-#define UNICODE
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <strsafe.h>
-#include <winioctl.h>
+#define KMT_DEFINE_TEST_FUNCTIONS
+#include <kmt_test.h>
+
+#include "kmtest.h"
+#include <kmt_public.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
-#include "kmtest.h"
-#include <kmt_public.h>
-#define KMT_DEFINE_TEST_FUNCTIONS
-#include <kmt_test.h>
-
#define SERVICE_NAME L"Kmtest"
#define SERVICE_PATH L"kmtest_drv.sys"
#define SERVICE_DESCRIPTION L"ReactOS Kernel-Mode Test Suite Driver"
* PROGRAMMER: Thomas Faber <thfabba@gmx.de>
*/
-#define UNICODE
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <strsafe.h>
+#include <kmt_test.h>
+#include "kmtest.h"
#include <assert.h>
-#include "kmtest.h"
-
#define SERVICE_ACCESS (SERVICE_START | SERVICE_STOP | DELETE)
static SC_HANDLE ScmHandle;
* PROGRAMMER: Thomas Faber <thfabba@gmx.de>
*/
-#define UNICODE
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <strsafe.h>
-#include <winioctl.h>
-
-#include <assert.h>
+#include <kmt_test.h>
#include "kmtest.h"
#include <kmt_public.h>
-#include <kmt_test.h>
+
+#include <assert.h>
extern HANDLE KmtestHandle;
* PROGRAMMER: Thomas Faber <thfabba@gmx.de>
*/
-#define WIN32_LEAN_AND_MEAN
-#define UNICODE
-#include <windows.h>
#include <kmt_test.h>
KMT_TESTFUNC Test_Example;
struct _LIST_ENTRY *__stdcall ExInterlockedInsertTailList(struct _LIST_ENTRY *, struct _LIST_ENTRY *, unsigned long *);
struct _LIST_ENTRY *__stdcall ExInterlockedRemoveHeadList(struct _LIST_ENTRY *, unsigned long *);
-#include <ntddk.h>
#include <kmt_test.h>
LIST_ENTRY Entries[5];
* PROGRAMMER: Thomas Faber <thfabba@gmx.de>
*/
-#include <ntddk.h>
-#include <ntifs.h>
-#include <ndk/exfuncs.h>
-#include <pseh/pseh2.h>
-
#include <kmt_test.h>
/* TODO: don't require user interaction, test Io* routines,
__declspec(dllimport) int __stdcall Exi386InterlockedIncrementLong(long *);
__declspec(dllimport) int __stdcall Exi386InterlockedDecrementLong(long *);
-#include <ntddk.h>
-#include <pseh/pseh2.h>
-
#include <kmt_test.h>
/* TODO: There are quite some changes needed for other architectures!
/* TODO: PoolsCorruption tests fail because accessing invalid memory doesn't necessarily cause an access violation */
-#include <ntddk.h>
-#include <ntifs.h>
-#include <ndk/ntndk.h>
-/* SEH support with PSEH */
-#include <pseh/pseh2.h>
#include <kmt_test.h>
#define NDEBUG
* PROGRAMMER: Thomas Faber <thfabba@gmx.de>
*/
-#include <ntddk.h>
-#include <ntifs.h>
-#include <ndk/extypes.h>
#include <kmt_test.h>
-#include <pseh/pseh2.h>
//#define NDEBUG
#include <debug.h>
struct _SINGLE_LIST_ENTRY *__stdcall ExInterlockedPushEntryList(struct _SINGLE_LIST_ENTRY *, struct _SINGLE_LIST_ENTRY *, unsigned long *);
struct _SINGLE_LIST_ENTRY *__stdcall ExInterlockedPopEntryList(struct _SINGLE_LIST_ENTRY *, unsigned long *);
-#include <ntddk.h>
#include <kmt_test.h>
SINGLE_LIST_ENTRY Entries[5];
* PROGRAMMER: Aleksey Bragin <aleksey@reactos.org>
*/
-#include <ntddk.h>
-#include <ntifs.h>
-#include <ndk/ntndk.h>
#include <kmt_test.h>
#define NDEBUG
/* TODO: most of these calls fail the Windows checked build's !islower assertion and others */
-#include <ntifs.h>
#include <kmt_test.h>
#define NDEBUG
/* TODO: what's with the prototypes at the top, what's with the if-ed out part? Doesn't process most results */
-#include <ntifs.h>
-#include <ndk/iotypes.h>
#include <kmt_test.h>
#define NDEBUG
*/
/* Based on code Copyright 2008 Etersoft (Alexander Morozov) */
-#include <ntddk.h>
#include <kmt_test.h>
#define NDEBUG
* PROGRAMMER: Aleksey Bragin <aleksey@reactos.org>
*/
-#include <ntddk.h>
#include <kmt_test.h>
#define NDEBUG
* PROGRAMMER: Thomas Faber <thfabba@gmx.de>
*/
-#include <ntddk.h>
-#include <ntifs.h>
-#include <ndk/ketypes.h>
#include <kmt_test.h>
#define CheckApcs(KernelApcsDisabled, SpecialApcsDisabled, AllApcsDisabled, Irql) do \
* PROGRAMMER: Thomas Faber <thfabba@gmx.de>
*/
-#include <ntddk.h>
-#include <ntifs.h>
-#include <ndk/ketypes.h>
#include <kmt_test.h>
-#include <pseh/pseh2.h>
//#define NDEBUG
#include <debug.h>
__declspec(dllimport) void __stdcall KeRaiseIrql(unsigned char, unsigned char *);
__declspec(dllimport) void __stdcall KeLowerIrql(unsigned char);
-#include <ntddk.h>
-#include <ntifs.h>
-#include <ndk/ntndk.h>
#include <kmt_test.h>
-#include <pseh/pseh2.h>
#define NDEBUG
#include <debug.h>
/* TODO: this test doesn't process any test results; it also takes very long */
-#include <ntddk.h>
-#include <ntifs.h>
-#include <ndk/ntndk.h>
#include <kmt_test.h>
#define NDEBUG
/* this define makes KeInitializeSpinLock not use the inlined version */
#define WIN9X_COMPAT_SPINLOCK
-#include <ntddk.h>
-#include <ntifs.h>
-#include <ndk/kefuncs.h>
#include <kmt_test.h>
-#include <pseh/pseh2.h>
#include <limits.h>
//#define NDEBUG
/* TODO: this test terminates with an access violation in Windows */
-#include <ntddk.h>
-#include <ntifs.h>
-#include <ndk/ntndk.h>
#include <kmt_test.h>
#define NDEBUG
* PROGRAMMER: Thomas Faber <thfabba@gmx.de>
*/
-/* TODO: move this to some header */
-#ifdef KMT_USER_MODE
-# include <windows.h>
-# define ok_irql(i)
-# define KIRQL int
-# define KeRaiseIrql(new, old)
-# define KeLowerIrql(i)
-#elif KMT_KERNEL_MODE
-# include <ntddk.h>
-#endif
+#define KMT_EMULATE_KERNEL
#include <kmt_test.h>
START_TEST(RtlMemory)