Skip to content

Commit

Permalink
trying to finish test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpatek committed Jan 5, 2025
1 parent ba7260f commit 78dcdf3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,13 @@ MAXTEST_MAIN
result = ::sigfn_wait_for(&signums[0], 1, &signum, NULL);
MAXTEST_ASSERT(result == -1);
MAXTEST_ASSERT(signum == INVALID_SIGNUM);
// expect success
timeout.tv_sec = 0;
timeout.tv_usec = 200000;
// test empty sigset
result = ::sigfn_wait_for(NULL, 0, &signum, &timeout);
MAXTEST_ASSERT(result == -1);
MAXTEST_ASSERT(signum == INVALID_SIGNUM);
// expect success
signal_from_child(SIGINT, std::chrono::milliseconds(100));
result = ::sigfn_wait_for(&signums[0], 1, &signum, &timeout);
MAXTEST_ASSERT(result == 0);
Expand Down Expand Up @@ -147,6 +151,10 @@ MAXTEST_MAIN
gettimeofday(&now, NULL);
deadline.tv_sec = now.tv_sec + 1;
deadline.tv_usec = now.tv_usec;
// test empty sigset
result = ::sigfn_wait_until(NULL, 0, &signum, &deadline);
MAXTEST_ASSERT(result == -1);
MAXTEST_ASSERT(signum == INVALID_SIGNUM);
signal_from_child(SIGINT, std::chrono::milliseconds(100));
result = ::sigfn_wait_until(&signums[0], 1, &signum, &deadline);
MAXTEST_ASSERT(result == 0);
Expand Down

0 comments on commit 78dcdf3

Please sign in to comment.