Fix up failing glibc tests.
There is a known bug running clone with the CLONE_VM flag, so for host
create an empty test.
Change the expected output of the stdio test for a glibc difference.
Change the pause test to use ScopedSignalHandler to setup/restore the SIGALRM
handler.
After this, running bionic-unit-tests-glibc passes for all tests.
Bug: 11389824
Change-Id: Ib304eae4164115835a54991dfdca5821ecc3db5e
diff --git a/tests/unistd_test.cpp b/tests/unistd_test.cpp
index 7d0af7c..2308ad9 100644
--- a/tests/unistd_test.cpp
+++ b/tests/unistd_test.cpp
@@ -15,6 +15,7 @@
*/
#include <gtest/gtest.h>
+#include "ScopedSignalHandler.h"
#include "TemporaryFile.h"
#include <stdint.h>
@@ -80,7 +81,8 @@
}
TEST(unistd, pause) {
- signal(SIGALRM, PauseTestSignalHandler);
+ ScopedSignalHandler handler(SIGALRM, PauseTestSignalHandler);
+
alarm(1);
ASSERT_FALSE(gPauseTestFlag);
ASSERT_EQ(-1, pause());