From fc00f17c665bb4197a1971ecac1a1fabedd56e15 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Tue, 13 Mar 2012 21:07:55 +0000 Subject: [PATCH] [KMTEST] Add a few more tests. Two should fail on ReactOS svn path=/trunk/; revision=56141 --- rostests/kmtests/ntos_fsrtl/FsRtlExpression.c | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/rostests/kmtests/ntos_fsrtl/FsRtlExpression.c b/rostests/kmtests/ntos_fsrtl/FsRtlExpression.c index 5d1b043d78d..37b943f9d7b 100644 --- a/rostests/kmtests/ntos_fsrtl/FsRtlExpression.c +++ b/rostests/kmtests/ntos_fsrtl/FsRtlExpression.c @@ -24,6 +24,12 @@ static VOID FsRtlIsNameInExpressionTest() ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); RtlInitUnicodeString(&Expression, L""); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); + + RtlInitUnicodeString(&Expression, L"**"); + RtlInitUnicodeString(&Name, L""); + ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == FALSE, "expected FALSE, got TRUE"); + RtlInitUnicodeString(&Name, L"a"); + ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); } RtlInitUnicodeString(&Expression, L"ntdll.dll"); @@ -176,6 +182,14 @@ static VOID FsRtlIsNameInExpressionTest() RtlInitUnicodeString(&Name, L"127.0.0.1"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); + RtlInitUnicodeString(&Expression, L"*?*?*?*"); + RtlInitUnicodeString(&Name, L"1.0.0.1"); + ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); + RtlInitUnicodeString(&Expression, L"?*?*?*?"); + ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); + RtlInitUnicodeString(&Expression, L"?.?.?.?"); + ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); + RtlInitUnicodeString(&Expression, L"*a*ab*abc"); RtlInitUnicodeString(&Name, L"aabaabcdadabdabc"); ok(FsRtlIsNameInExpression(&Expression, &Name, FALSE, NULL) == TRUE, "expected TRUE, got FALSE"); @@ -192,6 +206,12 @@ static VOID FsRtlIsDbcsInExpressionTest() ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); RtlInitAnsiString(&Expression, ""); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); + + RtlInitAnsiString(&Expression, "**"); + RtlInitAnsiString(&Name, ""); + ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); + RtlInitAnsiString(&Name, "a"); + ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); } RtlInitAnsiString(&Expression, "ntdll.dll"); @@ -339,11 +359,19 @@ static VOID FsRtlIsDbcsInExpressionTest() RtlInitAnsiString(&Name, "winhlp32.exe"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == FALSE, "expected FALSE, got TRUE"); - /* Backtracking tetss */ + /* Backtracking tests */ RtlInitAnsiString(&Expression, "*.*.*.*"); RtlInitAnsiString(&Name, "127.0.0.1"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); + RtlInitAnsiString(&Expression, "*?*?*?*"); + RtlInitAnsiString(&Name, "1.0.0.1"); + ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); + RtlInitAnsiString(&Expression, "?*?*?*?"); + ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); + RtlInitAnsiString(&Expression, "?.?.?.?"); + ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE"); + RtlInitAnsiString(&Expression, "*a*ab*abc"); RtlInitAnsiString(&Name, "aabaabcdadabdabc"); ok(FsRtlIsDbcsInExpression(&Expression, &Name) == TRUE, "expected TRUE, got FALSE");