From: Mike Frysinger <vapier@gentoo.org>
To: Chandru <chandru@in.ibm.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] ppoll01: add signal() syscall to register the signal handler
Date: Thu, 1 Oct 2009 12:39:38 -0400 [thread overview]
Message-ID: <200910011239.39024.vapier@gentoo.org> (raw)
In-Reply-To: <200910011257.47226.chandru@in.ibm.com>
[-- Attachment #1.1: Type: Text/Plain, Size: 3090 bytes --]
On Thursday 01 October 2009 03:27:46 Chandru wrote:
> On Saturday 26 September 2009 16:55:28 Mike Frysinger wrote:
> > On Thursday 24 September 2009 02:59:32 Chandru wrote:
> > > 3. Takes away
> > > printing the type of error ( i.e strerror(errno) ) since it only
> > > prints the last error seen and does not report the failures seen in the
> > > cases before the last failed one. The reporting of NG or OK shoudl take
> > > care of letting the user know the cases that have passed and cases that
> > > have failed.
> > >
> > > - tst_resm(TFAIL, "%s failed - errno = %d : %s",
> > > TCID, TEST_ERRNO, strerror(TEST_ERRNO));
> > > + tst_resm(TFAIL, "%s failed", TCID);
> >
> > why dont you *fix* the issues you see with this output instead of making
> > the output even more useless ? also, this should be converted to
> > TFAIL|TTERRNO.
>
> em, the change was not useless, the existing reporting of failure was. The
> output on failure of only the first case prints as
> "ppoll01 1 TFAIL : ppoll01 failed - errno = 0 : Success"
you've shown problems in one case, not every single one. at any rate, you've
taken a stab at fixing the problem properly, so arguing semantics here is a
waste of time.
> --- ppoll01.c.orig 2009-09-29 21:28:55.510487735 +0530
> +++ ppoll01.c 2009-10-01 17:34:42.651235797 +0530
> @@ -242,6 +242,8 @@ static struct test_case tcase[] = {
> #endif
> };
>
> +int tstatus, terrno[16];
declare terrno static and then everything is initialized to 0. then you dont
need to track things in tstatus as non-zero should indicate an error.
hard coding 16 seems like a bad idea ... isnt there already a define/variable
that holds the test count that you can use ?
> @@ -331,6 +334,11 @@ static int do_test(struct test_case *tc)
> errno = 0;
> TEST(sys_ret = syscall(__NR_ppoll, p_fds, nfds, p_ts, p_sigmask,
> sigsetsize));
> sys_errno = errno;
> + if (((tc->ret == 0) && (sys_ret == -1)) || ((tc->ret == -1) && (sys_ret
> == 0))) {
> + tstatus |= (1 << tc_no);
> + terrno[tc_no] = errno;
> + }
looks like this test was written without really understanding the LTP
framework. setting errno to 0 and the use of sys_errno is duplicating stuff
LTP is already doing. the code should be using TEST_ERRNO to get at the errno
from the TEST() call. this applies both to existing code and your new code.
> - tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO,
> strerror(TEST_ERRNO));
> + tst_resm(TPASS, "ppoll result = %d ",result);
how can it TPASS and then turn around and TFAIL ? this new tst_resm() should
just be dropped i think.
> + for (i = 0; i < (int)(sizeof(tcase) / sizeof(tcase[0])); i++)
> + if (tstatus & (1 << i))
> + tst_resm(TFAIL|TTERRNO, "%s failed - errno = %d : %s", TCID,
> terrno[i], strerror(terrno[i]));
this isnt how TTERRNO works. the code should be:
if (terrno[i]) {
TEST_ERRNO = terrno[i];
tst_resm(TFAIL|TTERNO, "test %i failed\n", i);
}
-mike
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 401 bytes --]
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
prev parent reply other threads:[~2009-10-01 16:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-24 6:59 [LTP] [PATCH] ppoll01: add signal() syscall to register the signal handler Chandru
2009-09-24 20:28 ` K.D. Lucas
2009-09-25 5:24 ` Garrett Cooper
2009-09-26 11:25 ` Mike Frysinger
2009-10-01 7:27 ` Chandru
2009-10-01 8:16 ` Chandru
2009-10-01 16:39 ` Mike Frysinger [this message]
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=200910011239.39024.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=chandru@in.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox