Module Name: src Committed By: yamt Date: Fri Apr 8 11:11:53 UTC 2011
Modified Files: src/tests/syscall: t_timer.c Log Message: test timer_create with CLOCK_MONOTONIC as well To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/syscall/t_timer.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/syscall/t_timer.c diff -u src/tests/syscall/t_timer.c:1.1 src/tests/syscall/t_timer.c:1.2 --- src/tests/syscall/t_timer.c:1.1 Wed May 19 19:17:08 2010 +++ src/tests/syscall/t_timer.c Fri Apr 8 11:11:53 2011 @@ -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();