* [LTP] [PATCH] tst_test.h: fix tst_test->tid for unsupported cases
@ 2016-08-17 9:16 Xiao Yang
2016-08-17 9:22 ` Cyril Hrubis
0 siblings, 1 reply; 4+ messages in thread
From: Xiao Yang @ 2016-08-17 9:16 UTC (permalink / raw)
To: ltp
If some cases aren't supported by system, they fail with
the following message:
"tst_test.c:569: BROK: No tid set in test structure"
We should return TCONF instead of TBROK.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
include/tst_test.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/tst_test.h b/include/tst_test.h
index 7e4997f..03722ec 100644
--- a/include/tst_test.h
+++ b/include/tst_test.h
@@ -160,8 +160,8 @@ int main(int argc, char *argv[])
#define TST_TEST_TCONF(message) \
static void tst_do_test(void) { tst_brk(TCONF, "%s", message); }; \
- static struct tst_test test = { .test_all = tst_do_test } \
-
+ static struct tst_test test = { .test_all = tst_do_test, \
+ .tid = "tst_test_conf" } \
/*
* This is a hack to make the testcases link without defining TCID
*/
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [LTP] [PATCH] tst_test.h: fix tst_test->tid for unsupported cases
2016-08-17 9:16 [LTP] [PATCH] tst_test.h: fix tst_test->tid for unsupported cases Xiao Yang
@ 2016-08-17 9:22 ` Cyril Hrubis
2016-08-17 9:29 ` Cyril Hrubis
0 siblings, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2016-08-17 9:22 UTC (permalink / raw)
To: ltp
Hi!
> If some cases aren't supported by system, they fail with
> the following message:
> "tst_test.c:569: BROK: No tid set in test structure"
> We should return TCONF instead of TBROK.
My bad, I've broke it with the assert for non-null tid.
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
> include/tst_test.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/tst_test.h b/include/tst_test.h
> index 7e4997f..03722ec 100644
> --- a/include/tst_test.h
> +++ b/include/tst_test.h
> @@ -160,8 +160,8 @@ int main(int argc, char *argv[])
>
> #define TST_TEST_TCONF(message) \
> static void tst_do_test(void) { tst_brk(TCONF, "%s", message); }; \
> - static struct tst_test test = { .test_all = tst_do_test } \
> -
> + static struct tst_test test = { .test_all = tst_do_test, \
> + .tid = "tst_test_conf" } \
I guess that a little better solution would be to pass the test id to
the TST_TEST_TCONF() macro as well. I will fix that.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 4+ messages in thread
* [LTP] [PATCH] tst_test.h: fix tst_test->tid for unsupported cases
2016-08-17 9:22 ` Cyril Hrubis
@ 2016-08-17 9:29 ` Cyril Hrubis
2016-08-17 9:37 ` Cyril Hrubis
0 siblings, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2016-08-17 9:29 UTC (permalink / raw)
To: ltp
Hi!
> > #define TST_TEST_TCONF(message) \
> > static void tst_do_test(void) { tst_brk(TCONF, "%s", message); }; \
> > - static struct tst_test test = { .test_all = tst_do_test } \
> > -
> > + static struct tst_test test = { .test_all = tst_do_test, \
> > + .tid = "tst_test_conf" } \
>
> I guess that a little better solution would be to pass the test id to
> the TST_TEST_TCONF() macro as well. I will fix that.
Hmm, we do not print the tid in case of TCONF, I thought we did, so we
can proceed with your patch as well.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 4+ messages in thread
* [LTP] [PATCH] tst_test.h: fix tst_test->tid for unsupported cases
2016-08-17 9:29 ` Cyril Hrubis
@ 2016-08-17 9:37 ` Cyril Hrubis
0 siblings, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2016-08-17 9:37 UTC (permalink / raw)
To: ltp
Hi!
> Hmm, we do not print the tid in case of TCONF, I thought we did, so we
> can proceed with your patch as well.
Pushed with minor change and added commit that broke it into the
changelog, thanks.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-08-17 9:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-17 9:16 [LTP] [PATCH] tst_test.h: fix tst_test->tid for unsupported cases Xiao Yang
2016-08-17 9:22 ` Cyril Hrubis
2016-08-17 9:29 ` Cyril Hrubis
2016-08-17 9:37 ` Cyril Hrubis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.