public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: "Mitani" <mitani@ryobi.co.jp>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] "nanosleep{02〜04}" testcase failed
Date: Mon, 21 Dec 2009 16:18:30 +0900	[thread overview]
Message-ID: <000301ca820d$cc428e20$64c7aa60$@co.jp> (raw)

Hi,

I found that "nanosleep{02〜04}" testcase failed like follow example.
----------
nanosleep02    1  TFAIL  :  child process exited abnormally
----------

In ${LTPROOT}/testcases/kernel/syscalls/nanosleep/nanosleep{02〜04}.c, 
WEXITSTATUS(status) is used to judge whether child process did exit 
normally.
But WEXITSTATUS macro is used only when WIFEXITED macro returned "true".
So, it cannot get the correct results and it terminated with the above
error. 

To solve this problem, I thought that we had better use WIFEXITED macro
instead of the WEXITSTATUS macro.
Here are patches to fix these problem:
============
--- nanosleep02.c	2009-11-02 22:57:17.000000000 +0900
+++ nanosleep02.c.new	2009-12-21 14:15:19.000000000 +0900
@@ -162,10 +162,10 @@
 
 		/* Wait for child to execute */
 		wait(&status);
-		if (WEXITSTATUS(status) == 0) {
+		if (WIFEXITED(status)) {
 			tst_resm(TPASS, "Functionality of nanosleep() "
 				 "is correct");
-		} else if (WEXITSTATUS(status) == 1) {
+		} else if (!WIFEXITED(status)) {
 			tst_resm(TFAIL, "child process exited abnormally");
 		}
 	}			/* End for TEST_LOOPING */

============

============
--- nanosleep03.c	2009-11-02 22:57:17.000000000 +0900
+++ nanosleep03.c.new	2009-12-21 15:03:52.000000000 +0900
@@ -143,10 +143,10 @@
 
 		/* Wait for child to execute */
 		wait(&status);
-		if (WEXITSTATUS(status) == 0) {
+		if (WIFEXITED(status)) {
 			tst_resm(TPASS, "nanosleep() fails, interrupted"
 				 " by signal, error:%d", EINTR);
-		} else if (WEXITSTATUS(status) == 1) {
+		} else if (!WIFEXITED(status)) {
 			tst_resm(TFAIL, "child process exited abnormally");
 		}
 	}			/* End for TEST_LOOPING */

============

============
--- nanosleep04.c	2009-11-02 22:57:17.000000000 +0900
+++ nanosleep04.c.new	2009-12-21 15:04:24.000000000 +0900
@@ -147,10 +147,10 @@
 
 		/* Wait for child to execute */
 		wait(&status);
-		if (WEXITSTATUS(status) == 0) {
+		if (WIFEXITED(status)) {
 			tst_resm(TPASS, "nanosleep() fails, invalid pause "
 				 "time, error:%d", EINVAL);
-		} else if (WEXITSTATUS(status) == 1) {
+		} else if (!WIFEXITED(status)) {
 			tst_resm(TFAIL, "child process exited abnormally");
 		}
 	}			/* End for TEST_LOOPING */
============



------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

             reply	other threads:[~2009-12-21  7:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-21  7:18 Mitani [this message]
2009-12-22  2:45 ` [LTP] "nanosleep{02~04}" testcase failed Garrett Cooper
2009-12-22  5:17   ` Mitani
2009-12-22 17:35     ` Garrett Cooper

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='000301ca820d$cc428e20$64c7aa60$@co.jp' \
    --to=mitani@ryobi.co.jp \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox