Hans Leidekker : ntdll: Add some tests for RtlIsTextUnicode.
Alexandre Julliard
julliard at winehq.org
Fri May 14 11:17:29 CDT 2010
Module: wine
Branch: master
Commit: d1c8769b6449a6055b2681bab899922e70f6ac03
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d1c8769b6449a6055b2681bab899922e70f6ac03
Author: Hans Leidekker <hans at codeweavers.com>
Date: Fri May 14 15:36:54 2010 +0200
ntdll: Add some tests for RtlIsTextUnicode.
---
dlls/ntdll/tests/rtlstr.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/dlls/ntdll/tests/rtlstr.c b/dlls/ntdll/tests/rtlstr.c
index 46d88c5..5dd3500 100644
--- a/dlls/ntdll/tests/rtlstr.c
+++ b/dlls/ntdll/tests/rtlstr.c
@@ -1695,6 +1695,8 @@ static void test_RtlIntegerToChar(void)
static void test_RtlIsTextUnicode(void)
{
char ascii[] = "A simple string";
+ char false_positive[] = {0x41, 0x0a, 0x0d, 0x1d};
+ WCHAR false_negative = 0x0d0a;
WCHAR unicode[] = {'A',' ','U','n','i','c','o','d','e',' ','s','t','r','i','n','g',0};
WCHAR unicode_no_controls[] = {'A','U','n','i','c','o','d','e','s','t','r','i','n','g',0};
/* String with both byte-reversed and standard Unicode control characters. */
@@ -1810,6 +1812,11 @@ static void test_RtlIsTextUnicode(void)
ok(!pRtlIsTextUnicode(mixed_controls, sizeof(mixed_controls), &flags), "Test should pass on string containing both byte-reversed and standard control characters.\n");
ok(flags == (IS_TEXT_UNICODE_CONTROLS | IS_TEXT_UNICODE_REVERSE_CONTROLS), "Expected flags 0x44, obtained %x\n", flags);
+ flags = IS_TEXT_UNICODE_STATISTICS;
+ todo_wine ok(pRtlIsTextUnicode(false_positive, sizeof(false_positive), &flags), "Test should pass on false positive.\n");
+
+ ok(!pRtlIsTextUnicode(&false_negative, sizeof(false_negative), NULL), "Test should fail on 0x0d0a (MALAYALAM LETTER UU).\n");
+
HeapFree(GetProcessHeap(), 0, be_unicode);
HeapFree(GetProcessHeap(), 0, be_unicode_no_controls);
}
More information about the wine-cvs
mailing list