From: DAN LI <li.dan@cn.fujitsu.com>
To: LTP list <ltp-list@lists.sourceforge.net>
Subject: [LTP] [PATCH v3 2/2] syscalls/getitimer01.c: Test for getting ITIMER_VIRTUAL and ITIMER_PROF
Date: Thu, 25 Apr 2013 11:07:05 +0800 [thread overview]
Message-ID: <51789DD9.7040506@cn.fujitsu.com> (raw)
In-Reply-To: <51789D50.1080301@cn.fujitsu.com>
Additional tests of getting ITIMER_VIRTUAL and ITIMER_PROF.
Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
---
testcases/kernel/syscalls/getitimer/getitimer01.c | 44 ++++++++++++++---------
1 file changed, 27 insertions(+), 17 deletions(-)
diff --git a/testcases/kernel/syscalls/getitimer/getitimer01.c b/testcases/kernel/syscalls/getitimer/getitimer01.c
index 03edf2f..5569a49 100644
--- a/testcases/kernel/syscalls/getitimer/getitimer01.c
+++ b/testcases/kernel/syscalls/getitimer/getitimer01.c
@@ -34,11 +34,18 @@ static void cleanup(void);
static void setup(void);
char *TCID = "getitimer01";
-int TST_TOTAL = 1;
+int TST_TOTAL = 3;
+
+static int itimer_name[] = {
+ ITIMER_REAL,
+ ITIMER_VIRTUAL,
+ ITIMER_PROF,
+};
int main(int ac, char **av)
{
int lc;
+ int i;
char *msg;
struct itimerval value;
@@ -51,27 +58,30 @@ int main(int ac, char **av)
for (lc = 0; TEST_LOOPING(lc); lc++) {
tst_count = 0;
- TEST(getitimer(ITIMER_REAL, &value));
+ for (i = 0; i < 3; i++) {
+
+ TEST(getitimer(itimer_name[i], &value));
- if (TEST_RETURN != 0)
- tst_resm(TFAIL, "call failed - errno = %d - %s",
- TEST_ERRNO, strerror(TEST_ERRNO));
+ if (TEST_RETURN != 0)
+ tst_resm(TFAIL, "call failed - errno = %d - %s",
+ TEST_ERRNO, strerror(TEST_ERRNO));
- if (STD_FUNCTIONAL_TEST) {
+ if (STD_FUNCTIONAL_TEST) {
- /*
- * Since ITIMER_REAL is effectively disabled (we did
- * not set it before the getitimer call), the elements
- * in it_value should be zero.
- */
- if ((value.it_value.tv_sec == 0) &&
- (value.it_value.tv_usec == 0)) {
- tst_resm(TPASS, "functional test passed");
+ /*
+ * Since ITIMER is effectively disabled (we did
+ * not set it before the getitimer call), the
+ * elements in it_value should be zero.
+ */
+ if ((value.it_value.tv_sec == 0) &&
+ (value.it_value.tv_usec == 0)) {
+ tst_resm(TPASS, "functionality is ok");
+ } else {
+ tst_resm(TFAIL, "timer are non zero");
+ }
} else {
- tst_resm(TFAIL, "timer values are non zero");
+ tst_resm(TPASS, "call succeeded");
}
- } else {
- tst_resm(TPASS, "call succeeded");
}
}
--
1.8.1
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2013-04-25 3:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-25 3:04 [LTP] [PATCH v3 1/2] syscalls/getitimer: cleanup DAN LI
2013-04-25 3:07 ` DAN LI [this message]
2013-04-25 5:48 ` [LTP] [PATCH v3 2/2] syscalls/getitimer01.c: Test for getting ITIMER_VIRTUAL and ITIMER_PROF Wanlong Gao
2013-04-25 5:48 ` [LTP] [PATCH v3 1/2] syscalls/getitimer: cleanup Wanlong Gao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51789DD9.7040506@cn.fujitsu.com \
--to=li.dan@cn.fujitsu.com \
--cc=ltp-list@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.