Source-Changes-HG archive

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

[src/trunk]: src/tests/kernel Add additional check for pe_report_event in lwp...



details:   https://anonhg.NetBSD.org/src/rev/b37b6cf32e20
branches:  trunk
changeset: 820758:b37b6cf32e20
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sat Jan 14 19:17:10 2017 +0000

description:
Add additional check for pe_report_event in lwp_{create,exit}1

This caught bug that currently PTRACE_LWP_EXIT is reported as
PTRACE_LWP_CREATE.

Sponsored by <The NetBSD Foundation>

diffstat:

 tests/kernel/t_ptrace_wait.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r 2db3d0787be4 -r b37b6cf32e20 tests/kernel/t_ptrace_wait.c
--- a/tests/kernel/t_ptrace_wait.c      Sat Jan 14 18:35:43 2017 +0000
+++ b/tests/kernel/t_ptrace_wait.c      Sat Jan 14 19:17:10 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_ptrace_wait.c,v 1.59 2017/01/14 06:36:52 kamil Exp $ */
+/*     $NetBSD: t_ptrace_wait.c,v 1.60 2017/01/14 19:17:10 kamil Exp $ */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.59 2017/01/14 06:36:52 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.60 2017/01/14 19:17:10 kamil Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -5482,6 +5482,8 @@
 
        ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
 
+       ATF_REQUIRE_EQ(state.pe_report_event, PTRACE_LWP_CREATE);
+
        lid = state.pe_lwp;
        printf("Reported PTRACE_LWP_CREATE event with lid %d\n", lid);
 
@@ -5576,6 +5578,8 @@
 
        ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
 
+       ATF_REQUIRE_EQ(state.pe_report_event, PTRACE_LWP_EXIT);
+
        lid = state.pe_lwp;
        printf("Reported PTRACE_LWP_EXIT event with lid %d\n", lid);
 



Home | Main Index | Thread Index | Old Index