kernel32: implement IsValidLocaleName (with tests)

Nikolay Sivov bunglehead at gmail.com
Thu Jul 26 23:11:41 CDT 2012


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).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20120727/c68b2e0b/attachment.html>


More information about the wine-devel mailing list