]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
log: silence warning from -Wsign-compare 18326/head
authorJos Collin <jcollin@redhat.com>
Mon, 16 Oct 2017 10:50:24 +0000 (16:20 +0530)
committerJos Collin <jcollin@redhat.com>
Mon, 16 Oct 2017 12:19:13 +0000 (17:49 +0530)
This warning appears in jenkins build:

/home/jenkins-build/build/workspace/ceph-pull-requests/src/log/test.cc:266:232:   required from here
/home/jenkins-build/build/workspace/ceph-pull-requests/src/googletest/googletest/include/gtest/gtest.h:1392:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (lhs == rhs) {

Signed-off-by: Jos Collin <jcollin@redhat.com>
src/log/test.cc

index 2ae63a741c80401e735c68e2d9704fce534e8efa..fc50878c4817cbf00a79f1e4a998fafc202f9469 100644 (file)
@@ -263,7 +263,7 @@ TEST(Log, TimeFormat)
     ceph::logging::append_time(t, buf, buflen);
     auto c = std::strrchr(buf, '.');
     ASSERT_NE(c, nullptr);
-    ASSERT_EQ(strlen(c + 1), 3);
+    ASSERT_EQ(3u, strlen(c + 1));
   }
   {
     clock.refine();
@@ -271,6 +271,6 @@ TEST(Log, TimeFormat)
     ceph::logging::append_time(t, buf, buflen);
     auto c = std::strrchr(buf, '.');
     ASSERT_NE(c, nullptr);
-    ASSERT_EQ(std::strlen(c + 1), 6);
+    ASSERT_EQ(6u, std::strlen(c + 1));
   }
 }