From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 3/3] writev01: rewrite and drop partially valid iovec tests
Date: Tue, 11 Oct 2016 10:41:29 +0200 [thread overview]
Message-ID: <20161011084128.GA14295@rei.lan> (raw)
In-Reply-To: <57FC9729.7000107@redhat.com>
Hi!
> How about:
>
> static void test_writev(unsigned int i)
> {
> struct testcase_t *tcase = &testcases[i];
> int ret;
>
> TEST(writev(*(tcase->pfd), *(tcase->piovec), tcase->iovcnt));
>
> ret = (TEST_RETURN == tcase->exp_ret);
> if (TEST_RETURN < 0 || tcase->exp_ret < 0) {
> ret &= (TEST_ERRNO == tcase->exp_errno);
> tst_res((ret ? TPASS : TFAIL),
> "%s, expected: %d (%s), got: %ld (%s)", tcase->desc,
> tcase->exp_ret, tst_strerrno(tcase->exp_errno),
> TEST_RETURN, tst_strerrno(TEST_ERRNO));
> } else {
> tst_res((ret ? TPASS : TFAIL),
> "%s, expected: %d, got: %ld", tcase->desc,
> tcase->exp_ret, TEST_RETURN);
> }
> }
Looks good.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2016-10-11 8:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-07 8:11 [LTP] [PATCH v2 1/3] syscalls: new test writev07 Jan Stancek
2016-10-07 8:11 ` [LTP] [PATCH v2 2/3] writev: remove writev03 and writev04 Jan Stancek
2016-10-07 8:11 ` [LTP] [PATCH v2 3/3] writev01: rewrite and drop partially valid iovec tests Jan Stancek
2016-10-10 16:03 ` Cyril Hrubis
2016-10-11 7:39 ` Jan Stancek
2016-10-11 8:41 ` Cyril Hrubis [this message]
2016-10-11 10:18 ` Jan Stancek
2016-10-10 15:54 ` [LTP] [PATCH v2 1/3] syscalls: new test writev07 Cyril Hrubis
2016-12-01 6:36 ` Cui Bixuan
2016-12-01 7:36 ` Jan Stancek
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=20161011084128.GA14295@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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