Skip to content

Commit

Permalink
Googletest export
Browse files Browse the repository at this point in the history
Migrate ZX_WAIT_ASYNC_REPEATING to ZX_WAIT_ASYNC_ONCE

ZX_WAIT_ASYNC_REPEATING is deprecated so convert code to use
ZX_WAIT_ASYNC_ONCE instead.

PiperOrigin-RevId: 243707147
  • Loading branch information
Abseil Team authored and astrelni committed Apr 16, 2019
1 parent 39f72ea commit 6d66818
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions googletest/src/gtest-death-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ int FuchsiaDeathTest::Wait() {
// Register to wait for the socket to be readable or closed.
status_zx = stderr_socket_.wait_async(
port_, kSocketKey, ZX_SOCKET_READABLE | ZX_SOCKET_PEER_CLOSED,
ZX_WAIT_ASYNC_REPEATING);
ZX_WAIT_ASYNC_ONCE);
GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);

bool process_terminated = false;
Expand All @@ -912,7 +912,7 @@ int FuchsiaDeathTest::Wait() {
process_terminated = true;
}
} else if (packet.key == kSocketKey) {
GTEST_DEATH_TEST_CHECK_(ZX_PKT_IS_SIGNAL_REP(packet.type));
GTEST_DEATH_TEST_CHECK_(ZX_PKT_IS_SIGNAL_ONE(packet.type));
if (packet.signal.observed & ZX_SOCKET_READABLE) {
// Read data from the socket.
constexpr size_t kBufferSize = 1024;
Expand All @@ -929,6 +929,10 @@ int FuchsiaDeathTest::Wait() {
socket_closed = true;
} else {
GTEST_DEATH_TEST_CHECK_(status_zx == ZX_ERR_SHOULD_WAIT);
status_zx = stderr_socket_.wait_async(
port_, kSocketKey, ZX_SOCKET_READABLE | ZX_SOCKET_PEER_CLOSED,
ZX_WAIT_ASYNC_ONCE);
GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
}
} else {
GTEST_DEATH_TEST_CHECK_(packet.signal.observed & ZX_SOCKET_PEER_CLOSED);
Expand Down

0 comments on commit 6d66818

Please sign in to comment.