Update the linguistic casing patches to print a FIXME that the flags are not fully supported.

This commit is contained in:
Erich E. Hoover 2014-04-05 14:28:26 -06:00
parent 69b0f7ebd7
commit e0b037b82a
3 changed files with 49 additions and 28 deletions

View File

@ -1,6 +1,6 @@
From cfd4d6f8d11668e8dba511bc74c805fb53a52d9d Mon Sep 17 00:00:00 2001
From 091f3c0d303ee4e7b2f44d1f28dc876bc845d471 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 12 Feb 2014 13:26:57 -0700
Date: Sat, 5 Apr 2014 14:25:59 -0600
Subject: kernel32/tests: Add a variety of tests for CompareStringEx.
---
@ -8,7 +8,7 @@ Subject: kernel32/tests: Add a variety of tests for CompareStringEx.
1 file changed, 200 insertions(+)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index 62e9f01..9aab6b0 100644
index 9abe53e..fc071a7 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -88,6 +88,8 @@ static INT (WINAPI *pIdnToUnicode)(DWORD, LPCWSTR, INT, LPWSTR, INT);
@ -231,7 +231,7 @@ index 62e9f01..9aab6b0 100644
static void test_LCMapStringA(void)
{
int ret, ret2;
@@ -3608,6 +3807,7 @@ START_TEST(locale)
@@ -3642,6 +3841,7 @@ START_TEST(locale)
test_GetCurrencyFormatA(); /* Also tests the W version */
test_GetNumberFormatA(); /* Also tests the W version */
test_CompareStringA();

View File

@ -1,28 +1,50 @@
From 216cec49d8aa2698a30351c56e9eb97bde71f587 Mon Sep 17 00:00:00 2001
From f1072f15073550d6d67844a1a26998db440b0c45 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 12 Feb 2014 13:27:10 -0700
Date: Sat, 5 Apr 2014 14:27:45 -0600
Subject: kernel32: Allow CompareStringEx NORM_LINGUISTIC_CASING flag.
---
dlls/kernel32/locale.c | 2 +-
dlls/kernel32/locale.c | 12 +++++++-----
dlls/kernel32/tests/locale.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
index 22903d5..24ca804 100644
index c1d89b7..9597895 100644
--- a/dlls/kernel32/locale.c
+++ b/dlls/kernel32/locale.c
@@ -2935,7 +2935,7 @@ INT WINAPI CompareStringEx(LPCWSTR locale, DWORD flags, LPCWSTR str1, INT len1,
@@ -2985,6 +2985,10 @@ INT WINAPI CompareStringW(LCID lcid, DWORD flags,
INT WINAPI CompareStringEx(LPCWSTR locale, DWORD flags, LPCWSTR str1, INT len1,
LPCWSTR str2, INT len2, LPNLSVERSIONINFO version, LPVOID reserved, LPARAM lParam)
{
+ DWORD supported_flags = NORM_IGNORECASE|NORM_IGNORENONSPACE|NORM_IGNORESYMBOLS|SORT_STRINGSORT
+ |NORM_IGNOREKANATYPE|NORM_IGNOREWIDTH|LOCALE_USE_CP_ACP;
+ DWORD semistub_flags = NORM_LINGUISTIC_CASING|0x10000000;
+ /* 0x10000000 is related to diacritics in Arabic, Japanese, and Hebrew */
INT ret;
if (version) FIXME("unexpected version parameter\n");
@@ -2997,16 +3001,14 @@ INT WINAPI CompareStringEx(LPCWSTR locale, DWORD flags, LPCWSTR str1, INT len1,
return 0;
}
- if( flags & ~(NORM_IGNORECASE|NORM_IGNORENONSPACE|NORM_IGNORESYMBOLS|
+ if( flags & ~(NORM_IGNORECASE|NORM_IGNORENONSPACE|NORM_IGNORESYMBOLS|NORM_LINGUISTIC_CASING|
SORT_STRINGSORT|NORM_IGNOREKANATYPE|NORM_IGNOREWIDTH|LOCALE_USE_CP_ACP|0x10000000) )
- SORT_STRINGSORT|NORM_IGNOREKANATYPE|NORM_IGNOREWIDTH|LOCALE_USE_CP_ACP|0x10000000) )
+ if (flags & ~(supported_flags|semistub_flags))
{
SetLastError(ERROR_INVALID_FLAGS);
return 0;
}
- /* this style is related to diacritics in Arabic, Japanese, and Hebrew */
- if (flags & 0x10000000)
- WARN("Ignoring unknown flags 0x10000000\n");
+ if (flags & semistub_flags)
+ FIXME("semi-stub behavor for flag(s) 0x%x\n", flags & semistub_flags);
if (len1 < 0) len1 = strlenW(str1);
if (len2 < 0) len2 = strlenW(str2);
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index 9aab6b0..bb6fbdc 100644
index fc071a7..d3c77d0 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -1543,7 +1543,7 @@ static const struct comparestringex_test comparestringex_tests[] = {

View File

@ -1,29 +1,28 @@
From aa81fa5f638112147fc7fd0ace9b7454f7ebf960 Mon Sep 17 00:00:00 2001
From a1c17bf8b5f54fdeb8b6ef25816478144b3c9aa8 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 12 Feb 2014 13:27:24 -0700
Date: Sat, 5 Apr 2014 14:27:53 -0600
Subject: kernel32: Allow CompareStringEx LINGUISTIC_IGNORECASE flag.
---
dlls/kernel32/locale.c | 3 ++-
dlls/kernel32/locale.c | 2 +-
dlls/kernel32/tests/locale.c | 6 +++---
2 files changed, 5 insertions(+), 4 deletions(-)
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
index 24ca804..3009df5 100644
index 9597895..eca0e39 100644
--- a/dlls/kernel32/locale.c
+++ b/dlls/kernel32/locale.c
@@ -2936,7 +2936,8 @@ INT WINAPI CompareStringEx(LPCWSTR locale, DWORD flags, LPCWSTR str1, INT len1,
}
@@ -2987,7 +2987,7 @@ INT WINAPI CompareStringEx(LPCWSTR locale, DWORD flags, LPCWSTR str1, INT len1,
{
DWORD supported_flags = NORM_IGNORECASE|NORM_IGNORENONSPACE|NORM_IGNORESYMBOLS|SORT_STRINGSORT
|NORM_IGNOREKANATYPE|NORM_IGNOREWIDTH|LOCALE_USE_CP_ACP;
- DWORD semistub_flags = NORM_LINGUISTIC_CASING|0x10000000;
+ DWORD semistub_flags = NORM_LINGUISTIC_CASING|LINGUISTIC_IGNORECASE|0x10000000;
/* 0x10000000 is related to diacritics in Arabic, Japanese, and Hebrew */
INT ret;
if( flags & ~(NORM_IGNORECASE|NORM_IGNORENONSPACE|NORM_IGNORESYMBOLS|NORM_LINGUISTIC_CASING|
- SORT_STRINGSORT|NORM_IGNOREKANATYPE|NORM_IGNOREWIDTH|LOCALE_USE_CP_ACP|0x10000000) )
+ SORT_STRINGSORT|NORM_IGNOREKANATYPE|NORM_IGNOREWIDTH|LOCALE_USE_CP_ACP|
+ LINGUISTIC_IGNORECASE|0x10000000) )
{
SetLastError(ERROR_INVALID_FLAGS);
return 0;
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index bb6fbdc..5eda11b 100644
index d3c77d0..597de37 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -1568,11 +1568,11 @@ static const struct comparestringex_test comparestringex_tests[] = {