From: Eric Wong Date: Mon, 4 Sep 2023 10:36:00 +0000 (+0000) Subject: t/sigfd: better checks related to SIGWINCH X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60b0467f838fe712f28880aa3f902991950f6361;p=thirdparty%2Fpublic-inbox.git t/sigfd: better checks related to SIGWINCH Check to ensure there's a numeric value of SIGWINCH defined for the given platform. SIGWINCH may also fire while the test is running due to a user resizing their terminal, so a boolean test to ensure it fired rather than an exact value check is more correct. --- diff --git a/t/sigfd.t b/t/sigfd.t index 15fc818a1..f6449dab9 100644 --- a/t/sigfd.t +++ b/t/sigfd.t @@ -28,6 +28,7 @@ SKIP: { kill 'USR2', $$ or die "kill $!"; ok(!defined($hit->{USR2}), 'no USR2 yet') or diag explain($hit); PublicInbox::DS->Reset; + ok($PublicInbox::Syscall::SIGNUM{WINCH}, 'SIGWINCH number defined'); my $sigfd = PublicInbox::Sigfd->new($sig, 0); if ($sigfd) { $linux_sigfd = 1 if $^O eq 'linux'; @@ -71,7 +72,7 @@ SKIP: { PublicInbox::DS->Reset; is($hit->{TERM}->{sigfd}, 1, 'TERM sigfd fired in event loop'); is($hit->{HUP}->{sigfd}, 3, 'HUP sigfd fired in event loop'); - is($hit->{WINCH}->{sigfd}, 1, 'WINCH sigfd fired in event loop'); + ok($hit->{WINCH}->{sigfd}, 'WINCH sigfd fired in event loop'); } else { skip('signalfd disabled?', 10); }