2011-06-13 17:29:02 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS kernel-mode tests
|
|
|
|
* LICENSE: GPLv2+ - See COPYING in the top level directory
|
2011-07-06 18:55:21 +00:00
|
|
|
* PURPOSE: Kernel-Mode Test Suite Example kernel-mode test part
|
2013-10-12 16:05:54 +00:00
|
|
|
* PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
|
2011-06-13 17:29:02 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <kmt_test.h>
|
|
|
|
|
2011-06-19 18:27:14 +00:00
|
|
|
START_TEST(Example)
|
2011-06-13 17:29:02 +00:00
|
|
|
{
|
2011-06-19 09:23:03 +00:00
|
|
|
KIRQL Irql;
|
|
|
|
|
|
|
|
ok(1, "This test should succeed.\n");
|
|
|
|
ok(0, "This test should fail.\n");
|
|
|
|
trace("Message from kernel, low-irql. %s. %ls.\n", "Format strings work", L"Even with Unicode");
|
|
|
|
KeRaiseIrql(HIGH_LEVEL, &Irql);
|
|
|
|
trace("Message from kernel, high-irql. %s. %ls.\n", "Format strings work", L"Even with Unicode");
|
2011-06-19 18:27:14 +00:00
|
|
|
|
|
|
|
ok_irql(DISPATCH_LEVEL);
|
|
|
|
ok_eq_int(5, 6);
|
|
|
|
ok_eq_uint(6U, 7U);
|
|
|
|
ok_eq_long(1L, 2L);
|
|
|
|
ok_eq_ulong(3LU, 4LU);
|
|
|
|
ok_eq_pointer((PVOID)8, (PVOID)9);
|
|
|
|
ok_eq_hex(0x1234LU, 0x5678LU);
|
2011-06-29 08:51:00 +00:00
|
|
|
ok_eq_bool(TRUE, TRUE);
|
|
|
|
ok_eq_bool(TRUE, FALSE);
|
|
|
|
ok_eq_bool(FALSE, TRUE);
|
2011-06-19 18:27:14 +00:00
|
|
|
ok_bool_true(FALSE, "foo");
|
|
|
|
ok_bool_false(TRUE, "bar");
|
|
|
|
ok_eq_print(1, 2, "%i");
|
|
|
|
ok_eq_str("Hello", "world");
|
|
|
|
ok_eq_wstr(L"ABC", L"DEF");
|
2011-06-29 08:51:00 +00:00
|
|
|
|
|
|
|
if (!skip(KeGetCurrentIrql() == HIGH_LEVEL, "This should only work on HIGH_LEVEL\n"))
|
|
|
|
{
|
|
|
|
/* do tests depending on HIGH_LEVEL here */
|
|
|
|
ok(1, "This is fine\n");
|
|
|
|
}
|
|
|
|
|
2011-06-19 09:23:03 +00:00
|
|
|
KeLowerIrql(Irql);
|
2011-06-13 17:29:02 +00:00
|
|
|
}
|