kernel32/tests: check that sLanguage is ignored by GetLocaleInfo
Jeff Zaroyko
jeffzaroyko at gmail.com
Tue Aug 25 04:24:54 CDT 2009
-------------- next part --------------
From 9b19ebf3478b1361fe72c0c48d73fad137e73955 Mon Sep 17 00:00:00 2001
From: Jeff Zaroyko <jeffz at jeffz.name>
Date: Tue, 25 Aug 2009 18:37:46 +1000
Subject: kernel32/tests: check that sLanguage is ignored by GetLocaleInfo
---
dlls/kernel32/tests/locale.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index 8a56100..b028663 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -34,6 +34,7 @@
#include "winbase.h"
#include "winerror.h"
#include "winnls.h"
+#include "winreg.h"
static inline unsigned int strlenW( const WCHAR *str )
{
@@ -119,6 +120,7 @@ static void test_GetLocaleInfoA(void)
{
int ret;
int len;
+ HKEY cpl;
LCID lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
char buffer[BUFFER_SIZE];
char expected[BUFFER_SIZE];
@@ -192,6 +194,20 @@ static void test_GetLocaleInfoA(void)
ret = GetLocaleInfoA(lcid, NUO|LOCALE_SDAYNAME1, buffer, 10);
ok(ret == 7, "Expected ret == 7, got %d, error %d\n", ret, GetLastError());
ok(!strcmp(buffer, "Monday"), "Expected 'Monday', got '%s'\n", buffer);
+
+ /* Test that ControlPanel/sLanguage does not override LOCALE_SLANGUAGE */
+ memset(buffer, 0, COUNTOF(buffer));
+ ret = RegOpenKeyExA(HKEY_CURRENT_USER, "Control Panel\\International", 0, KEY_ALL_ACCESS, &cpl);
+ ok(ret == ERROR_SUCCESS, "Couldn't get required access to Control Panel\\International\n");
+ if (ret == ERROR_SUCCESS) {
+ BYTE current_sLanguage[BUFFER_SIZE];
+ DWORD length;
+ RegQueryValueExA(cpl, "sLanguage", NULL, NULL, current_sLanguage, &length);
+ RegSetValueExA(cpl, "sLanguage", 0, REG_SZ, (LPBYTE)"foo", 4);
+ GetLocaleInfoA(GetSystemDefaultLCID(), LOCALE_SLANGUAGE, buffer, COUNTOF(buffer));
+ todo_wine ok(0 != strcmp(buffer, "foo"), "sLanguage should not override LOCALE_SLANGUAGE!\n");
+ RegSetValueExA(cpl, "sLanguage", 0, REG_SZ, current_sLanguage, length);
+ }
}
static void test_GetTimeFormatA(void)
--
1.5.4.3
More information about the wine-patches
mailing list