public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 2/2] clock_getres01: add test variants
Date: Tue, 13 Aug 2019 14:13:40 +0200	[thread overview]
Message-ID: <20190813121340.GC16005@rei.lan> (raw)
In-Reply-To: <e4c5428276c9a85efc6bddaa2d82e2aed5806108.1565361031.git.jstancek@redhat.com>

Hi!
> 0 - default, could be either VDSO or syscall
> 1 - syscall with valid res parameter
> 2 - syscall with NULL res parameter
> 
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
>  testcases/kernel/syscalls/clock_getres/clock_getres01.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/syscalls/clock_getres/clock_getres01.c b/testcases/kernel/syscalls/clock_getres/clock_getres01.c
> index df3e84271ad9..a4134bc1d3c2 100644
> --- a/testcases/kernel/syscalls/clock_getres/clock_getres01.c
> +++ b/testcases/kernel/syscalls/clock_getres/clock_getres01.c
> @@ -13,6 +13,7 @@
>  #include <errno.h>
>  
>  #include "tst_test.h"
> +#include "lapi/syscalls.h"
>  #include "lapi/posix_clocks.h"
>  
>  static struct timespec res;
> @@ -39,7 +40,18 @@ static struct test_case {
>  
>  static void do_test(unsigned int i)
>  {
> -	TEST(clock_getres(tcase[i].clk_id, tcase[i].res));
> +	switch (tst_variant) {
> +	case 0:
> +		TEST(clock_getres(tcase[i].clk_id, tcase[i].res));
> +		break;
> +	case 1:
> +		TEST(tst_syscall(__NR_clock_getres, tcase[i].clk_id,
> +			tcase[i].res));
> +		break;
> +	case 2:
> +		TEST(tst_syscall(__NR_clock_getres, tcase[i].clk_id, NULL));
> +		break;
> +	}
>  
>  	if (TST_RET != tcase[i].ret) {
>  		if (TST_ERR == EINVAL) {
> @@ -64,4 +76,5 @@ static void do_test(unsigned int i)
>  static struct tst_test test = {
>  	.test = do_test,
>  	.tcnt = ARRAY_SIZE(tcase),
> +	.test_variants = 3,
>  };

Can we please print which variant we are about to test from the test
setup() as well?

-- 
Cyril Hrubis
chrubis@suse.cz

  parent reply	other threads:[~2019-08-13 12:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09 14:31 [LTP] [PATCH v2 1/2] clock_getres01: drop case which is passing NULL res parameter Jan Stancek
2019-08-09 14:31 ` [LTP] [PATCH v2 2/2] clock_getres01: add test variants Jan Stancek
2019-08-12  4:52   ` Li Wang
2019-08-13 12:13   ` Cyril Hrubis [this message]
2019-08-12  4:52 ` [LTP] [PATCH v2 1/2] clock_getres01: drop case which is passing NULL res parameter Li Wang
2019-08-13 12:12 ` Cyril Hrubis
2019-08-13 12:26   ` Jan Stancek
2019-08-13 13:13     ` Cyril Hrubis
2019-08-13 13:39       ` 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=20190813121340.GC16005@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