<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Petr,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks for your work on this!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 28, 2020 at 12:39 AM Petr Vorel <<a href="mailto:pvorel@suse.cz">pvorel@suse.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Allowed types: TCONF | TFAIL | TINFO | TPASS | TWARN<br>
i.e. TBROK is forbidden.<br>
<br>
Suggested-by: Li Wang <<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a>><br>
Signed-off-by: Petr Vorel <<a href="mailto:pvorel@suse.cz" target="_blank">pvorel@suse.cz</a>><br>
---<br>
Hi,<br>
<br>
TPASS == 0, that's why TTYPE_RESULT(ttype) ?: TCONF<br>
<br>
Kind regards,<br>
Petr<br>
<br>
include/tst_common.h | 3 +++<br>
include/tst_test.h | 6 +++++-<br>
2 files changed, 8 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/include/tst_common.h b/include/tst_common.h<br>
index d37e38487..54a8428fd 100644<br>
--- a/include/tst_common.h<br>
+++ b/include/tst_common.h<br>
@@ -77,4 +77,7 @@<br>
#define TST_BRK_SUPPORTS_ONLY_TCONF_TBROK(condition) \<br>
do { ((void)sizeof(char[1 - 2 * !!(condition)])); } while (0)<br>
<br>
+#define TST_RES_SUPPORTS_TCONF_TFAIL_TINFO_TPASS_TWARN(condition) \<br>
+ TST_BRK_SUPPORTS_ONLY_TCONF_TBROK(condition)<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">To be honest, this looks verbose and confusing a little. I'm thinking can we just add a prefix TST_ to the kernel macro and use it directly? </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">e.g</div><div class="gmail_default" style="font-size:small"><br></div>#define TST_BUILD_BUG_ON(condition) \<br> <span class="gmail_default" style="font-size:small"> </span>do { ((void)sizeof(char[1 - 2 * !!(condition)])); } while (0)<br><div class="gmail_default" style="font-size:small"></div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
#endif /* TST_COMMON_H__ */<br>
diff --git a/include/tst_test.h b/include/tst_test.h<br>
index 1026a422a..8508c2e38 100644<br>
--- a/include/tst_test.h<br>
+++ b/include/tst_test.h<br>
@@ -47,7 +47,11 @@ void tst_res_(const char *file, const int lineno, int ttype,<br>
__attribute__ ((format (printf, 4, 5)));<br>
<br>
#define tst_res(ttype, arg_fmt, ...) \<br>
- tst_res_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__)<br>
+ ({ \<br>
+ TST_RES_SUPPORTS_TCONF_TFAIL_TINFO_TPASS_TWARN(!((TTYPE_RESULT(ttype) ?: TCONF) & \<br>
+ (TCONF | TFAIL | TINFO | TPASS | TWARN))); \<br>
+ tst_res_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\<br>
+ })<br>
<br>
void tst_resm_hexd_(const char *file, const int lineno, int ttype,<br>
const void *buf, size_t size, const char *arg_fmt, ...)<br>
-- <br>
2.25.1<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>