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/sigsegv make this a true regression...



details:   https://anonhg.NetBSD.org/src/rev/68ce74cda99e
branches:  trunk
changeset: 551915:68ce74cda99e
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Sep 13 22:55:17 2003 +0000

description:
make this a true regression test.

diffstat:

 regress/lib/libc/siginfo/sigsegv/Makefile  |  10 ++++++++++
 regress/lib/libc/siginfo/sigsegv/sigsegv.c |   8 ++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diffs (43 lines):

diff -r 335d2fd1d1ad -r 68ce74cda99e regress/lib/libc/siginfo/sigsegv/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/regress/lib/libc/siginfo/sigsegv/Makefile Sat Sep 13 22:55:17 2003 +0000
@@ -0,0 +1,10 @@
+#      $NetBSD: Makefile,v 1.1 2003/09/13 22:55:17 christos Exp $
+
+NOMAN=         # defined
+
+PROG=          sigsegv
+
+regress: ${PROG}
+       ./${PROG}
+
+.include <bsd.prog.mk>
diff -r 335d2fd1d1ad -r 68ce74cda99e regress/lib/libc/siginfo/sigsegv/sigsegv.c
--- a/regress/lib/libc/siginfo/sigsegv/sigsegv.c        Sat Sep 13 22:50:21 2003 +0000
+++ b/regress/lib/libc/siginfo/sigsegv/sigsegv.c        Sat Sep 13 22:55:17 2003 +0000
@@ -1,3 +1,4 @@
+#include <assert.h>
 #include <signal.h>
 #include <stdio.h>
 #include <sys/ucontext.h>
@@ -5,6 +6,7 @@
 void
 sigsegv(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);
@@ -30,6 +32,12 @@
                        printf("uc_mcontext.greg[%d] 0x%x\n", i,
                            mc->__gregs[i]);
        }
+#endif
+       assert(info->si_signo == SIGSEGV);
+       assert(info->si_errno == 0);
+       assert(info->si_code == SEGV_MAPERR);
+       assert(info->si_addr == (void *)0x5a5a5a5a);
+       exit(0);
 }
 
 int



Home | Main Index | Thread Index | Old Index