<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 30, 2021 at 3:36 PM zhanglianjie <<a href="mailto:zhanglianjie@uniontech.com">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">Test the TST_EXP_VAL and TST_EXP_VAL_SILENT macros.<br>
<br>
Signed-off-by: zhanglianjie <<a href="mailto:zhanglianjie@uniontech.com" target="_blank">zhanglianjie@uniontech.com</a>><br></blockquote><div><span class="gmail_default" style="font-size:small"> Reviewed-by: Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.com</a>></span></div><div><span class="gmail_default" style="font-size:small"></span> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
diff --git a/lib/newlib_tests/.gitignore b/lib/newlib_tests/.gitignore<br>
index a0bad78c1..cf467b5a0 100644<br>
--- a/lib/newlib_tests/.gitignore<br>
+++ b/lib/newlib_tests/.gitignore<br>
@@ -42,6 +42,7 @@ test_macros02<br>
 test_macros03<br>
 test_macros04<br>
 test_macros05<br>
+test_macros06<br>
 tst_fuzzy_sync01<br>
 tst_fuzzy_sync02<br>
 tst_fuzzy_sync03<br>
diff --git a/lib/newlib_tests/test_macros06.c b/lib/newlib_tests/test_macros06.c<br>
new file mode 100644<br>
index 000000000..626f233d2<br>
--- /dev/null<br>
+++ b/lib/newlib_tests/test_macros06.c<br>
@@ -0,0 +1,40 @@<br>
+// SPDX-License-Identifier: GPL-2.0-or-later<br>
+/*<br>
+ * Copyright (c) 2021 zhanglianjie <<a href="mailto:zhanglianjie@uniontech.com" target="_blank">zhanglianjie@uniontech.com</a>><br>
+ */<br>
+<br>
+/*<br>
+ * Test TST_EXP_VAL and TST_EXP_VAL_SILENT macro.<br>
+ */<br>
+<br>
+#include "tst_test.h"<br>
+<br>
+static int fail_val(void)<br>
+{<br>
+       errno = EINVAL;<br>
+       return 42;<br>
+}<br>
+<br>
+static int pass_val(void)<br>
+{<br>
+       return 42;<br>
+}<br>
+<br>
+static void do_test(void)<br>
+{<br>
+       tst_res(TINFO, "Testing TST_EXP_VAL macro");<br>
+       TST_EXP_VAL(fail_val(), 40, "fail_val()");<br>
+       tst_res(TINFO, "TST_PASS = %i", TST_PASS);<br>
+       TST_EXP_VAL(pass_val(), 42, "fail_val()");<br>
+       tst_res(TINFO, "TST_PASS = %i", TST_PASS);<br>
+<br>
+       tst_res(TINFO, "Testing TST_EXP_PID_SILENT macro");<br>
+       TST_EXP_VAL_SILENT(fail_val(), 40, "fail_val()");<br>
+       tst_res(TINFO, "TST_PASS = %i", TST_PASS);<br>
+       TST_EXP_VAL_SILENT(pass_val(), 42, "%s", "pass_val()");<br>
+       tst_res(TINFO, "TST_PASS = %i", TST_PASS);<br>
+}<br>
+<br>
+static struct tst_test test = {<br>
+       .test_all = do_test,<br>
+};<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" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>