<div dir="ltr">Hi, all<div><br><div>I think my progress may be a little slow now considering I haven't made this patch<div>acceptable yet. I submitted my proposal just before the deadline without discussion so there </div><div>must be a lot of problems. In this community bonding period I'm trying to make myself ready</div><div>for coding but I kinda don't know which specific part of tests I should start with. The ratio of </div><div>coverage on codecov is a good reference. Should I just start with the part with the least coverage?<div>I hope you guys can tell me something about what is feasible and what is not.</div><div><br></div><div>Thanks,</div><div>Zhibin Li</div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 30, 2018 at 5:54 PM, Zhibin Li <span dir="ltr"><<a href="mailto:08826794brmt@gmail.com" target="_blank">08826794brmt@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">*tests/fcntl.c include <stdarg.h><br>
(test_f_owner_ex_type_pid, test_f_owner_ex_umove,<br>
test_f_owner_ex): New functions.<br>
(main): Use test_f_owner_ex.<br>
---<br>
tests/fcntl.c | 53 ++++++++++++++++++++++++++++++<wbr>+++++++++++++++++++++++<br>
1 file changed, 53 insertions(+)<br>
<br>
diff --git a/tests/fcntl.c b/tests/fcntl.c<br>
index 4f62ca2a..c05d00a1 100644<br>
--- a/tests/fcntl.c<br>
+++ b/tests/fcntl.c<br>
@@ -69,12 +69,65 @@ test_flock64(void)<br>
#endif<br>
}<br>
<br>
+static long<br>
+test_f_owner_ex_type_pid(<wbr>const int cmd, const char *const cmd_name,<br>
+ const int type, const char *const type_name,<br>
+ pid_t pid)<br>
+{<br>
+ TAIL_ALLOC_OBJECT_CONST_PTR(<wbr>struct f_owner_ex, fo);<br>
+<br>
+ fo->type = type;<br>
+ fo->pid = pid;<br>
+ long rc = invoke_test_syscall(cmd, fo);<br>
+ printf("%s(0, %s, {type=%s, pid=%d}) = %s\n",<br>
+ TEST_SYSCALL_STR, cmd_name, type_name, fo->pid, sprintrc(rc));<br>
+<br>
+ long rc_efault = invoke_test_syscall(cmd, (void *) (uintptr_t) fo + 1);<br>
+ printf("%s(0, %s, %p) = %s\n",<br>
+ TEST_SYSCALL_STR, cmd_name, (void *) (uintptr_t) fo + 1, sprintrc(rc_efault));<br>
+<br>
+ return rc;<br>
+}<br>
+<br>
+static void<br>
+test_f_owner_ex_umove_or_<wbr>printaddr(const int type, const char *const type_name, pid_t pid)<br>
+{<br>
+ long rc = test_f_owner_ex_type_pid(ARG_<wbr>STR(F_SETOWN_EX),<br>
+ type, type_name, pid);<br>
+ if (!rc)<br>
+ test_f_owner_ex_type_pid(ARG_<wbr>STR(F_GETOWN_EX),<br>
+ type, type_name, pid);<br>
+}<br>
+<br>
+static void<br>
+test_f_owner_ex(void)<br>
+{<br>
+ unsigned int i;<br>
+ unsigned int j;<br>
+ static const struct {<br>
+ int type;<br>
+ const char *type_name;<br>
+ pid_t pid[2];<br>
+ } a[] = {<br>
+ { ARG_STR(F_OWNER_TID), { 1234567890, 20 } },<br>
+ { ARG_STR(F_OWNER_PID), { 1298126790, 30 } },<br>
+ { ARG_STR(F_OWNER_PGRP), { 1294567890, 40 } }<br>
+ };<br>
+<br>
+ for (i = 0; i < ARRAY_SIZE(a); i++) {<br>
+ for (j = 0; j < ARRAY_SIZE(a[0].pid); j++) {<br>
+ test_f_owner_ex_umove_or_<wbr>printaddr(a[i].type, a[i].type_name, a[i].pid[j]);<br>
+ }<br>
+ }<br>
+}<br>
+<br>
int<br>
main(void)<br>
{<br>
create_sample();<br>
test_flock();<br>
test_flock64();<br>
+ test_f_owner_ex();<br>
<br>
puts("+++ exited with 0 +++");<br>
return 0;<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.14.3<br>
<br>
</font></span></blockquote></div><br></div></div></div></div></div></div></div>