mirror of
https://github.com/google/googletest.git
synced 2025-12-01 16:47:28 -05:00
clang: fix -Wsign-conversion errors
Cast some values as their unsigned equivalents or `size_t` to match the parameter type used for the template object under test. Also, provide UInt32 equivalent delegate methods for some callers (with int-equivalents for backwards compatibility). This closes #2146. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
This commit is contained in:
@@ -700,7 +700,7 @@ class TypeParameterizedTest {
|
||||
// list.
|
||||
MakeAndRegisterTestInfo(
|
||||
(std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name +
|
||||
"/" + type_names[index])
|
||||
"/" + type_names[static_cast<size_t>(index)])
|
||||
.c_str(),
|
||||
StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
|
||||
GetTypeName<Type>().c_str(),
|
||||
|
||||
@@ -150,6 +150,9 @@ class GTEST_API_ String {
|
||||
// Formats an int value as "%X".
|
||||
static std::string FormatHexInt(int value);
|
||||
|
||||
// Formats an int value as "%X".
|
||||
static std::string FormatHexUInt32(UInt32 value);
|
||||
|
||||
// Formats a byte as "%02X".
|
||||
static std::string FormatByte(unsigned char value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user