You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by ja...@apache.org on 2020/11/26 06:14:59 UTC

[incubator-brpc] 02/05: fix some warnings

This is an automated email from the ASF dual-hosted git repository.

jamesge pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git

commit 74d156c840f86adff0ca13bfee5c9484b0674f5b
Author: jamesge <jg...@gmail.com>
AuthorDate: Wed Nov 25 20:19:14 2020 +0800

    fix some warnings
---
 test/iobuf_unittest.cpp    | 4 ++--
 test/rand_util_unittest.cc | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/iobuf_unittest.cpp b/test/iobuf_unittest.cpp
index cec4019..7691d79 100644
--- a/test/iobuf_unittest.cpp
+++ b/test/iobuf_unittest.cpp
@@ -1660,7 +1660,7 @@ TEST_F(IOBufTest, append_user_data_and_share) {
 TEST_F(IOBufTest, share_tls_block) {
     butil::iobuf::remove_tls_block_chain();
     butil::IOBuf::Block* b = butil::iobuf::acquire_tls_block();
-    ASSERT_EQ(0, butil::iobuf::block_size(b));
+    ASSERT_EQ(0u, butil::iobuf::block_size(b));
 
     butil::IOBuf::Block* b2 = butil::iobuf::share_tls_block();
     butil::IOBuf buf;
@@ -1677,7 +1677,7 @@ TEST_F(IOBufTest, share_tls_block) {
     }
     // now tls block is b(full) -> b2(full) -> NULL
     butil::IOBuf::Block* head_block = butil::iobuf::share_tls_block();
-    ASSERT_EQ(0, butil::iobuf::block_size(head_block));
+    ASSERT_EQ(0u, butil::iobuf::block_size(head_block));
     ASSERT_NE(b, head_block);
     ASSERT_NE(b2, head_block);
 }
diff --git a/test/rand_util_unittest.cc b/test/rand_util_unittest.cc
index 8b77884..17891c3 100644
--- a/test/rand_util_unittest.cc
+++ b/test/rand_util_unittest.cc
@@ -138,8 +138,8 @@ TEST(RandUtilTest, RandGeneratorIsUniform) {
             // Don't quit too quickly for things to start converging, or we may have
             // a false positive.
             if (count > kMinAttempts &&
-                kExpectedAverage - kAllowedVariance < cumulative_average &&
-                cumulative_average < kExpectedAverage + kAllowedVariance) {
+                double(kExpectedAverage - kAllowedVariance) < cumulative_average &&
+                cumulative_average < double(kExpectedAverage + kAllowedVariance)) {
                 break;
             }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org