aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZulkarnine Mahmud <zulkarnine2076@gmail.com>2017-06-21 09:17:51 +0900
committerGitHub <noreply@github.com>2017-06-21 09:17:51 +0900
commit365df11427eb40e6458adee2b5ace7191b883efa (patch)
tree83d625c35514abe7a12fa13ffca88f02aaad8010
parent649aa295523885723ea4c9d56148ebe2b9b8a239 (diff)
downloadgoogletest-365df11427eb40e6458adee2b5ace7191b883efa.tar.gz
googletest-365df11427eb40e6458adee2b5ace7191b883efa.tar.bz2
googletest-365df11427eb40e6458adee2b5ace7191b883efa.zip
Add background_mask instead of using magic number
-rw-r--r--googletest/src/gtest.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index 1e6afb28..1ac2d6a1 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -2980,7 +2980,8 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);
const WORD old_color_attrs = buffer_info.wAttributes;
// Let's reuse the BG
- const WORD existing_bg = old_color_attrs & 0x00F0;
+ const WORD background_mask = BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY;
+ const WORD existing_bg = old_color_attrs & background_mask;
// We need to flush the stream buffers into the console before each
// SetConsoleTextAttribute call lest it affect the text that is already