]> git.saurik.com Git - redis.git/commitdiff
memtest.c fixed to actually use v1 and v2 in memtest_fill_value().
authorantirez <antirez@gmail.com>
Fri, 27 Apr 2012 14:28:31 +0000 (16:28 +0200)
committerantirez <antirez@gmail.com>
Fri, 27 Apr 2012 14:29:44 +0000 (16:29 +0200)
src/memtest.c

index 09b4d831b1e579fa848af0887b1c7d013a04a16a..88c7213af7d4426c7cd1e462fd25de7ba3257f7f 100644 (file)
@@ -132,13 +132,13 @@ void memtest_fill_value(unsigned long *l, size_t bytes, unsigned long v1,
         v = (off & 1) ? v2 : v1;
         for (w = 0; w < iwords; w++) {
 #ifdef MEMTEST_32BIT
-            *l1 = *l2 = ((unsigned long)     (rand()&0xffff)) |
-                        (((unsigned long)    (rand()&0xffff)) << 16);
+            *l1 = *l2 = ((unsigned long)     v) |
+                        (((unsigned long)    v) << 16);
 #else
-            *l1 = *l2 = ((unsigned long)     (rand()&0xffff)) |
-                        (((unsigned long)    (rand()&0xffff)) << 16) |
-                        (((unsigned long)    (rand()&0xffff)) << 32) |
-                        (((unsigned long)    (rand()&0xffff)) << 48);
+            *l1 = *l2 = ((unsigned long)     v) |
+                        (((unsigned long)    v) << 16) |
+                        (((unsigned long)    v) << 32) |
+                        (((unsigned long)    v) << 48);
 #endif
             l1 += step;
             l2 += step;