Author: tfaber Date: Fri Jul 22 11:33:17 2011 New Revision: 52780
URL: http://svn.reactos.org/svn/reactos?rev=52780&view=rev Log: [KMTESTS] - put driver files into 'bin' with the other tests instead of system32\drivers - globally define NTDDI_VERSION=NTDDI_WS03_SP1 instead of doing it in each test - fix testlist sorting (ASCII-order, but ignore leading minus)
Modified: branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt branches/GSoC_2011/KMTestSuite/kmtests/example/CMakeLists.txt branches/GSoC_2011/KMTestSuite/kmtests/example/example_drv.rbuild branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExInterlocked.c branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExResource.c branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeApc.c branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeDpc.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] Fri Jul 22 11:33:17 2011 @@ -36,9 +36,9 @@ set_module_type(kmtest_drv kernelmodedriver) target_link_libraries(kmtest_drv kmtest_printf ${PSEH_LIB}) add_importlibs(kmtest_drv ntoskrnl hal) -set_property(TARGET kmtest_drv PROPERTY COMPILE_DEFINITIONS KMT_KERNEL_MODE) +set_property(TARGET kmtest_drv PROPERTY COMPILE_DEFINITIONS KMT_KERNEL_MODE NTDDI_VERSION=NTDDI_WS03SP1)
-add_cd_file(TARGET kmtest_drv DESTINATION reactos/system32/drivers FOR all) +add_cd_file(TARGET kmtest_drv DESTINATION reactos/bin FOR all)
add_library(kmtest_printf kmtest_drv/printf_stubs.c
Modified: branches/GSoC_2011/KMTestSuite/kmtests/example/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/ex... ============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/example/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/example/CMakeLists.txt [iso-8859-1] Fri Jul 22 11:33:17 2011 @@ -12,4 +12,4 @@ add_importlibs(example_drv ntoskrnl hal) set_property(TARGET example_drv PROPERTY COMPILE_DEFINITIONS KMT_STANDALONE_DRIVER)
-add_cd_file(TARGET example_drv DESTINATION reactos/system32/drivers FOR all) +add_cd_file(TARGET example_drv DESTINATION reactos/bin FOR all)
Modified: branches/GSoC_2011/KMTestSuite/kmtests/example/example_drv.rbuild URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/ex... ============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/example/example_drv.rbuild [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/example/example_drv.rbuild [iso-8859-1] Fri Jul 22 11:33:17 2011 @@ -1,4 +1,4 @@ -<module name="example_drv" type="kernelmodedriver" installbase="system32/drivers" installname="example_drv.sys"> +<module name="example_drv" type="kernelmodedriver" installbase="bin" installname="example_drv.sys"> <include base="kmtest_drv">include</include> <library>ntoskrnl</library> <library>hal</library>
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] Fri Jul 22 11:33:17 2011 @@ -1,4 +1,4 @@ -<module name="kmtest" type="win32cui" installbase="system32" installname="kmtest.exe"> +<module name="kmtest" type="win32cui" installbase="bin" installname="kmtest.exe"> <include base="kmtest">include</include> <library>advapi32</library> <define name="KMT_USER_MODE" />
Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/km... ============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c [iso-8859-1] Fri Jul 22 11:33:17 2011 @@ -71,6 +71,33 @@ fprintf(stderr, "%s: error 0x%08lx: %s\n", ErrorFileAndLine, Error, Message);
LocalFree(Message); +} + +/** + * @name CompareTestNames + * + * strcmp that skips a leading '-' on either string if present + * + * @param Str1 + * @param Str2 + * @return see strcmp + */ +static +INT +CompareTestNames( + IN PCSTR Str1, + IN PCSTR Str2) +{ + if (*Str1 == '-') + ++Str1; + if (*Str2 == '-') + ++Str2; + while (*Str1 && *Str1 == *Str2) + { + ++Str1; + ++Str2; + } + return *Str1 - *Str2; }
/** @@ -118,7 +145,7 @@ } else { - int Result = strcmp(TestEntry->TestName, TestName); + INT Result = CompareTestNames(TestEntry->TestName, TestName);
if (Result == 0) {
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] Fri Jul 22 11:33:17 2011 @@ -1,10 +1,11 @@ -<module name="kmtest_drv" type="kernelmodedriver" installbase="system32/drivers" installname="kmtest_drv.sys"> +<module name="kmtest_drv" type="kernelmodedriver" installbase="bin" installname="kmtest_drv.sys"> <include base="kmtest_drv">include</include> <library>ntoskrnl</library> <library>hal</library> <library>pseh</library> <library>kmtest_printf</library> <define name="KMT_KERNEL_MODE" /> + <define name="NTDDI_VERSION">NTDDI_WS03SP1</define> <directory name="kmtest_drv"> <file>kmtest_drv.c</file> <file>testlist.c</file>
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] Fri Jul 22 11:33:17 2011 @@ -27,13 +27,13 @@
const KMT_TEST TestList[] = { - { "Example", Test_Example }, { "ExHardError", Test_ExHardError }, { "-ExHardErrorInteractive", Test_ExHardErrorInteractive }, { "ExInterlocked", Test_ExInterlocked }, { "ExPools", Test_ExPools }, { "ExResource", Test_ExResource }, { "ExTimer", Test_ExTimer }, + { "Example", Test_Example }, { "FsRtlExpression", Test_FsRtlExpression }, { "IoDeviceInterface", Test_IoDeviceInterface }, { "IoIrp", Test_IoIrp },
Modified: branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExInterlocked.c URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/nt... ============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExInterlocked.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExInterlocked.c [iso-8859-1] Fri Jul 22 11:33:17 2011 @@ -25,8 +25,6 @@ __declspec(dllimport) int __stdcall Exi386InterlockedIncrementLong(long *); __declspec(dllimport) int __stdcall Exi386InterlockedDecrementLong(long *);
-#undef NTDDI_VERSION -#define NTDDI_VERSION NTDDI_WS03SP1 #include <ntddk.h> #include <pseh/pseh2.h>
@@ -213,7 +211,7 @@ PKSPIN_LOCK pSpinLock = &SpinLock; PROCESSOR_STATE OldState, NewState;
- /* on x86, most of these are supported intrinsicly and don't need a spinlock! */ + /* on x86, most of these are supported intrinsically and don't need a spinlock! */ #if defined _M_IX86 || defined _M_AMD64 pSpinLock = NULL; #endif
Modified: branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExResource.c URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/nt... ============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExResource.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExResource.c [iso-8859-1] Fri Jul 22 11:33:17 2011 @@ -5,8 +5,6 @@ * PROGRAMMER: Thomas Faber thfabba@gmx.de */
-#undef NTDDI_VERSION -#define NTDDI_VERSION NTDDI_WS03SP1 #include <ntddk.h> #include <ntifs.h> #include <ndk/extypes.h>
Modified: branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeApc.c URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/nt... ============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeApc.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeApc.c [iso-8859-1] Fri Jul 22 11:33:17 2011 @@ -5,8 +5,6 @@ * PROGRAMMER: Thomas Faber thfabba@gmx.de */
-#undef NTDDI_VERSION -#define NTDDI_VERSION NTDDI_WS03SP1 #include <ntddk.h> #include <kmt_test.h>
Modified: branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeDpc.c URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/nt... ============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeDpc.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/ntos_ke/KeDpc.c [iso-8859-1] Fri Jul 22 11:33:17 2011 @@ -30,8 +30,7 @@ IN PVOID SystemArgument1, IN PVOID SystemArgument2) { - PKPCR Pcr = KeGetPcr(); - PKPRCB Prcb = Pcr->Prcb; + PKPRCB Prcb = KeGetCurrentPrcb();
ok_irql(DISPATCH_LEVEL); InterlockedIncrement(&DpcCount); @@ -58,7 +57,7 @@ ok_eq_pointer(Dpc->SystemArgument1, SystemArgument1); ok_eq_pointer(Dpc->SystemArgument2, SystemArgument2); ok_eq_pointer(Dpc->DpcData, NULL); - + ok_eq_uint(Prcb->DpcRoutineActive, 1); /* this DPC is not in the list anymore, but it was at the head! */ ok_eq_pointer(Prcb->DpcData[DPC_NORMAL].DpcListHead.Flink, Dpc->DpcListEntry.Flink);