Source-Changes-HG archive

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

[src/trunk]: src/tests/syscall test timer_create with CLOCK_MONOTONIC as well



details:   https://anonhg.NetBSD.org/src/rev/46d3c2050977
branches:  trunk
changeset: 763959:46d3c2050977
user:      yamt <yamt%NetBSD.org@localhost>
date:      Fri Apr 08 11:11:53 2011 +0000

description:
test timer_create with CLOCK_MONOTONIC as well

diffstat:

 tests/syscall/t_timer.c |  33 +++++++++++++++++++++++++++------
 1 files changed, 27 insertions(+), 6 deletions(-)

diffs (66 lines):

diff -r 63736997739a -r 46d3c2050977 tests/syscall/t_timer.c
--- a/tests/syscall/t_timer.c   Fri Apr 08 10:42:51 2011 +0000
+++ b/tests/syscall/t_timer.c   Fri Apr 08 11:11:53 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_timer.c,v 1.1 2010/05/19 19:17:08 jruoho Exp $ */
+/*     $NetBSD: t_timer.c,v 1.2 2011/04/08 11:11:53 yamt Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -96,15 +96,16 @@
        atf_tc_fail("timer_create() successful with bogus values");
 }
 
-ATF_TC(timer_create_signal);
-ATF_TC_HEAD(timer_create_signal, tc)
+ATF_TC(timer_create_signal_realtime);
+ATF_TC_HEAD(timer_create_signal_realtime, tc)
 {
 
        atf_tc_set_md_var(tc, "descr",
-           "Checks timer_create(2) and sigevent(3), SIGEV_SIGNAL");
+           "Checks timer_create(2) with CLOCK_REALTIME and sigevent(3), "
+           "SIGEV_SIGNAL");
 }
 
-ATF_TC_BODY(timer_create_signal, tc)
+ATF_TC_BODY(timer_create_signal_realtime, tc)
 {
        int i, signals[6] = {
                SIGALRM, SIGIO, SIGPROF, SIGUSR1, SIGUSR2, -1
@@ -114,6 +115,25 @@
                timer_signal_create(CLOCK_REALTIME, signals[i]);
 }
 
+ATF_TC(timer_create_signal_monotonic);
+ATF_TC_HEAD(timer_create_signal_monotonic, tc)
+{
+
+       atf_tc_set_md_var(tc, "descr",
+           "Checks timer_create(2) with CLOCK_MONOTONIC and sigevent(3), "
+           "SIGEV_SIGNAL");
+}
+
+ATF_TC_BODY(timer_create_signal_monotonic, tc)
+{
+       int i, signals[6] = {
+               SIGALRM, SIGIO, SIGPROF, SIGUSR1, SIGUSR2, -1
+       };
+
+       for (i = 0; signals[i] > 0; i++)
+               timer_signal_create(CLOCK_MONOTONIC, signals[i]);
+}
+
 static void
 timer_signal_create(clockid_t cid, int sig)
 {
@@ -317,7 +337,8 @@
 {
 
        ATF_TP_ADD_TC(tp, timer_create_bogus);
-       ATF_TP_ADD_TC(tp, timer_create_signal);
+       ATF_TP_ADD_TC(tp, timer_create_signal_realtime);
+       ATF_TP_ADD_TC(tp, timer_create_signal_monotonic);
      /*        ATF_TP_ADD_TC(tp, timer_create_thread); */
 
        return atf_no_error();



Home | Main Index | Thread Index | Old Index