Add test for zero size read and write

PiperOrigin-RevId: 495456453
This commit is contained in:
gVisor bot
2022-12-14 17:04:02 -08:00
parent 1993d54114
commit bcd3feaf52
+7
View File
@@ -664,6 +664,13 @@ TEST_P(PipeTest, Streaming) {
}
}
TEST_P(PipeTest, ZeroSize) {
SKIP_IF(!CreateBlocking());
ASSERT_THAT(write(wfd_.get(), nullptr, 0), SyscallSucceedsWithValue(0));
ASSERT_THAT(read(rfd_.get(), nullptr, 0), SyscallSucceedsWithValue(0));
}
std::string PipeCreatorName(::testing::TestParamInfo<PipeCreator> info) {
return info.param.name_; // Use the name specified.
}