diff options
author | Jamie Liu <jamieliu@google.com> | 2019-01-11 14:47:45 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-01-11 14:49:39 -0800 |
commit | bf65e06c5f00eb41e40dfbb07dda31c6b7ae443e (patch) | |
tree | 4265fa80597165f24456e109053636fad637c10f /test/syscalls/linux/timers.cc | |
parent | 290bcb6de9c4aeff65bbfa06b8addecdbc51ca88 (diff) |
Clean up some uses of fork() in tests.
- Fix a few cases where async-signal-unsafe code is executed in a forked
process pre-execve.
- Ensure that the return value of fork() is always checked.
PiperOrigin-RevId: 228949310
Change-Id: I3096cb7d7394b8d9ab81b0e0245f2060713ef589
Diffstat (limited to 'test/syscalls/linux/timers.cc')
-rw-r--r-- | test/syscalls/linux/timers.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/syscalls/linux/timers.cc b/test/syscalls/linux/timers.cc index dfe231575..14506eb12 100644 --- a/test/syscalls/linux/timers.cc +++ b/test/syscalls/linux/timers.cc @@ -92,6 +92,7 @@ TEST(TimerTest, ProcessKilledOnCPUSoftLimit) { for (;;) { } } + ASSERT_THAT(pid, SyscallSucceeds()); auto c = Cleanup([pid] { int status; EXPECT_THAT(waitpid(pid, &status, 0), SyscallSucceedsWithValue(pid)); @@ -150,6 +151,7 @@ TEST(TimerTest, ProcessPingedRepeatedlyAfterCPUSoftLimit) { for (;;) { } } + ASSERT_THAT(pid, SyscallSucceeds()); auto c = Cleanup([pid] { int status; EXPECT_THAT(waitpid(pid, &status, 0), SyscallSucceedsWithValue(pid)); @@ -195,6 +197,7 @@ TEST(TimerTest, ProcessKilledOnCPUHardLimit) { for (;;) { } } + ASSERT_THAT(pid, SyscallSucceeds()); auto c = Cleanup([pid] { int status; EXPECT_THAT(waitpid(pid, &status, 0), SyscallSucceedsWithValue(pid)); |