Commit 38a875a2 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[master] make sure 0-clear test buffer to suppress valgrind warnings

confirmed locally, and should be trivial, so I'm committing it directly.
parent a41cac42
......@@ -22,6 +22,7 @@
#include <boost/bind.hpp>
#include <csignal>
#include <cstring>
#include <vector>
#include <sys/socket.h>
......@@ -185,8 +186,10 @@ TEST_F(LocalSocketTest, asyncPartialRead) {
// specify reading 4 bytes of data, and send 3 bytes. It shouldn't cause
// callback.
// callback. while we actually don't use the buffer, we'll initialize it
// to make valgrind happy.
char recv_buf[4];
std::memset(recv_buf, 0, sizeof(recv_buf));
bool callback_called = false;
LocalSocket sock(io_service_, sock_pair_[0].release());
sock.asyncRead(boost::bind(&callback, _1, &io_service_, &callback_called,
Supports Markdown
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