[PATCH 3/6] tests: Add period parameter to fill_memory_ex

Eugene Syromyatnikov evgsyr at gmail.com
Sat Oct 15 19:40:44 UTC 2016


* quotactl.h (fill_memory_ex): Add period parameter, use it as a divisor
  in non-constant part of value.
  (fill_memory): Provide period of 0x80 to fill_memory_ex call.
* quotactl-xfs.c (main): Likewise.
---
 tests/quotactl-xfs.c |    2 +-
 tests/quotactl.h     |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/quotactl-xfs.c b/tests/quotactl-xfs.c
index a08ccd2..da9175d 100644
--- a/tests/quotactl-xfs.c
+++ b/tests/quotactl-xfs.c
@@ -280,7 +280,7 @@ main(void)
 	check_quota(CQF_NONE, ARG_STR(QCMD(Q_XSETQLIM, PRJQUOTA)),
 		    bogus_special, bogus_special_str, 0, bogus_addr);
 
-	fill_memory_ex((char *) xdq, sizeof(*xdq), 0x8e);
+	fill_memory_ex((char *) xdq, sizeof(*xdq), 0x8e, 0x80);
 
 	check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_XSETQLIM, PRJQUOTA)),
 		    bogus_dev, bogus_dev_str, 3141592653U,
diff --git a/tests/quotactl.h b/tests/quotactl.h
index 49a6f87..ab0993e 100644
--- a/tests/quotactl.h
+++ b/tests/quotactl.h
@@ -92,19 +92,20 @@ enum check_quotactl_flags {
 
 
 static inline void
-fill_memory_ex(char *ptr, size_t size, unsigned char start)
+fill_memory_ex(char *ptr, size_t size, unsigned char start,
+	unsigned char period)
 {
 	size_t i;
 
 	for (i = 0; i < size; i++) {
-		ptr[i] = start + i % 80;
+		ptr[i] = start + i % period;
 	}
 }
 
 static inline void
 fill_memory(char *ptr, size_t size)
 {
-	fill_memory_ex(ptr, size, 0x80);
+	fill_memory_ex(ptr, size, 0x80, 0x80);
 }
 
 static inline void
-- 
1.7.10.4





More information about the Strace-devel mailing list