Skip to content

Commit

Permalink
sigsys test: correct count of delivered signals
Browse files Browse the repository at this point in the history
When knob is zero, intent is that no SIGSYS signals are delivered.
Comparing zero to zero does not test much, we should compare the count
of delivered SIGSYSs to zero.

Reviewed by:	dchagin, imp
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44077
  • Loading branch information
kostikbel committed Feb 25, 2024
1 parent f5f08e4 commit 09dd724
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/sys/kern/sigsys.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ sigsys_test(int knob)
ATF_REQUIRE(syscall(273) == -1); /* reserved */
ATF_CHECK_ERRNO(ENOSYS, true);
atomic_signal_fence(memory_order_seq_cst);
ATF_CHECK_EQ(1 * knob, sigsys_cnt * knob);
ATF_CHECK_EQ(1 * knob, sigsys_cnt);

ATF_REQUIRE(syscall(440) == -1); /* SYS_kse_switchin */
ATF_CHECK_ERRNO(ENOSYS, true);
atomic_signal_fence(memory_order_seq_cst);
ATF_CHECK_EQ(2 * knob, sigsys_cnt * knob);
ATF_CHECK_EQ(2 * knob, sigsys_cnt);

/* Hope this is enough for say next two months */
ATF_REQUIRE(syscall(3000000) == -1);
ATF_CHECK_ERRNO(ENOSYS, true);
atomic_signal_fence(memory_order_seq_cst);
ATF_CHECK_EQ(3 * knob, sigsys_cnt * knob);
ATF_CHECK_EQ(3 * knob, sigsys_cnt);

ATF_REQUIRE(syscall(SYS_afs3_syscall) == -1);
ATF_CHECK_ERRNO(ENOSYS, true);
atomic_signal_fence(memory_order_seq_cst);
ATF_CHECK_EQ(4 * knob, sigsys_cnt * knob);
ATF_CHECK_EQ(4 * knob, sigsys_cnt);
}

static void
Expand Down

0 comments on commit 09dd724

Please sign in to comment.