tst_test.h: fix tst_test->tid for unsupported cases
PATCH 1/1 tst_test.h: fix tst_test->tid for unsupported cases
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.
--- include/tst_test.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/tst_test.h +2 -2
@@ -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 */
Signature · 1 line
1.8.3.1
PATCH 1/1 tst_test.h: fix tst_test->tid for unsupported cases
Hi!
Quoted 4 lines
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.
Quoted 10 lines
Signed-off-by Xiao Yang <[email protected]>--- include/tst_test.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)include/tst_test.h +0
-0
include/tst_test.h int main(int argc, char *argv[]) · line 164
Quoted 7 lines
include/tst_test.h +2
-2@@ -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.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/1 tst_test.h: fix tst_test->tid for unsupported cases
Hi!
Quoted 9 lines
include/tst_test.h int main(int argc, char *argv[]) · line 164
Quoted 6 lines
#define
TST_TEST_TCONF(message)\include/tst_test.h +2
-2static 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.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/1 tst_test.h: fix tst_test->tid for unsupported cases
Hi!
Quoted 2 lines
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.
Signature · 2 lines
Cyril Hrubis [email protected]