gtest: backport ansi color fix

Fixes ubsan runs for Mesa3D.

Adds prevents from returning
nullptr by choosing default color.

Upstream PR: https://github.com/google/googletest/pull/4322

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9404
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24783>
This commit is contained in:
David Heidelberg
2023-07-26 00:58:06 +02:00
committed by Marge Bot
parent 798becf2da
commit 05cb55abe8

View File

@@ -3216,7 +3216,8 @@ static const char* GetAnsiColorCode(GTestColor color) {
case GTestColor::kYellow:
return "3";
default:
return nullptr;
assert(false);
return "9" ;
}
}