Fixes building tests in Visual Studio with msvc's own crt headers.
---
This follows patches in other places that replaced it first with _strnicmp(a, b, -1), and later with _stricmp(a, b), because _strnicmp with size=-1 raises a runtime error.
-- v2: test.h: Don't use \e. include/test.h: Don't use strcasecmp.
From: Stefan D��singer stefan@codeweavers.com
Fixes building tests in Visual Studio with msvc's own crt headers. --- include/wine/test.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/wine/test.h b/include/wine/test.h index 505f0daaaf4..d1036f9dcd4 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -743,7 +743,7 @@ int main( int argc, char **argv )
if (GetEnvironmentVariableA( "WINETEST_COLOR", p, sizeof(p) )) { - BOOL automode = !strcasecmp(p, "auto"); + BOOL automode = !strcmp(p, "auto"); winetest_color = automode ? isatty( fileno( stdout ) ) : atoi(p); /* enable ANSI support for Windows console */ if (winetest_color)
From: Stefan D��singer stefan@codeweavers.com
Msvc does not support it.
---
According to Wikipedia, it is not standard C, citing
https://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.10.pdf
which in turn says "Proposals to add '\e' for ASCII ESC ('\033') were not adopted because other popular character sets have no obvious equivalent" --- include/wine/test.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/wine/test.h b/include/wine/test.h index d1036f9dcd4..605081607f1 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -300,14 +300,14 @@ const char *winetest_elapsed(void) return wine_dbg_sprintf( "%.3f", (now - winetest_start_time) / 1000.0); }
-static const char color_reset[] = "\e[0m"; -static const char color_dark_red[] = "\e[31m"; -static const char color_dark_purple[] = "\e[35m"; -static const char color_green[] = "\e[32m"; -static const char color_yellow[] = "\e[33m"; -static const char color_blue[] = "\e[34m"; -static const char color_bright_red[] = "\e[1;91m"; -static const char color_bright_purple[] = "\e[1;95m"; +static const char color_reset[] = "\x1b[0m"; +static const char color_dark_red[] = "\x1b[31m"; +static const char color_dark_purple[] = "\x1b[35m"; +static const char color_green[] = "\x1b[32m"; +static const char color_yellow[] = "\x1b[33m"; +static const char color_blue[] = "\x1b[34m"; +static const char color_bright_red[] = "\x1b[1;91m"; +static const char color_bright_purple[] = "\x1b[1;95m";
static void winetest_printf( const char *msg, ... ) __WINE_PRINTF_ATTR(1,2); static void winetest_printf( const char *msg, ... )