diff options
author | Baruch <bmburstein@gmail.com> | 2022-09-14 18:46:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-14 18:46:21 (GMT) |
commit | 56070d8903bc7b9abbba952afa5e54209a08c0a2 (patch) | |
tree | 2b959ca7f37ea42cf89222b2d7b5c0249971a423 /googletest | |
parent | dd969ed5fed68a518027ea1655579fa8768f3aae (diff) | |
parent | 1336c4b6d1a6f4bc6beebccb920e5ff858889292 (diff) | |
download | googletest-56070d8903bc7b9abbba952afa5e54209a08c0a2.zip googletest-56070d8903bc7b9abbba952afa5e54209a08c0a2.tar.gz googletest-56070d8903bc7b9abbba952afa5e54209a08c0a2.tar.bz2 |
Merge branch 'google:main' into custom_type_combine
Diffstat (limited to 'googletest')
-rw-r--r-- | googletest/src/gtest-printers.cc | 2 | ||||
-rw-r--r-- | googletest/src/gtest.cc | 9 |
2 files changed, 4 insertions, 7 deletions
diff --git a/googletest/src/gtest-printers.cc b/googletest/src/gtest-printers.cc index f3976d2..d475ad3 100644 --- a/googletest/src/gtest-printers.cc +++ b/googletest/src/gtest-printers.cc @@ -315,7 +315,7 @@ void PrintTo(__uint128_t v, ::std::ostream* os) { low = low / 10 + high_mod * 1844674407370955161 + carry / 10; char digit = static_cast<char>(carry % 10); - *--p = '0' + digit; + *--p = static_cast<char>('0' + digit); } *os << p; } diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 513a887..81409a3 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -3245,18 +3245,15 @@ bool ShouldUseColor(bool stdout_is_tty) { #else // On non-Windows platforms, we rely on the TERM variable. const char* const term = posix::GetEnv("TERM"); - const bool term_supports_color = + const bool term_supports_color = term != nullptr && ( String::CStringEquals(term, "xterm") || String::CStringEquals(term, "xterm-color") || - String::CStringEquals(term, "xterm-256color") || String::CStringEquals(term, "screen") || - String::CStringEquals(term, "screen-256color") || String::CStringEquals(term, "tmux") || - String::CStringEquals(term, "tmux-256color") || String::CStringEquals(term, "rxvt-unicode") || - String::CStringEquals(term, "rxvt-unicode-256color") || String::CStringEquals(term, "linux") || - String::CStringEquals(term, "cygwin"); + String::CStringEquals(term, "cygwin") || + String::EndsWithCaseInsensitive(term, "-256color")); return stdout_is_tty && term_supports_color; #endif // GTEST_OS_WINDOWS } |