<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Lianjie,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Some queries:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Do we have test scenarios for making use of these macros?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">And can you write a test to verify the macros you added at the same time?</div><div class="gmail_default" style="font-size:small">(just like what we had done in test_macros0*.c)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Btw, you should keep the code indent consistent with the original.</div><div class="gmail_default" style="font-size:small">(especially for backlash \)</div><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 27, 2021 at 10:31 AM zhanglianjie <<a href="mailto:zhanglianjie@uniontech.com" target="_blank">zhanglianjie@uniontech.com</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">Add TST_EXP_VAL to determine whether the return value<br>
is equal to the given value.<br>
<br>
Signed-off-by: zhanglianjie <<a href="mailto:zhanglianjie@uniontech.com" target="_blank">zhanglianjie@uniontech.com</a>><br>
<br>
diff --git a/include/tst_test_macros.h b/include/tst_test_macros.h<br>
index 50598aa15..d23455362 100644<br>
--- a/include/tst_test_macros.h<br>
+++ b/include/tst_test_macros.h<br>
@@ -132,6 +132,34 @@ extern void *TST_RET_PTR;<br>
TST_MSG_(TPASS, " passed", #SCALL, ##__VA_ARGS__); \<br>
} while (0) \<br>
<br>
+<br>
+#define TST_EXP_VAL_SILENT_(SCALL, SSCALL, VAL, ...) \<br>
+ do { \<br>
+ TEST(SCALL); \<br>
+ \<br>
+ TST_PASS = 0; \<br>
+ \<br>
+ if (TST_RET != VAL) { \<br>
+ TST_MSGP_(TFAIL | TTERRNO, " retval not %ld", \<br>
+ (long )VAL, SSCALL, ##__VA_ARGS__); \<br>
+ break; \<br>
+ } \<br>
+ \<br>
+ TST_PASS = 1; \<br>
+ \<br>
+ } while (0)<br>
+<br>
+#define TST_EXP_VAL_SILENT(SCALL, VAL, ...) TST_EXP_VAL_SILENT_(SCALL, #SCALL, VAL, ##__VA_ARGS__)<br>
+<br>
+#define TST_EXP_VAL(SCALL, VAL, ...) \<br>
+ do { \<br>
+ TST_EXP_VAL_SILENT(SCALL, VAL, ##__VA_ARGS__); \<br>
+ \<br>
+ if (TST_PASS) \<br>
+ TST_MSG_(TPASS, " passed", #SCALL, ##__VA_ARGS__); \<br>
+ \<br>
+ } while(0)<br>
+<br>
#define TST_EXP_FAIL_(PASS_COND, SCALL, SSCALL, ERRNO, ...) \<br>
do { \<br>
TEST(SCALL); \<br>
--<br>
2.20.1<br>
<br>
<br>
<br>
<br>
-- <br>
Mailing list info: <a href="https://lists.linux.it/listinfo/ltp" rel="noreferrer" target="_blank">https://lists.linux.it/listinfo/ltp</a><br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>