Testcase for Bug #1845

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Sat Dec 13 17:43:40 CST 2003


Changelog:
	dlls/user/test/wsprintf.c
	testcase for Bug #1845
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: wine/dlls/user/tests/wsprintf.c
===================================================================
RCS file: /home/wine/wine/dlls/user/tests/wsprintf.c,v
retrieving revision 1.4
diff -u -r1.4 wsprintf.c
--- wine/dlls/user/tests/wsprintf.c	5 Sep 2003 23:08:29 -0000	1.4
+++ wine/dlls/user/tests/wsprintf.c	13 Dec 2003 23:41:02 -0000
@@ -50,8 +50,41 @@
        "wsprintfW zero padded negative value failure");
 }
 
+/* Test if the CharUpper / CharLower functions return true 16 bit results,
+   if the input is a 16 bit input value. Upto Wine 11-2003 the input value
+   0xff returns 0xffffffff. */
+
+static void CharUpperTest(void)
+{
+    int i,out,failed;
+
+    failed = 0;
+    for (i=0;i<256;i++)
+    	{
+	    out = (DWORD) CharUpper((LPTSTR)i);
+	    printf("%0x\n",out); 
+	    ok(HIWORD(out) == 0,"CharLower failed - 16bit input (0x%0x) returned 32bit result (0x%0x)",i,out);
+	}
+}
+
+static void CharLowerTest(void)
+{
+    int i;
+    DWORD out;
+    
+    for (i=0;i<256;i++)
+    {
+	out = (DWORD) CharLower((LPTSTR)i);
+	printf("%0x\n",out); 
+	ok(HIWORD(out) == 0,"CharLower failed - 16bit input (0x%0x) returned 32bit result (0x%0x)",i,out);
+    }
+}
+
+
 START_TEST(wsprintf)
 {
+    CharUpperTest();
+    CharLowerTest();
     wsprintfATest();
     wsprintfWTest();
 }



More information about the wine-patches mailing list