Commit 972731c5 authored by gejun's avatar gejun

Suppress warnings in UT

parent f77d71fb
......@@ -98,7 +98,7 @@ static void check_memory_leak() {
++n;
}
ASSERT_EQ(n, s_set.size());
ASSERT_EQ(n, butil::iobuf::get_tls_block_count());
ASSERT_EQ(n, (size_t)butil::iobuf::get_tls_block_count());
}
}
......@@ -287,7 +287,7 @@ TEST_F(IOBufTest, reserve) {
b.append("hello world");
ASSERT_EQ(0, b.unsafe_assign(a1, "prefix")); // `x' will not be copied
ASSERT_EQ("prefihello world", b.to_string());
ASSERT_EQ(16, b.size());
ASSERT_EQ((size_t)16, b.size());
// pop/append sth. from back-side and assign again.
ASSERT_EQ(5, b.pop_back(5));
......@@ -1309,7 +1309,7 @@ TEST_F(IOBufTest, append_from_fd_with_offset) {
butil::IOPortal buf;
char dummy[10 * 1024];
buf.append(dummy, sizeof(dummy));
ASSERT_EQ(sizeof(dummy), buf.cut_into_file_descriptor(fd));
ASSERT_EQ((ssize_t)sizeof(dummy), buf.cut_into_file_descriptor(fd));
for (size_t i = 0; i < sizeof(dummy); ++i) {
butil::IOPortal b0;
ASSERT_EQ(sizeof(dummy) - i, b0.pappend_from_file_descriptor(fd, i, sizeof(dummy))) << berror();
......
......@@ -127,7 +127,7 @@ TEST_F(TempFileTest, save_binary_twice)
ASSERT_NE((void*)0, fp);
test_t act_data;
bzero(&act_data, sizeof(act_data));
ASSERT_EQ(1, fread(&act_data, sizeof(act_data), 1, fp));
ASSERT_EQ((size_t)1, fread(&act_data, sizeof(act_data), 1, fp));
fclose(fp);
ASSERT_EQ(0, memcmp(&data, &act_data, sizeof(data)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment