summaryrefslogtreecommitdiff
path: root/tests/fcntl.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2018-06-01 01:46:06 +0000
committerDmitry V. Levin <ldv@altlinux.org>2018-06-01 01:46:06 +0000
commit9c7052f4031fefc1a4f2c8f38c75da60f525eec2 (patch)
treec826c08cc8088591ab0909b9598b05b4e9a7368d /tests/fcntl.c
parent3160ea8999f553544c34f0991223f08c01fe59b9 (diff)
downloadstrace-9c7052f4031fefc1a4f2c8f38c75da60f525eec2.tar.gz
tests: move F_OFD_SETLK* checks from fcntl64.c to fcntl-common.c
This change enables F_OFD_SETLK* tests for fcntl as well. * tests/fcntl64.c (test_flock64): Rename to test_flock64_lk64. [F_OFD_SETLK]: Remove. (test_flock64_einval): Move ... * tests/fcntl-common.c: ... here. (test_flock64_lk64): New protype. (test_flock64_einval, test_flock64): New functions. * tests/fcntl.c (test_flock64_einval): Rename to test_flock64_undecoded. (TEST_FLOCK64_UNDECODED): New macro. (test_flock64): Rename to test_flock64_lk64, replace TEST_FLOCK64_EINVAL with TEST_FLOCK64_UNDECODED.
Diffstat (limited to 'tests/fcntl.c')
-rw-r--r--tests/fcntl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/fcntl.c b/tests/fcntl.c
index 9f39a8ff7..ac4ca19e7 100644
--- a/tests/fcntl.c
+++ b/tests/fcntl.c
@@ -36,7 +36,7 @@
# include "fcntl-common.c"
static void
-test_flock64_einval(const int cmd, const char *name)
+test_flock64_undecoded(const int cmd, const char *name)
{
struct_kernel_flock64 fl = {
.l_type = F_RDLCK,
@@ -48,22 +48,24 @@ test_flock64_einval(const int cmd, const char *name)
TEST_SYSCALL_STR, name, &fl, sprintrc(rc));
}
+#define TEST_FLOCK64_UNDECODED(cmd) test_flock64_undecoded(cmd, #cmd)
+
static void
-test_flock64(void)
+test_flock64_lk64(void)
{
/*
* F_[GS]ETOWN_EX had conflicting values with F_[GS]ETLK64
* in kernel revisions v2.6.32-rc1~96..v2.6.32-rc7~23.
*/
# if !defined(F_GETOWN_EX) || F_GETOWN_EX != F_SETLK64
- TEST_FLOCK64_EINVAL(F_SETLK64);
+ TEST_FLOCK64_UNDECODED(F_SETLK64);
# endif
/* F_GETLK and F_SETLKW64 have conflicting values on mips64 */
# if !defined(__mips64) || F_GETLK != F_SETLKW64
- TEST_FLOCK64_EINVAL(F_SETLKW64);
+ TEST_FLOCK64_UNDECODED(F_SETLKW64);
# endif
# if !defined(F_SETOWN_EX) || F_SETOWN_EX != F_GETLK64
- TEST_FLOCK64_EINVAL(F_GETLK64);
+ TEST_FLOCK64_UNDECODED(F_GETLK64);
# endif
}