Author: fireball
Date: Tue Apr 27 15:06:42 2010
New Revision: 47047
URL:
http://svn.reactos.org/svn/reactos?rev=47047&view=rev
Log:
[KMTEST]
- Add KeStallExecutionProcessor test.
Added:
trunk/rostests/drivers/kmtest/ntos_ke.c (with props)
Modified:
trunk/rostests/drivers/kmtest/kmtest.c
trunk/rostests/drivers/kmtest/kmtest.rbuild
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] Tue Apr 27 15:06:42 2010
@@ -106,6 +106,7 @@
* Test Declarations
*/
VOID NtoskrnlIoTests();
+VOID NtoskrnlKeTests();
VOID NtoskrnlObTest();
VOID NtoskrnlExecutiveTests();
VOID NtoskrnlPoolsTest();
@@ -214,6 +215,7 @@
ThisDriverObject = DriverObject;
NtoskrnlExecutiveTests();
+ NtoskrnlKeTests();
NtoskrnlIoTests();
NtoskrnlObTest();
NtoskrnlPoolsTest();
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] Tue Apr 27 15:06:42 2010
@@ -12,6 +12,7 @@
<file>reghelper.c</file>
<file>ntos_ex.c</file>
<file>ntos_io.c</file>
+ <file>ntos_ke.c</file>
<file>ntos_ob.c</file>
<file>ntos_pools.c</file>
<file>kmtest.rc</file>
Added: trunk/rostests/drivers/kmtest/ntos_ke.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/drivers/kmtest/ntos_ke.c?…
==============================================================================
--- trunk/rostests/drivers/kmtest/ntos_ke.c (added)
+++ trunk/rostests/drivers/kmtest/ntos_ke.c [iso-8859-1] Tue Apr 27 15:06:42 2010
@@ -1,0 +1,86 @@
+/*
+ * NTOSKRNL Executive Regressions KM-Test
+ * ReactOS Kernel Mode Regression Testing framework
+ *
+ * Copyright 2006 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"
+
+/* PRIVATE FUNCTIONS ***********************************************************/
+
+VOID
+NTAPI
+KeStallTest()
+{
+ ULONG i;
+ LARGE_INTEGER TimeStart, TimeFinish;
+
+ StartTest();
+
+ DPRINT1("Waiting for 30 secs with 50us stalls...\n");
+ KeQuerySystemTime(&TimeStart);
+ for (i = 0; i < (30*1000*20); i++)
+ {
+ KeStallExecutionProcessor(50);
+ }
+ KeQuerySystemTime(&TimeFinish);
+ DPRINT1("Time elapsed: %d secs\n", (TimeFinish.QuadPart -
TimeStart.QuadPart) / 10000000); // 30
+
+ DPRINT1("Waiting for 30 secs with 1000us stalls...\n");
+ KeQuerySystemTime(&TimeStart);
+ for (i = 0; i < (30*1000); i++)
+ {
+ KeStallExecutionProcessor(1000);
+ }
+ KeQuerySystemTime(&TimeFinish);
+ DPRINT1("Time elapsed: %d secs\n", (TimeFinish.QuadPart -
TimeStart.QuadPart) / 10000000); // 30
+
+ DPRINT1("Waiting for 30 secs with 1us stalls...\n");
+ KeQuerySystemTime(&TimeStart);
+ for (i = 0; i < (30*1000*1000); i++)
+ {
+ KeStallExecutionProcessor(1);
+ }
+ KeQuerySystemTime(&TimeFinish);
+ DPRINT1("Time elapsed: %d secs\n", (TimeFinish.QuadPart -
TimeStart.QuadPart) / 10000000); // 43
+
+ DPRINT1("Waiting for 30 secs with one huge stall...\n");
+ KeQuerySystemTime(&TimeStart);
+ KeStallExecutionProcessor(30*1000000);
+ KeQuerySystemTime(&TimeFinish);
+ DPRINT1("Time elapsed: %d secs\n", (TimeFinish.QuadPart -
TimeStart.QuadPart) / 10000000); // 30
+
+ FinishTest("NTOSKRNL KeStallmanExecution test");
+}
+
+/* PUBLIC FUNCTIONS ***********************************************************/
+
+VOID
+NtoskrnlKeTests()
+{
+ KeStallTest();
+}
Propchange: trunk/rostests/drivers/kmtest/ntos_ke.c
------------------------------------------------------------------------------
svn:eol-style = native