diff options
author | Enji Cooper <yaneurabeya@gmail.com> | 2019-03-08 11:09:00 -0800 |
---|---|---|
committer | Enji Cooper <yaneurabeya@gmail.com> | 2019-04-05 21:30:19 -0700 |
commit | 3829b84e9927a2a77a7634a8e7b010cc57095e1b (patch) | |
tree | 14762102e4f3bb5c34ff91711ce181a95574b812 /googletest/include | |
parent | 5ba69d5cb93779fba14bf438dfdaf589e2b92071 (diff) | |
download | googletest-3829b84e9927a2a77a7634a8e7b010cc57095e1b.tar.gz googletest-3829b84e9927a2a77a7634a8e7b010cc57095e1b.zip |
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>
Diffstat (limited to 'googletest/include')
-rw-r--r-- | googletest/include/gtest/internal/gtest-internal.h | 2 | ||||
-rw-r--r-- | googletest/include/gtest/internal/gtest-string.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index d16586c3..49887170 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -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(), diff --git a/googletest/include/gtest/internal/gtest-string.h b/googletest/include/gtest/internal/gtest-string.h index 4c9b6262..884b1e16 100644 --- a/googletest/include/gtest/internal/gtest-string.h +++ b/googletest/include/gtest/internal/gtest-string.h @@ -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); |