From 94cacc3dd95fc0c4652650995eaaedc34a3fd2d1 Mon Sep 17 00:00:00 2001 From: Daniel Lehman Date: Tue, 1 May 2018 14:28:23 -0700 Subject: [PATCH 3/4] msvcr110/tests: Add setlocale tests. Signed-off-by: Daniel Lehman --- configure.ac | 1 + dlls/msvcr110/tests/Makefile.in | 5 +++ dlls/msvcr110/tests/msvcr110.c | 78 +++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 dlls/msvcr110/tests/Makefile.in create mode 100644 dlls/msvcr110/tests/msvcr110.c diff --git a/configure.ac b/configure.ac index fe8ffaa00ed..c41279d7c86 100644 --- a/configure.ac +++ b/configure.ac @@ -3459,6 +3459,7 @@ WINE_CONFIG_MAKEFILE(dlls/msvcp90/tests) WINE_CONFIG_MAKEFILE(dlls/msvcr100) WINE_CONFIG_MAKEFILE(dlls/msvcr100/tests) WINE_CONFIG_MAKEFILE(dlls/msvcr110) +WINE_CONFIG_MAKEFILE(dlls/msvcr110/tests) WINE_CONFIG_MAKEFILE(dlls/msvcr120) WINE_CONFIG_MAKEFILE(dlls/msvcr120/tests) WINE_CONFIG_MAKEFILE(dlls/msvcr120_app) diff --git a/dlls/msvcr110/tests/Makefile.in b/dlls/msvcr110/tests/Makefile.in new file mode 100644 index 00000000000..e8fa81889df --- /dev/null +++ b/dlls/msvcr110/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = msvcr110.dll +APPMODE = -mno-cygwin + +C_SRCS = \ + msvcr110.c diff --git a/dlls/msvcr110/tests/msvcr110.c b/dlls/msvcr110/tests/msvcr110.c new file mode 100644 index 00000000000..6b8f327fb86 --- /dev/null +++ b/dlls/msvcr110/tests/msvcr110.c @@ -0,0 +1,78 @@ +/* + * Copyright 2018 + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "wine/test.h" + +#include + +static char* (CDECL *p_setlocale)(int category, const char* locale); + +static BOOL init(void) +{ + HMODULE module; + + module = LoadLibraryA("msvcr110.dll"); + if (!module) + { + win_skip("msvcr110.dll not installed\n"); + return FALSE; + } + + p_setlocale = (void*)GetProcAddress(module, "setlocale"); + return TRUE; +} + +static void test_setlocale(void) +{ + int i; + char *ret; + static const char *names[] = + { + "en-us", + "en-US", + "EN-US", + "syr-SY", + "uz-Latn-uz", + }; + + for(i=0; i