Re: kernel32: implement IsValidLocaleName (with tests)
On 7/27/2012 06:00, Austin English wrote:
+ if ( !locale_name.matches ) + return FALSE; + return TRUE;
Considering recent cleanup of such constructs please return like 'return locale_name.matches != 0;' or something like that.
+static void test_IsValidLocaleName(void) +{ + static const WCHAR enW[] = {'e','n',0}; + static const WCHAR enusW[] = {'e','n','-','U','S',0}; + static const WCHAR zzW[] = {'z','z',0}; + static const WCHAR zzzzW[] = {'z','z','-','Z','Z',0}; + BOOL ret; Please iterate through test data so it could be easily extended in future.
Also it looks like duplication, please add some invalid locale names tests for LocaleNameToLCID and if return 0 for example, simply use it for validation (you'll get covered with LOCALE_NAME_USER_DEFAULT things for example).
participants (1)
-
Nikolay Sivov