]> granicus.if.org Git - strace/commitdiff
tests: add period parameter to fill_memory_ex
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 30 Sep 2016 18:59:20 +0000 (21:59 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 26 Oct 2016 01:06:09 +0000 (01:06 +0000)
* 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.

tests/quotactl-xfs.c
tests/quotactl.h

index a08ccd25d7a4ebd233c5a6e9d3de2e5533867be5..da9175d211e04ec68adc855f76a12fed97bb919d 100644 (file)
@@ -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,
index 49a6f87c054f58c6fcd5ef0bb7d32b1080825eb5..240fdb29e26f67400f5046f791f17d199bbf54d3 100644 (file)
@@ -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