Author: fireball
Date: Wed Jun 4 04:50:19 2008
New Revision: 33852
URL:
http://svn.reactos.org/svn/reactos?rev=33852&view=rev
Log:
- Misc cleanup of kmtest.
- Add paged/nonpaged pools test routines.
- Comment out invocations of other tests temporary.
Added:
trunk/rostests/drivers/kmtest/ntos_pools.c (with props)
Modified:
trunk/rostests/drivers/kmtest/deviface.c
trunk/rostests/drivers/kmtest/deviface_test.c
trunk/rostests/drivers/kmtest/kmtest.c
trunk/rostests/drivers/kmtest/kmtest.rbuild
trunk/rostests/drivers/kmtest/ntos_ex.c
trunk/rostests/drivers/kmtest/ntos_io.c
trunk/rostests/drivers/kmtest/ntos_ob.c
Modified: trunk/rostests/drivers/kmtest/deviface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/drivers/kmtest/deviface.c…
==============================================================================
--- trunk/rostests/drivers/kmtest/deviface.c [iso-8859-1] (original)
+++ trunk/rostests/drivers/kmtest/deviface.c [iso-8859-1] Wed Jun 4 04:50:19 2008
@@ -70,7 +70,7 @@
* function worked correctly.
*/
-NTSTATUS STDCALL
+NTSTATUS NTAPI
ReactOS_IoGetDeviceInterfaces(
IN CONST GUID *InterfaceClassGuid,
IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL,
Modified: trunk/rostests/drivers/kmtest/deviface_test.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/drivers/kmtest/deviface_t…
==============================================================================
--- trunk/rostests/drivers/kmtest/deviface_test.c [iso-8859-1] (original)
+++ trunk/rostests/drivers/kmtest/deviface_test.c [iso-8859-1] Wed Jun 4 04:50:19 2008
@@ -31,21 +31,21 @@
/* PRIVATE FUNCTIONS **********************************************************/
-NTSTATUS STDCALL
+NTSTATUS NTAPI
(*IoGetDeviceInterfaces_Func)(
IN CONST GUID *InterfaceClassGuid,
IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL,
IN ULONG Flags,
OUT PWSTR *SymbolicLinkList);
-NTSTATUS STDCALL
+NTSTATUS NTAPI
ReactOS_IoGetDeviceInterfaces(
IN CONST GUID *InterfaceClassGuid,
IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL,
IN ULONG Flags,
OUT PWSTR *SymbolicLinkList);
-VOID FASTCALL DeviceInterfaceTest_Func()
+VOID DeviceInterfaceTest_Func()
{
NTSTATUS Status;
PWSTR SymbolicLinkList;
@@ -134,7 +134,7 @@
"IoRegisterDeviceInterface returned 0x%08lX\n", Status);
}
-VOID FASTCALL NtoskrnlIoDeviceInterface()
+VOID NtoskrnlIoDeviceInterface()
{
StartTest();
Modified: trunk/rostests/drivers/kmtest/kmtest.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/drivers/kmtest/kmtest.c?r…
==============================================================================
--- trunk/rostests/drivers/kmtest/kmtest.c [iso-8859-1] (original)
+++ trunk/rostests/drivers/kmtest/kmtest.c [iso-8859-1] Wed Jun 4 04:50:19 2008
@@ -103,10 +103,11 @@
/*
* Test Declarations
*/
-VOID FASTCALL NtoskrnlIoMdlTest();
-VOID FASTCALL NtoskrnlIoDeviceInterface();
-VOID FASTCALL NtoskrnlObTest();
-VOID FASTCALL NtoskrnlExecutiveTests();
+VOID NtoskrnlIoMdlTest();
+VOID NtoskrnlIoDeviceInterface();
+VOID NtoskrnlObTest();
+VOID NtoskrnlExecutiveTests();
+VOID NtoskrnlPoolsTest();
/*
* DriverEntry
@@ -117,10 +118,12 @@
PUNICODE_STRING RegistryPath)
{
DbgPrint("\n===============================================\nKernel Mode
Regression Test driver starting...\n");
- NtoskrnlExecutiveTests();
- NtoskrnlIoDeviceInterface();
- NtoskrnlIoMdlTest();
- NtoskrnlObTest();
+ //NtoskrnlExecutiveTests();
+ //NtoskrnlIoDeviceInterface();
+ //NtoskrnlIoMdlTest();
+ //NtoskrnlObTest();
+ //NtoskrnlObTest();
+ NtoskrnlPoolsTest();
- return STATUS_UNSUCCESSFUL;
+ return STATUS_SUCCESS;
}
Modified: trunk/rostests/drivers/kmtest/kmtest.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/drivers/kmtest/kmtest.rbu…
==============================================================================
--- trunk/rostests/drivers/kmtest/kmtest.rbuild [iso-8859-1] (original)
+++ trunk/rostests/drivers/kmtest/kmtest.rbuild [iso-8859-1] Wed Jun 4 04:50:19 2008
@@ -10,5 +10,6 @@
<file>ntos_ex.c</file>
<file>ntos_io.c</file>
<file>ntos_ob.c</file>
+ <file>ntos_pools.c</file>
<file>kmtest.rc</file>
</module>
Modified: trunk/rostests/drivers/kmtest/ntos_ex.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/drivers/kmtest/ntos_ex.c?…
==============================================================================
--- trunk/rostests/drivers/kmtest/ntos_ex.c [iso-8859-1] (original)
+++ trunk/rostests/drivers/kmtest/ntos_ex.c [iso-8859-1] Wed Jun 4 04:50:19 2008
@@ -173,7 +173,6 @@
/* PUBLIC FUNCTIONS ***********************************************************/
VOID
-FASTCALL
NtoskrnlExecutiveTests()
{
ExTimerTest();
Modified: trunk/rostests/drivers/kmtest/ntos_io.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/drivers/kmtest/ntos_io.c?…
==============================================================================
--- trunk/rostests/drivers/kmtest/ntos_io.c [iso-8859-1] (original)
+++ trunk/rostests/drivers/kmtest/ntos_io.c [iso-8859-1] Wed Jun 4 04:50:19 2008
@@ -30,7 +30,7 @@
/* PUBLIC FUNCTIONS ***********************************************************/
-VOID FASTCALL NtoskrnlIoMdlTest()
+VOID NtoskrnlIoMdlTest()
{
PMDL Mdl;
PIRP Irp;
Modified: trunk/rostests/drivers/kmtest/ntos_ob.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/drivers/kmtest/ntos_ob.c?…
==============================================================================
--- trunk/rostests/drivers/kmtest/ntos_ob.c [iso-8859-1] (original)
+++ trunk/rostests/drivers/kmtest/ntos_ob.c [iso-8859-1] Wed Jun 4 04:50:19 2008
@@ -487,7 +487,6 @@
/* PUBLIC FUNCTIONS ***********************************************************/
VOID
-FASTCALL
NtoskrnlObTest()
{
StartTest();
Added: trunk/rostests/drivers/kmtest/ntos_pools.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/drivers/kmtest/ntos_pools…
==============================================================================
--- trunk/rostests/drivers/kmtest/ntos_pools.c (added)
+++ trunk/rostests/drivers/kmtest/ntos_pools.c [iso-8859-1] Wed Jun 4 04:50:19 2008
@@ -1,0 +1,134 @@
+/*
+ * NTOSKRNL Pools test routines KM-Test
+ * ReactOS Kernel Mode Regression Testing framework
+ *
+ * Copyright 2008 Aleksey Bragin <aleksey(a)reactos.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; see the file COPYING.LIB.
+ * If not, write to the Free Software Foundation,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/* INCLUDES *******************************************************************/
+
+#include <ddk/ntddk.h>
+#include <ntifs.h>
+#include <ndk/ntndk.h>
+#include "kmtest.h"
+
+//#define NDEBUG
+#include "debug.h"
+
+#define TAG_POOLTEST TAG('P','t','s','t')
+
+/* PRIVATE FUNCTIONS ***********************************************************/
+
+VOID
+PoolsTest()
+{
+ PVOID Ptr;
+ ULONG AllocSize, i, AllocNumber;
+ PVOID *Allocs;
+
+ StartTest();
+
+ // Stress-test nonpaged pool
+ for (i=1; i<10000; i++)
+ {
+ // make up some increasing, a bit irregular size
+ AllocSize = i*10;
+
+ if (i % 10)
+ AllocSize++;
+
+ if (i % 25)
+ AllocSize += 13;
+
+ // start with non-paged pool
+ Ptr = ExAllocatePoolWithTag(NonPagedPool, AllocSize, TAG_POOLTEST);
+
+ // it may fail due to no-memory condition
+ if (!Ptr) break;
+
+ // try to fully fill it
+ RtlFillMemory(Ptr, AllocSize, 0xAB);
+
+ // free it
+ ExFreePoolWithTag(Ptr, TAG_POOLTEST);
+ }
+
+ // now paged one
+ for (i=1; i<10000; i++)
+ {
+ // make up some increasing, a bit irregular size
+ AllocSize = i*50;
+
+ if (i % 10)
+ AllocSize++;
+
+ if (i % 25)
+ AllocSize += 13;
+
+ // start with non-paged pool
+ Ptr = ExAllocatePoolWithTag(PagedPool, AllocSize, TAG_POOLTEST);
+
+ // it may fail due to no-memory condition
+ if (!Ptr) break;
+
+ // try to fully fill it
+ RtlFillMemory(Ptr, AllocSize, 0xAB);
+
+ // free it
+ ExFreePoolWithTag(Ptr, TAG_POOLTEST);
+ }
+
+ // test super-big allocations
+ /*AllocSize = 2UL * 1024 * 1024 * 1024;
+ Ptr = ExAllocatePoolWithTag(NonPagedPool, AllocSize, TAG_POOLTEST);
+ ok(Ptr == NULL, "Allocating 2Gb of nonpaged pool should fail\n");
+
+ Ptr = ExAllocatePoolWithTag(PagedPool, AllocSize, TAG_POOLTEST);
+ ok(Ptr == NULL, "Allocating 2Gb of paged pool should fail\n");*/
+
+ // now test allocating lots of small/medium blocks
+ AllocNumber = 100000;
+ Allocs = ExAllocatePoolWithTag(PagedPool, sizeof(Allocs) * AllocNumber,
TAG_POOLTEST);
+
+ // alloc blocks
+ for (i=0; i<AllocNumber; i++)
+ {
+ AllocSize = 42;
+ Allocs[i] = ExAllocatePoolWithTag(NonPagedPool, AllocSize, TAG_POOLTEST);
+ }
+
+ // now free them
+ for (i=0; i<AllocNumber; i++)
+ {
+ ExFreePoolWithTag(Allocs[i], TAG_POOLTEST);
+ }
+
+
+ ExFreePoolWithTag(Allocs, TAG_POOLTEST);
+
+
+ FinishTest("NTOSKRNL Pools Tests");
+}
+
+/* PUBLIC FUNCTIONS ***********************************************************/
+
+VOID
+NtoskrnlPoolsTest()
+{
+ PoolsTest();
+}
Propchange: trunk/rostests/drivers/kmtest/ntos_pools.c
------------------------------------------------------------------------------
svn:eol-style = native