|
@@ -1369,7 +1369,7 @@ TEST_F(IOBufTest, cut_into_fd_with_offset_multithreaded) {
|
|
|
for (int i = 0; i < number_per_thread * (int)ARRAY_SIZE(threads); ++i) {
|
|
|
off_t offset = i * sizeof(int);
|
|
|
butil::IOPortal in;
|
|
|
- ASSERT_EQ(sizeof(int), in.pappend_from_file_descriptor(fd, offset, sizeof(int)));
|
|
|
+ ASSERT_EQ((ssize_t)sizeof(int), in.pappend_from_file_descriptor(fd, offset, sizeof(int)));
|
|
|
int j;
|
|
|
ASSERT_EQ(sizeof(j), in.cutn(&j, sizeof(j)));
|
|
|
ASSERT_EQ(i, j);
|
|
@@ -1586,7 +1586,7 @@ static void my_free(void* m) {
|
|
|
TEST_F(IOBufTest, append_user_data_and_consume) {
|
|
|
butil::IOBuf b0;
|
|
|
const int REP = 16;
|
|
|
- const int len = REP * 256;
|
|
|
+ const size_t len = REP * 256;
|
|
|
char* data = (char*)malloc(len);
|
|
|
for (int i = 0; i < 256; ++i) {
|
|
|
for (int j = 0; j < REP; ++j) {
|
|
@@ -1616,7 +1616,7 @@ TEST_F(IOBufTest, append_user_data_and_consume) {
|
|
|
TEST_F(IOBufTest, append_user_data_and_share) {
|
|
|
butil::IOBuf b0;
|
|
|
const int REP = 16;
|
|
|
- const int len = REP * 256;
|
|
|
+ const size_t len = REP * 256;
|
|
|
char* data = (char*)malloc(len);
|
|
|
for (int i = 0; i < 256; ++i) {
|
|
|
for (int j = 0; j < REP; ++j) {
|
|
@@ -1633,7 +1633,7 @@ TEST_F(IOBufTest, append_user_data_and_share) {
|
|
|
{
|
|
|
butil::IOBuf bufs[256];
|
|
|
for (int i = 0; i < 256; ++i) {
|
|
|
- ASSERT_EQ(REP, b0.cutn(&bufs[i], REP));
|
|
|
+ ASSERT_EQ((size_t)REP, b0.cutn(&bufs[i], REP));
|
|
|
ASSERT_EQ(len - (i+1) * REP, b0.size());
|
|
|
if (i != 255) {
|
|
|
ASSERT_EQ(1UL, b0._ref_num());
|
|
@@ -1647,7 +1647,7 @@ TEST_F(IOBufTest, append_user_data_and_share) {
|
|
|
ASSERT_EQ(NULL, my_free_params);
|
|
|
for (int i = 0; i < 256; ++i) {
|
|
|
std::string out = bufs[i].to_string();
|
|
|
- ASSERT_EQ(REP, out.size());
|
|
|
+ ASSERT_EQ((size_t)REP, out.size());
|
|
|
for (int j = 0; j < REP; ++j) {
|
|
|
ASSERT_EQ((char)i, out[j]);
|
|
|
}
|