2 * Kernel Mode regression Test
5 * Copyright 2004 Filip Navara <xnavara@volny.cz>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; see the file COPYING.LIB.
19 * If not, write to the Free Software Foundation,
20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 /* INCLUDES *******************************************************************/
25 #include <ddk/ntddk.h>
32 /* PRIVATE FUNCTIONS ***********************************************************/
41 FinishTest(LPSTR TestName
)
43 DbgPrint("Test %s finished with %d succeses and %d failures\n", TestName
, successes
, failures
);
46 void kmtest_set_location(const char* file
, int line
)
48 glob_data
.current_file
=strrchr(file
,'/');
49 if (glob_data
.current_file
==NULL
)
50 glob_data
.current_file
=strrchr(file
,'\\');
51 if (glob_data
.current_file
==NULL
)
52 glob_data
.current_file
=file
;
54 glob_data
.current_file
++;
55 glob_data
.current_line
=line
;
61 * - condition - condition to check;
62 * - msg test description;
63 * - file - test application source code file name of the check
64 * - line - test application source code file line number of the check
66 * 0 if condition does not have the expected value, 1 otherwise
68 int kmtest_ok(int condition
, const char *msg
, ... )
77 va_start(valist
, msg
);
78 vsprintf(string
, msg
, valist
);
79 DbgPrint( "%s:%d: Test failed: %s\n",
80 glob_data
.current_file
, glob_data
.current_line
, string
);
85 DbgPrint( "%s:%d: Test failed\n",
86 glob_data
.current_file
, glob_data
.current_line
);
88 InterlockedIncrement(&failures
);
94 fprintf( stdout, "%s:%d: Test succeeded\n",
95 glob_data.current_file, glob_data.current_line);*/
96 InterlockedIncrement(&successes
);
101 /* PUBLIC FUNCTIONS ***********************************************************/
106 VOID
NtoskrnlIoMdlTest();
107 VOID
NtoskrnlIoDeviceInterface();
108 VOID
NtoskrnlObTest();
109 VOID
NtoskrnlExecutiveTests();
110 VOID
NtoskrnlPoolsTest();
117 DriverEntry(PDRIVER_OBJECT DriverObject
,
118 PUNICODE_STRING RegistryPath
)
120 DbgPrint("\n===============================================\nKernel Mode Regression Test driver starting...\n");
121 //NtoskrnlExecutiveTests();
122 //NtoskrnlIoDeviceInterface();
123 //NtoskrnlIoMdlTest();
128 return STATUS_SUCCESS
;