Cleanup syscalls/flock test messages
PATCH 1/1 Cleanup syscalls/flock test messages
Hi,
Please find a small patch that cleanup flock(2) syscalls tests to use TTERRNO/TERRNO in messages instead of home made versions with TEST_ERRNO/errno.
Regards.
Signature · 15 lines
Nicolas Joly Cluster & Computing Group Biology IT Center Institut Pasteur, Paris. -------------- next part -------------- commit ab1d7c59b56be8b3361ee8654b69ab55520c08da Author: Nicolas Joly <[email protected]> Date: Sat Oct 24 11:52:19 2015 +0200 syscalls/flock: Cleanup. Use TERRNO/TTERRNO in messages instead of home made versions. Signed-off-by: Nicolas Joly <[email protected]>
testcases/kernel/syscalls/flock/flock01.c +9 -11
@@ -83,10 +83,10 @@ struct test_case_t {int operation;char *opt; } test_cases[] = { - { - LOCK_SH, "Shared Lock"}, { - LOCK_UN, "Unlock"}, { -LOCK_EX, "Exclusive Lock"},}; + { LOCK_SH, "Shared Lock" }, + { LOCK_UN, "Unlock"}, + { LOCK_EX, "Exclusive Lock"} +};int main (int argc,char **argv) {
@@ -108,17 +108,15 @@ int main(int argc, char **argv)/* Testing system call */ TEST (flock (fd, test_cases[i].operation)); -if (TEST_RETURN ==-1 ) { -tst_resm (TFAIL , -"flock() failed to get %s, error number=%d : %s" , - test_cases[i].opt,TEST_ERRNO , -strerror (TEST_ERRNO )); +tst_resm (TFAIL |TTERRNO , +"flock() failed to get %s" , + test_cases[i].opt);continue ;/*next loop for MTKERNEL */ }else {tst_resm (TPASS , -"flock() succeeded with %s, returned error number=%d" , - test_cases[i].opt,TEST_ERRNO ); +"flock() succeeded with %s" , + test_cases[i].opt); } }
testcases/kernel/syscalls/flock/flock03.c +7 -9
@@ -77,19 +77,18 @@ int main(int argc, char **argv) fd =open (FILE_NAME ,O_RDWR );if (fd ==-1 ) -tst_brkm (TFAIL , cleanup,"parent failed to open the" -"file, errno %d" , errno); +tst_brkm (TFAIL |TERRNO , cleanup, +"parent failed to open the file" ); pid =FORK_OR_VFORK ();if (pid ==-1 ) -tst_brkm (TFAIL , cleanup,"fork() failed, errno %d" , - errno); +tst_brkm (TFAIL |TERRNO , cleanup,"fork() failed" );if (pid ==0 ) {#ifdef UCLINUX if (self_exec (argv[0 ],"ds" , fd,FILE_NAME ) <0 ) -tst_brkm (TFAIL , cleanup,"self_exec failed, " -"errno &d" , errno); +tst_brkm (TFAIL |TERRNO , cleanup, +"self_exec failed" );#else childfunc (fd);#endif
@@ -98,9 +97,8 @@ int main(int argc, char **argv)TEST (flock (fd,LOCK_EX |LOCK_NB ));if (TEST_RETURN !=0 ) -tst_resm (TFAIL , -"Parent: Initial attempt to flock() failed, " -"errno %d" ,TEST_ERRNO ); +tst_resm (TFAIL |TTERRNO , +"Parent: Initial attempt to flock() failed" );else tst_resm (TPASS ,"Parent: Initial attempt to flock() passed" );
testcases/kernel/syscalls/flock/flock06.c +7 -8
@@ -93,20 +93,20 @@ int main(int argc, char **argv) fd1 =open (filename,O_RDWR );if (fd1 ==-1 ) -tst_brkm (TFAIL , cleanup,"failed to open the" -"file, errno %d" , errno); +tst_brkm (TFAIL |TERRNO , cleanup, +"failed to open the file" );TEST (flock (fd1,LOCK_EX |LOCK_NB ));if (TEST_RETURN !=0 ) -tst_resm (TFAIL ,"First attempt to flock() failed, " -"errno %d" ,TEST_ERRNO ); +tst_resm (TFAIL |TTERRNO , +"First attempt to flock() failed" );else tst_resm (TPASS ,"First attempt to flock() passed" ); fd2 =open (filename,O_RDWR );if (fd2 ==-1 ) -tst_brkm (TFAIL , cleanup,"failed to open the" -"file, errno %d" , errno); +tst_brkm (TFAIL |TERRNO , cleanup, +"failed to open the file" );TEST (flock (fd2,LOCK_EX |LOCK_NB ));if (TEST_RETURN ==-1 )
@@ -116,8 +116,7 @@ int main(int argc, char **argv)TEST (flock (fd1,LOCK_UN ));if (TEST_RETURN ==-1 ) -tst_resm (TFAIL ,"Failed to unlock fd1, errno %d" , -TEST_ERRNO ); +tst_resm (TFAIL |TTERRNO ,"Failed to unlock fd1" );else tst_resm (TPASS ,"Unlocked fd1" );
PATCH 1/1 Cleanup syscalls/flock test messages
Hi!
Quoted 3 lines
Please find a small patch that cleanup flock(2) syscalls tests to use TTERRNO/TERRNO in messages instead of home made versions with TEST_ERRNO/errno.
Pushed, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]