From: Jan Stancek <jstancek@redhat.com>
To: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Cc: ltp-list <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH 1/2] sbrk/sbrk01.c: cleanup
Date: Tue, 22 Apr 2014 08:38:49 -0400 (EDT) [thread overview]
Message-ID: <877838316.7741146.1398170329130.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1398159613.2772.7.camel@G08JYZSD130126>
----- Original Message -----
> From: "Zeng Linggang" <zenglg.jy@cn.fujitsu.com>
> To: "ltp-list" <ltp-list@lists.sourceforge.net>
> Sent: Tuesday, 22 April, 2014 11:40:13 AM
> Subject: [LTP] [PATCH 1/2] sbrk/sbrk01.c: cleanup
>
> * Delete some useless commtents.
> * Move the test body from main() to sbrk_verify().
> * Remove tst_tmpdir().
> * Some cleanup.
>
> Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
> ---
> testcases/kernel/syscalls/sbrk/sbrk01.c | 236
> +++++++-------------------------
> 1 file changed, 52 insertions(+), 184 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/sbrk/sbrk01.c
> b/testcases/kernel/syscalls/sbrk/sbrk01.c
> index b2db42c..f2b09f4 100644
> --- a/testcases/kernel/syscalls/sbrk/sbrk01.c
> +++ b/testcases/kernel/syscalls/sbrk/sbrk01.c
...
>
> -/***************************************************************
> - * setup() - performs all ONE TIME setup for this test.
> - ***************************************************************/
> -void setup(void)
> +static void sbrk_verify(const struct test_case_t *test)
> {
> + void *tret;
>
> - tst_sig(NOFORK, DEF_HANDLER, cleanup);
> -
> - TEST_PAUSE;
> + tret = sbrk(test->increment);
> + TEST_ERRNO = errno;
>
> - /* make a temp dir and cd to it */
> - tst_tmpdir();
> + if (tret == (void *)-1) {
> + tst_resm(TFAIL | TTERRNO,
> + "sbrk - Increase by %ld bytes failed, errno=%d : %s",
> + test->increment, TEST_ERRNO, strerror(TEST_ERRNO));
This looks redundant. You are using TTERRNO and also printing TEST_ERRNO as decimal
and string again. You could just use TERRNO, errno shouldn't change between
call to sbrk() and if condition.
Regards,
Jan
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
prev parent reply other threads:[~2014-04-22 12:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-22 9:40 [LTP] [PATCH 1/2] sbrk/sbrk01.c: cleanup Zeng Linggang
2014-04-22 9:41 ` [LTP] [PATCH 2/2] sbrk/sbrk02.c: add ENOMEM errno test Zeng Linggang
2014-04-22 13:14 ` Jan Stancek
2014-04-23 1:23 ` Zeng Linggang
2014-04-23 3:51 ` [LTP] [PATCH v2 1/2] sbrk/sbrk01.c: cleanup Zeng Linggang
2014-04-23 3:52 ` [LTP] [PATCH v2 2/2] sbrk/sbrk02.c: add ENOMEM errno test Zeng Linggang
2014-04-23 11:29 ` Jan Stancek
2014-04-25 9:29 ` Zeng Linggang
2014-05-20 15:50 ` chrubis
2014-05-20 15:56 ` chrubis
2014-05-20 16:03 ` [LTP] [PATCH v2 1/2] sbrk/sbrk01.c: cleanup chrubis
2014-04-22 12:38 ` Jan Stancek [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=877838316.7741146.1398170329130.JavaMail.zimbra@redhat.com \
--to=jstancek@redhat.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=zenglg.jy@cn.fujitsu.com \
/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