dumping ground for random patches and texts
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: spew@80x24.org
Subject: [PATCH 2/3] t/sigfd: better checks related to SIGWINCH
Date: Fri,  1 Sep 2023 21:12:43 +0000	[thread overview]
Message-ID: <20230901211244.32050-2-e@80x24.org> (raw)
In-Reply-To: <20230901211244.32050-1-e@80x24.org>

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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/sigfd.t b/t/sigfd.t
index 15fc818a..f6449dab 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);
 	}

  reply	other threads:[~2023-09-01 21:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-01 21:12 [PATCH 1/3] t/sigfd: EVFILT_SIGNAL vs signalfd difference check Eric Wong
2023-09-01 21:12 ` Eric Wong [this message]
2023-09-01 21:12 ` [PATCH 3/3] update devel/syscall-list to devel/sysdefs-list Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230901211244.32050-2-e@80x24.org \
    --to=e@80x24.org \
    --cc=spew@80x24.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).