]> git-server-git.apps.pok.os.sepia.ceph.com Git - googletest.git/commitdiff
Googletest export
authordmauro <dmauro@google.com>
Thu, 15 Oct 2020 16:38:46 +0000 (12:38 -0400)
committerDerek Mauro <dmauro@google.com>
Thu, 15 Oct 2020 17:32:43 +0000 (13:32 -0400)
Fixes build warnings from previous CL
Add CMake to internal presubmit to prevent these

PiperOrigin-RevId: 337325504

googlemock/include/gmock/gmock-matchers.h
googletest/include/gtest/internal/gtest-internal.h
googletest/test/gtest_unittest.cc

index 696f9e820f41afad7dd6082cfeefae3c128128ce..13a46712a89b38e42d441ad5e8ade82526b2834b 100644 (file)
@@ -2980,7 +2980,7 @@ auto UnpackStruct(const T& t)
 // The array ensures left-to-right order of evaluation.
 // Usage: VariadicExpand({expr...});
 template <typename T, size_t N>
-void VariadicExpand(const T (&a)[N]) {}
+void VariadicExpand(const T (&)[N]) {}
 
 template <typename Struct, typename StructSize>
 class FieldsAreMatcherImpl;
@@ -3029,13 +3029,13 @@ class FieldsAreMatcherImpl<Struct, IndexSequence<I...>>
       return good;
     }
 
-    int failed_pos = -1;
+    size_t failed_pos = ~size_t{};
 
     std::vector<StringMatchResultListener> inner_listener(sizeof...(I));
 
     VariadicExpand(
-        {failed_pos == -1 && !std::get<I>(matchers_).MatchAndExplain(
-                                 std::get<I>(tuple), &inner_listener[I])
+        {failed_pos == ~size_t{} && !std::get<I>(matchers_).MatchAndExplain(
+                                        std::get<I>(tuple), &inner_listener[I])
              ? failed_pos = I
              : 0 ...});
     if (failed_pos != ~size_t{}) {
index 0500dea62d4d0d3641f611514db4a1cacc02c5ad..d990c0f67b4e4c899968a708a167d4882fa319c1 100644 (file)
@@ -287,7 +287,7 @@ class FloatingPoint {
   //
   // See the following article for more details on ULP:
   // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
-  static const size_t kMaxUlps = 4;
+  static const uint32_t kMaxUlps = 4;
 
   // Constructs a FloatingPoint from a raw floating-point number.
   //
index 140395fbd8ec32366827e9f7761ff17e22c69703..56bfa8c5c3af2b3c25af975de06c0fdbae294295 100644 (file)
@@ -2768,7 +2768,7 @@ class FloatingPointTest : public Test {
   typedef typename Floating::Bits Bits;
 
   void SetUp() override {
-    const size_t max_ulps = Floating::kMaxUlps;
+    const uint32_t max_ulps = Floating::kMaxUlps;
 
     // The bits that represent 0.0.
     const Bits zero_bits = Floating(0).bits();