Skip to contentSkip to conversation

tst_test.h: fix tst_test->tid for unsupported cases

PATCH New Xiao Yang 2 participants 4 messages Aug 17, 2016

lore
Share & tools
lore

Xiao Yang

author
#0 lore raw

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
index 7e4997f..03722ec 100644
@@ -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
#1 lore raw

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
---
 include/tst_test.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/tst_test.h +0 -0
index 7e4997f..03722ec 100644

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]
#2 lore raw

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 -2
 	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.

Signature · 2 lines
Cyril Hrubis
[email protected]
#3 lore raw

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]