summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls
diff options
context:
space:
mode:
authorRahat Mahmood <rahat@google.com>2019-06-18 16:20:42 -0700
committergVisor bot <gvisor-bot@google.com>2019-06-18 16:21:56 -0700
commit546b2948cb4304a99b0d719d5a99dcb7edaace18 (patch)
tree3052d851661c3882558df3cfa4c4d20aff4fbcd6 /test/syscalls
parent0e07c94d545aa971bb2a05b738f856181a3ff463 (diff)
Use return values from syscalls in eventfd tests.
PiperOrigin-RevId: 253890611
Diffstat (limited to 'test/syscalls')
-rw-r--r--test/syscalls/linux/eventfd.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/syscalls/linux/eventfd.cc b/test/syscalls/linux/eventfd.cc
index 5e5c39d44..367682c3d 100644
--- a/test/syscalls/linux/eventfd.cc
+++ b/test/syscalls/linux/eventfd.cc
@@ -53,9 +53,9 @@ TEST(EventfdTest, Nonblock) {
void* read_three_times(void* arg) {
int efd = *reinterpret_cast<int*>(arg);
uint64_t l;
- read(efd, &l, sizeof(l));
- read(efd, &l, sizeof(l));
- read(efd, &l, sizeof(l));
+ EXPECT_THAT(read(efd, &l, sizeof(l)), SyscallSucceedsWithValue(sizeof(l)));
+ EXPECT_THAT(read(efd, &l, sizeof(l)), SyscallSucceedsWithValue(sizeof(l)));
+ EXPECT_THAT(read(efd, &l, sizeof(l)), SyscallSucceedsWithValue(sizeof(l)));
return nullptr;
}
@@ -160,7 +160,8 @@ TEST(EventfdTest, NotifyNonZero_NoRandomSave) {
ScopedThread t([&efd] {
sleep(5);
uint64_t val = 1;
- write(efd.get(), &val, sizeof(val));
+ EXPECT_THAT(write(efd.get(), &val, sizeof(val)),
+ SyscallSucceedsWithValue(sizeof(val)));
});
// epoll_wait should return once the thread writes.