]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
t/sigfd: better checks related to SIGWINCH
authorEric Wong <e@80x24.org>
Mon, 4 Sep 2023 10:36:00 +0000 (10:36 +0000)
committerEric Wong <e@80x24.org>
Tue, 5 Sep 2023 03:01:37 +0000 (03:01 +0000)
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.

t/sigfd.t

index 15fc818a118dd27465aaaf9e8a0fbda17a916ac6..f6449dab9075bdea129dcaaae5168e608b458f2d 100644 (file)
--- 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);
        }