From e6e7530d10b74d763b4311ea93e0a831b810d6c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Wed, 13 Apr 2016 20:22:42 +0700 Subject: test helpers: move test-* to t/helper/ subdirectory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- test-genrandom.c | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 test-genrandom.c (limited to 'test-genrandom.c') diff --git a/test-genrandom.c b/test-genrandom.c deleted file mode 100644 index 54824d075..000000000 --- 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 []\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; -} -- cgit v1.2.1