From: Eugene Syromyatnikov Date: Fri, 30 Sep 2016 18:59:20 +0000 (+0300) Subject: tests: add period parameter to fill_memory_ex X-Git-Tag: v4.15~222 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab648c804c3bf362830f11c5e92228f39a89bbb9;p=strace tests: add period parameter to fill_memory_ex * tests/quotactl.h (fill_memory_ex): Add period parameter, use it as a divisor in non-constant part of value. (fill_memory): Specify period of 0x80 to fill_memory_ex call. * tests/quotactl-xfs.c (main): Likewise. --- diff --git a/tests/quotactl-xfs.c b/tests/quotactl-xfs.c index a08ccd25..da9175d2 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 49a6f87c..240fdb29 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