From: Petr Vorel <pvorel@suse.cz>
To: Wei Gao <wegao@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1] ioctl01.c:Test also struct termios
Date: Mon, 6 Feb 2023 06:31:35 +0100 [thread overview]
Message-ID: <Y+CQt2SpeMzibUDT@pevik> (raw)
In-Reply-To: <20230129183930.2045-1-wegao@suse.com>
Hi Wei,
> ATM we're testing just legacy struct termio in ioctl01.c,
> we also need test struct termios.
Good idea.
> @@ -64,7 +66,21 @@ static void verify_ioctl(unsigned int i)
> if (TST_ERR != tcases[i].error) {
> tst_res(TFAIL | TTERRNO,
> "failed unexpectedly; expected %s",
> - tst_strerrno(tcases[i].error));
> + tst_strerrno(tcases[i].error));
> + return;
> + }
Could you please replace TEST(ioctl(...) with TST_EXP_FAIL(ioctl(...))?
That would save all error handling.
We try to use these helping macros in include/tst_test_macros.h.
Although they would deserve some docs as macros are a bit harder to read.
> +
> + TEST(ioctl(*(tcases[i].fd), tcases[i].request, tcases[i].s_tios));
> +
And obviously here should go TST_EXP_FAIL(ioctl(...)) as well.
Kind regards,
Petr
> + if (TST_RET != -1) {
> + tst_res(TFAIL, "call succeeded unexpectedly");
> + return;
> + }
> +
> + if (TST_ERR != tcases[i].error) {
> + tst_res(TFAIL | TTERRNO,
> + "failed unexpectedly; expected %s",
> + tst_strerrno(tcases[i].error));
> return;
> }
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-02-06 5:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-29 18:39 [LTP] [PATCH v1] ioctl01.c:Test also struct termios Wei Gao via ltp
2023-02-03 9:03 ` Li Wang
2023-02-06 5:31 ` Petr Vorel [this message]
2023-02-06 6:12 ` Petr Vorel
2023-02-07 7:17 ` Wei Gao via ltp
2023-02-07 7:16 ` [LTP] [PATCH v2] " Wei Gao via ltp
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=Y+CQt2SpeMzibUDT@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
--cc=wegao@suse.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