From 546b2948cb4304a99b0d719d5a99dcb7edaace18 Mon Sep 17 00:00:00 2001 From: Rahat Mahmood Date: Tue, 18 Jun 2019 16:20:42 -0700 Subject: Use return values from syscalls in eventfd tests. PiperOrigin-RevId: 253890611 --- test/syscalls/linux/eventfd.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test/syscalls') 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(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. -- cgit v1.2.3