Get all tests passing on NetBSD

This commit is contained in:
Justine Tunney 2021-02-05 09:44:54 -08:00
parent 23ae9dfceb
commit b2cd58a322
41 changed files with 202 additions and 655 deletions

View file

@ -32,6 +32,10 @@ void OnSigInt(int sig) {
gotsigint = true;
}
void SetUp(void) {
gotsigint = false;
}
TEST(sigaction, test) {
/* TODO(jart): Why does RHEL5 behave differently? */
/* TODO(jart): Windows needs huge signal overhaul */
@ -61,3 +65,12 @@ TEST(sigaction, test) {
EXPECT_EQ(0, WTERMSIG(status));
EXPECT_NE(-1, sigprocmask(SIG_BLOCK, &oldmask, NULL));
}
TEST(sigaction, raise) {
if (IsWindows()) return;
struct sigaction saint = {.sa_handler = OnSigInt};
EXPECT_NE(-1, sigaction(SIGINT, &saint, NULL));
ASSERT_FALSE(gotsigint);
EXPECT_NE(-1, raise(SIGINT));
ASSERT_TRUE(gotsigint);
}