summaryrefslogtreecommitdiff
path: root/source3/torture/t_strcmp.c
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2003-04-09 05:22:17 +0000
committerMartin Pool <mbp@samba.org>2003-04-09 05:22:17 +0000
commit80cd7c552ff95b3aa4caf79768af5b1e5c07c506 (patch)
treebdd42cfac1fced17d1d0da5a02645a9b1540a610 /source3/torture/t_strcmp.c
parentff8d6da5a3e799ccad32add6cc2c79014c79a7ba (diff)
downloadsamba-80cd7c552ff95b3aa4caf79768af5b1e5c07c506.tar.gz
samba-80cd7c552ff95b3aa4caf79768af5b1e5c07c506.tar.bz2
samba-80cd7c552ff95b3aa4caf79768af5b1e5c07c506.zip
t_push_ucs2, t_strcmp: Run tests only once by default, rather than
10000 times. (In theory they should be pure functions....) You can specify a parameter to repeat them if you want to e.g. measure performance. (This used to be commit 92acecd28c3374abcadbff0ab9cb765411f453f4)
Diffstat (limited to 'source3/torture/t_strcmp.c')
-rw-r--r--source3/torture/t_strcmp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/torture/t_strcmp.c b/source3/torture/t_strcmp.c
index 1d26ad22de..47327a0e06 100644
--- a/source3/torture/t_strcmp.c
+++ b/source3/torture/t_strcmp.c
@@ -9,15 +9,18 @@
int main(int argc, char *argv[])
{
int i, ret;
+ int iters = 1;
- if (argc != 3) {
- fprintf(stderr, "usage: %s STRING1 STRING2\n"
+ if (argc < 3) {
+ fprintf(stderr, "usage: %s STRING1 STRING2 [ITERS]\n"
"Compares two strings, prints the results of StrCaseCmp\n",
argv[0]);
return 2;
}
+ if (argc >= 4)
+ iters = atoi(argv[3]);
- for (i = 0; i < 10000; i++)
+ for (i = 0; i < iters; i++)
ret = StrCaseCmp(argv[1], argv[2]);
printf("%d\n", ret);