]> git.saurik.com Git - redis.git/commitdiff
Allow a random seed argument for the ziplist test binary
authorPieter Noordhuis <pcnoordhuis@gmail.com>
Mon, 6 Sep 2010 22:08:42 +0000 (00:08 +0200)
committerPieter Noordhuis <pcnoordhuis@gmail.com>
Mon, 6 Sep 2010 22:08:42 +0000 (00:08 +0200)
src/ziplist.c

index f1069e413c7a5216b08069d104e4b2ed310dd2c6..5254423d9b3dfbad5612de0750193adaa8a2bc2f 100644 (file)
@@ -870,6 +870,10 @@ int main(int argc, char **argv) {
     unsigned int elen;
     long long value;
 
+    /* If an argument is given, use it as the random seed. */
+    if (argc == 2)
+        srand(atoi(argv[1]));
+
     zl = createIntList();
     ziplistRepr(zl);