diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2016-04-13 20:22:42 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-04-15 10:12:19 -0700 |
commit | e6e7530d10b74d763b4311ea93e0a831b810d6c2 (patch) | |
tree | 7ac83d3fecd39d6076f24eaddd6719a24c3b6ce8 /test-genrandom.c | |
parent | 7897d84b8240720352e23030c35db461581b68e3 (diff) | |
download | git-e6e7530d10b74d763b4311ea93e0a831b810d6c2.tar.gz |
test helpers: move test-* to t/helper/ subdirectory
This keeps top dir a bit less crowded. And because these programs are
for testing purposes, it makes sense that they stay somewhere in t/
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'test-genrandom.c')
-rw-r--r-- | test-genrandom.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/test-genrandom.c b/test-genrandom.c deleted file mode 100644 index 54824d0754..0000000000 --- a/test-genrandom.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Simple random data generator used to create reproducible test files. - * This is inspired from POSIX.1-2001 implementation example for rand(). - * Copyright (C) 2007 by Nicolas Pitre, licensed under the GPL version 2. - */ - -#include "git-compat-util.h" - -int main(int argc, char *argv[]) -{ - unsigned long count, next = 0; - unsigned char *c; - - if (argc < 2 || argc > 3) { - fprintf(stderr, "usage: %s <seed_string> [<size>]\n", argv[0]); - return 1; - } - - c = (unsigned char *) argv[1]; - do { - next = next * 11 + *c; - } while (*c++); - - count = (argc == 3) ? strtoul(argv[2], NULL, 0) : -1L; - - while (count--) { - next = next * 1103515245 + 12345; - if (putchar((next >> 16) & 0xff) == EOF) - return -1; - } - - return 0; -} |