<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 Fri, Oct 18, 2019 at 8:45 PM Clemens Famulla-Conrad <<a href="mailto:cfamullaconrad@suse.de">cfamullaconrad@suse.de</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">Simple test for different kinds of calls from tst_multiply_timeout()<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">Patch 4/5 and 5/5 needs "Signed-off-by: ..." tag, otherwise LGTM.</div><div class="gmail_default" style="font-size:small"> Reviewed-by: Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.com</a>></div><div class="gmail_default" style="font-size:small"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
lib/newlib_tests/shell/test_timeout_mul.sh | 43 ++++++++++++++++++++++++++++++<br>
1 file changed, 43 insertions(+)<br>
create mode 100755 lib/newlib_tests/shell/test_timeout_mul.sh<br>
<br>
diff --git a/lib/newlib_tests/shell/test_timeout_mul.sh b/lib/newlib_tests/shell/test_timeout_mul.sh<br>
new file mode 100755<br>
index 000000000..6682e5d66<br>
--- /dev/null<br>
+++ b/lib/newlib_tests/shell/test_timeout_mul.sh<br>
@@ -0,0 +1,43 @@<br>
+#!/bin/sh<br>
+# SPDX-License-Identifier: GPL-2.0-or-later<br>
+# Copyright (c) 2019 Clemens Famulla-Conrad <<a href="mailto:cfamullaconrad@suse.de" target="_blank">cfamullaconrad@suse.de</a>><br>
+<br>
+TST_TESTFUNC=do_test<br>
+. tst_test.sh<br>
+<br>
+<br>
+call_it()<br>
+{<br>
+ local SAVE_MUL=${LTP_TIMEOUT_MUL}<br>
+ $1<br>
+ eval "exp_value=\$$2"<br>
+ if [ "$exp_value" -ne "$3" ]; then<br>
+ tst_brk TBROK "LTP_TIMEOUT_MUL=$SAVE_MUL $1 ($exp_value != $3)"<br>
+ else<br>
+ tst_res TPASS "LTP_TIMEOUT_MUL=$SAVE_MUL $1 ($exp_value == $3)"<br>
+ fi<br>
+}<br>
+<br>
+do_test()<br>
+{<br>
+ LTP_TIMEOUT_MUL=2<br>
+ local sec=1<br>
+<br>
+ call_it 'tst_multiply_timeout sec' 'sec' 2<br>
+<br>
+ sec=1<br>
+ LTP_TIMEOUT_MUL="1.5"<br>
+ call_it 'tst_multiply_timeout sec' 'sec' 2<br>
+<br>
+ sec=1<br>
+ LTP_TIMEOUT_MUL=0.5<br>
+ call_it 'tst_multiply_timeout sec' 'sec' 1<br>
+<br>
+ sec=1<br>
+ LTP_TIMEOUT_MUL=2<br>
+ call_it 'tst_multiply_timeout sec' 'sec' 2<br>
+ call_it 'tst_multiply_timeout sec' 'sec' 4<br>
+ call_it 'tst_multiply_timeout sec' 'sec' 8<br>
+}<br>
+<br>
+tst_run<br>
-- <br>
2.16.4<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>