Fix build with warnings turned on.

This commit is contained in:
Thomas Voß 2017-01-19 20:36:01 +01:00
commit 4d457153b7
29 changed files with 90 additions and 71 deletions

View file

@ -124,7 +124,7 @@ class TestThread final {
// Call end_pop() to get the command's result, as well as the popped
// buffer if it is 0.
bool start_pop() {
input_.send(Request{Cmd::Pop});
input_.send(Request{Cmd::Pop, Buffer{}});
return true;
}
@ -140,12 +140,12 @@ class TestThread final {
// Tell the test thread to close the queue from its side.
void do_close() {
input_.send(Request{Cmd::Close});
input_.send(Request{Cmd::Close, Buffer{}});
}
// Tell the test thread to stop after completing its current command.
void stop() {
input_.send(Request{Cmd::Stop});
input_.send(Request{Cmd::Stop, Buffer{}});
thread_.join();
}

View file

@ -130,10 +130,11 @@ TEST(BufferedIOStream, ReadWithNoDataAvailable) {
}
});
size_t size{10};
constexpr size_t size{10};
std::uint8_t read_data[size] = {0x0};
EXPECT_NE(nullptr, stream.read(read_data, &size));
EXPECT_EQ(2, size);
size_t read = 10;
EXPECT_NE(nullptr, stream.read(read_data, &read));
EXPECT_EQ(2, read);
EXPECT_EQ(0x12, read_data[0]);
EXPECT_EQ(0x34, read_data[1]);