summaryrefslogtreecommitdiffstats
path: root/googletest/include/gtest/internal
diff options
context:
space:
mode:
authorEnji Cooper <yaneurabeya@gmail.com>2019-03-08 19:09:00 (GMT)
committerEnji Cooper <yaneurabeya@gmail.com>2019-04-06 04:30:19 (GMT)
commit3829b84e9927a2a77a7634a8e7b010cc57095e1b (patch)
tree14762102e4f3bb5c34ff91711ce181a95574b812 /googletest/include/gtest/internal
parent5ba69d5cb93779fba14bf438dfdaf589e2b92071 (diff)
downloadgoogletest-3829b84e9927a2a77a7634a8e7b010cc57095e1b.zip
googletest-3829b84e9927a2a77a7634a8e7b010cc57095e1b.tar.gz
googletest-3829b84e9927a2a77a7634a8e7b010cc57095e1b.tar.bz2
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/gtest/internal')
-rw-r--r--googletest/include/gtest/internal/gtest-internal.h2
-rw-r--r--googletest/include/gtest/internal/gtest-string.h3
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 d16586c..4988717 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 4c9b626..884b1e1 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);