Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/regress/lib/libc/siginfo/sigalrm turn this into a proper reg...



details:   https://anonhg.NetBSD.org/src/rev/249df88b4006
branches:  trunk
changeset: 551925:249df88b4006
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Sep 14 06:54:28 2003 +0000

description:
turn this into a proper regression test.

diffstat:

 regress/lib/libc/siginfo/sigalrm/sigalrm.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r b4eca5c931fe -r 249df88b4006 regress/lib/libc/siginfo/sigalrm/sigalrm.c
--- a/regress/lib/libc/siginfo/sigalrm/sigalrm.c        Sun Sep 14 06:42:23 2003 +0000
+++ b/regress/lib/libc/siginfo/sigalrm/sigalrm.c        Sun Sep 14 06:54:28 2003 +0000
@@ -1,17 +1,19 @@
+#include <assert.h>
 #include <signal.h>
 #include <stdio.h>
+#include <sys/time.h>
 #include <sys/ucontext.h>
 
 void
 sigalrm(int signo, siginfo_t *info, void *ptr)
 {
+#ifdef DEBUG
        printf("%d %p %p\n", signo, info, ptr);
        if (info != NULL) {
                printf("si_signo=%d\n", info->si_signo);
                printf("si_errno=%d\n", info->si_errno);
                printf("si_code=%d\n", info->si_code);
-               printf("si_trap=%d\n", info->si_trap);
-               printf("si_addr=%p\n", info->si_addr);
+               printf("si_sigval.sival_int=%d\n", info->si_sigval.sival_int);
        }
        if (ptr != NULL) {
                ucontext_t *ctx = ptr;
@@ -30,6 +32,11 @@
                        printf("uc_mcontext.greg[%d] 0x%x\n", i,
                            mc->__gregs[i]);
        }
+#endif
+       assert(info->si_signo == SIGALRM);
+       assert(info->si_code == SI_TIMER);
+       assert(info->si_sigval.sival_int == ITIMER_REAL);
+       exit(0);
 }
 
 int



Home | Main Index | Thread Index | Old Index