From 170a85f677a3c4bc6f134f3dd6a49218e91b10d5 Mon Sep 17 00:00:00 2001 From: henri Date: Sat, 10 Aug 2013 20:19:38 +0000 Subject: [PATCH] Don't use ANSI color sequences on windows. Pointed out by Gisle Vanem. Fixed it in a way that makes it easy to disable on other systems as well. --- nsock/tests/tests_main.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/nsock/tests/tests_main.c b/nsock/tests/tests_main.c index b163224c2..0de198317 100644 --- a/nsock/tests/tests_main.c +++ b/nsock/tests/tests_main.c @@ -7,12 +7,18 @@ #include "test-common.h" -#define RESET "\033[0m" -#define BOLDRED "\033[1m\033[31m" -#define BOLDGREEN "\033[1m\033[32m" +#ifndef WIN32 + #define RESET "\033[0m" + #define BOLDRED "\033[1m\033[31m" + #define BOLDGREEN "\033[1m\033[32m" + #define TEST_FAILED "[" BOLDRED "FAILED" RESET "]" + #define TEST_OK "[" BOLDGREEN "OK" RESET "]" +#else + /* WIN32 terminal has no ANSI driver */ + #define TEST_FAILED "[FAILED]" + #define TEST_OK "[OK]" +#endif -#define TEST_FAILED "[" BOLDRED "FAILED" RESET "]" -#define TEST_OK "[" BOLDGREEN "OK" RESET "]" /* socket_strerror() comes from nbase