Author: tfaber Date: Tue Jul 26 07:40:19 2011 New Revision: 52889
URL: http://svn.reactos.org/svn/reactos?rev=52889&view=rev Log: [KMTESTS/RTL] - add a concept test for Rtl functions, which can run unmodified in user/kernel mode
Added: branches/GSoC_2011/KMTestSuite/kmtests/rtl/ (with props) branches/GSoC_2011/KMTestSuite/kmtests/rtl/RtlMemory.c (with props) Modified: branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild branches/GSoC_2011/KMTestSuite/kmtests/kmtest/testlist.c branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c
Modified: branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/CM... ============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt [iso-8859-1] Tue Jul 26 07:40:19 2011 @@ -32,6 +32,7 @@ ntos_ke/KeProcessor.c ntos_ke/KeSpinLock.c ntos_ob/ObCreate.c + rtl/RtlMemory.c
kmtest_drv/kmtest_drv.rc)
@@ -62,6 +63,7 @@ kmtest/testlist.c
example/Example_user.c + rtl/RtlMemory.c
kmtest/kmtest.rc)
Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/km... ============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild [iso-8859-1] Tue Jul 26 07:40:19 2011 @@ -11,4 +11,7 @@ <directory name="example"> <file>Example_user.c</file> </directory> + <directory name="rtl"> + <file>RtlMemory.c</file> + </directory> </module>
Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest/testlist.c URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/km... ============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest/testlist.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest/testlist.c [iso-8859-1] Tue Jul 26 07:40:19 2011 @@ -10,11 +10,13 @@ #include <windows.h> #include <kmt_test.h>
-VOID Test_Example(VOID); +KMT_TESTFUNC Test_Example; +KMT_TESTFUNC Test_RtlMemory;
/* tests with a leading '-' will not be listed */ const KMT_TEST TestList[] = { { "Example", Test_Example }, + { "RtlMemory", Test_RtlMemory }, { NULL, NULL }, };
Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/km... ============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild [iso-8859-1] Tue Jul 26 07:40:19 2011 @@ -41,6 +41,9 @@ <directory name="ntos_ob"> <file>ObCreate.c</file> </directory> + <directory name="rtl"> + <file>RtlMemory.c</file> + </directory> </module> <module name="kmtest_printf" type="staticlibrary"> <include base="crt">include</include>
Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/km... ============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c [iso-8859-1] Tue Jul 26 07:40:19 2011 @@ -27,6 +27,7 @@ KMT_TESTFUNC Test_KeProcessor; KMT_TESTFUNC Test_KernelType; KMT_TESTFUNC Test_ObCreate; +KMT_TESTFUNC Test_RtlMemory;
const KMT_TEST TestList[] = { @@ -49,5 +50,6 @@ { "KeProcessor", Test_KeProcessor }, { "-KernelType", Test_KernelType }, { "ObCreate", Test_ObCreate }, + { "RtlMemoryKM", Test_RtlMemory }, { NULL, NULL } };
Propchange: branches/GSoC_2011/KMTestSuite/kmtests/rtl/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Tue Jul 26 07:40:19 2011 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+)
Propchange: branches/GSoC_2011/KMTestSuite/kmtests/rtl/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details.
Propchange: branches/GSoC_2011/KMTestSuite/kmtests/rtl/ ------------------------------------------------------------------------------ bugtraq:number = true
Propchange: branches/GSoC_2011/KMTestSuite/kmtests/rtl/ ------------------------------------------------------------------------------ bugtraq:url = http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: branches/GSoC_2011/KMTestSuite/kmtests/rtl/ ------------------------------------------------------------------------------ tsvn:logminsize = 10
Added: branches/GSoC_2011/KMTestSuite/kmtests/rtl/RtlMemory.c URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/rt... ============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/rtl/RtlMemory.c (added) +++ branches/GSoC_2011/KMTestSuite/kmtests/rtl/RtlMemory.c [iso-8859-1] Tue Jul 26 07:40:19 2011 @@ -1,0 +1,36 @@ +/* + * PROJECT: ReactOS kernel-mode tests + * LICENSE: GPLv2+ - See COPYING in the top level directory + * PURPOSE: Kernel-Mode Test Suite Runtime library memory functions test + * 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 +#include <kmt_test.h> + +START_TEST(RtlMemory) +{ + UCHAR Buffer[512]; + KIRQL Irql; + int i; + + KeRaiseIrql(HIGH_LEVEL, &Irql); + + RtlFillMemory(Buffer, sizeof Buffer / 2, 0x55); + RtlFillMemory(Buffer + sizeof Buffer / 2, sizeof Buffer / 2, 0xAA); + for (i = 0; i < sizeof Buffer / 2; ++i) + ok_eq_uint(Buffer[i], 0x55); + for (i = sizeof Buffer / 2; i < sizeof Buffer; ++i) + ok_eq_uint(Buffer[i], 0xAA); + + KeLowerIrql(Irql); +}
Propchange: branches/GSoC_2011/KMTestSuite/kmtests/rtl/RtlMemory.c ------------------------------------------------------------------------------ svn:eol-style = native