https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3f9f5f708035eea1bad89…
commit 3f9f5f708035eea1bad892e3067c36beaf9ea70a
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sat Aug 25 14:23:45 2018 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sat Aug 25 14:26:50 2018 +0200
[KMTESTS:FSRTL] Add tests for the FsRtlIsAnsiCharacter* macro
This covers: FsRtlIsAnsiCharacterWild, FsRtlIsAnsiCharacterLegalFat,
FsRtlIsAnsiCharacterLegalHpfs,
FsRtlIsAnsiCharacterLegalNtfs, FsRtlIsAnsiCharacterLegalNtfsStream
---
modules/rostests/kmtests/ntos_fsrtl/FsRtlLegal.c | 30 +++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/modules/rostests/kmtests/ntos_fsrtl/FsRtlLegal.c
b/modules/rostests/kmtests/ntos_fsrtl/FsRtlLegal.c
index 4391db7518..c5a6dc1f55 100644
--- a/modules/rostests/kmtests/ntos_fsrtl/FsRtlLegal.c
+++ b/modules/rostests/kmtests/ntos_fsrtl/FsRtlLegal.c
@@ -279,6 +279,34 @@ START_TEST(FsRtlLegal)
for (i = 0; i <= 0x7f; ++i)
{
- ok(LegalAnsiCharacterArray[i] == (*FsRtlLegalAnsiCharacterArray)[i],
"Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i,
LegalAnsiCharacterArray[i], (*FsRtlLegalAnsiCharacterArray)[i]);
+ ok(LegalAnsiCharacterArray[i] == (*FsRtlLegalAnsiCharacterArray)[i],
+ "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i,
LegalAnsiCharacterArray[i], (*FsRtlLegalAnsiCharacterArray)[i]);
+
+ ok((FsRtlIsAnsiCharacterWild(i) != 0) ==
BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_WILD_CHARACTER),
+ "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i,
FsRtlIsAnsiCharacterWild(i), BooleanFlagOn(LegalAnsiCharacterArray[i],
FSRTL_WILD_CHARACTER));
+
+ ok((FsRtlIsAnsiCharacterLegalFat(i, FALSE) != 0) ==
BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_FAT_LEGAL),
+ "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i,
FsRtlIsAnsiCharacterLegalFat(i, FALSE), BooleanFlagOn(LegalAnsiCharacterArray[i],
FSRTL_FAT_LEGAL));
+ ok((FsRtlIsAnsiCharacterLegalFat(i, TRUE) != 0) ==
(BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_FAT_LEGAL) ||
BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_WILD_CHARACTER)),
+ "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i,
FsRtlIsAnsiCharacterLegalFat(i, TRUE),
+
(BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_FAT_LEGAL) ||
BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_WILD_CHARACTER)));
+
+ ok((FsRtlIsAnsiCharacterLegalHpfs(i, FALSE) != 0) ==
BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_HPFS_LEGAL),
+ "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i,
FsRtlIsAnsiCharacterLegalHpfs(i, FALSE), BooleanFlagOn(LegalAnsiCharacterArray[i],
FSRTL_HPFS_LEGAL));
+ ok((FsRtlIsAnsiCharacterLegalHpfs(i, TRUE) != 0) ==
(BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_HPFS_LEGAL) ||
BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_WILD_CHARACTER)),
+ "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i,
FsRtlIsAnsiCharacterLegalHpfs(i, TRUE),
+
(BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_HPFS_LEGAL) ||
BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_WILD_CHARACTER)));
+
+ ok((FsRtlIsAnsiCharacterLegalNtfs(i, FALSE) != 0) ==
BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_NTFS_LEGAL),
+ "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i,
FsRtlIsAnsiCharacterLegalNtfs(i, FALSE), BooleanFlagOn(LegalAnsiCharacterArray[i],
FSRTL_NTFS_LEGAL));
+ ok((FsRtlIsAnsiCharacterLegalNtfs(i, TRUE) != 0) ==
(BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_NTFS_LEGAL) ||
BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_WILD_CHARACTER)),
+ "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i,
FsRtlIsAnsiCharacterLegalNtfs(i, TRUE),
+
(BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_NTFS_LEGAL) ||
BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_WILD_CHARACTER)));
+
+ ok((FsRtlIsAnsiCharacterLegalNtfsStream(i, FALSE) != 0) ==
BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_NTFS_STREAM_LEGAL),
+ "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i,
FsRtlIsAnsiCharacterLegalNtfsStream(i, FALSE), BooleanFlagOn(LegalAnsiCharacterArray[i],
FSRTL_NTFS_STREAM_LEGAL));
+ ok((FsRtlIsAnsiCharacterLegalNtfsStream(i, TRUE) !=0 ) ==
(BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_NTFS_STREAM_LEGAL) ||
BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_WILD_CHARACTER)),
+ "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i,
FsRtlIsAnsiCharacterLegalNtfsStream(i, TRUE),
+
(BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_NTFS_STREAM_LEGAL) ||
BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_WILD_CHARACTER)));
}
}