Factor out the waiting for children in bionic tests.
Change-Id: I4a1e51b6920b33dc892d447f5bd6d10f1cb2704a
diff --git a/tests/pty_test.cpp b/tests/pty_test.cpp
index 7fe97e9..91d1f5e 100644
--- a/tests/pty_test.cpp
+++ b/tests/pty_test.cpp
@@ -19,6 +19,8 @@
#include <pty.h>
#include <sys/ioctl.h>
+#include "utils.h"
+
TEST(pty, openpty) {
int master, slave;
char name[32];
@@ -58,10 +60,7 @@
ASSERT_EQ(sid, getsid(0));
- int status;
- ASSERT_EQ(pid, waitpid(pid, &status, 0));
- ASSERT_TRUE(WIFEXITED(status));
- ASSERT_EQ(0, WEXITSTATUS(status));
+ AssertChildExited(pid, 0);
close(master);
}