xref: /csrg-svn/lib/libc/db/test/run.test (revision 59494)
156038Sbostic#!/bin/sh -
256038Sbostic#
356038Sbostic# Copyright (c) 1992 The Regents of the University of California.
456038Sbostic# All rights reserved.
556038Sbostic#
656038Sbostic# %sccs.include.redist.sh%
756038Sbostic#
8*59494Sbostic#	@(#)run.test	5.15 (Berkeley) 04/29/93
956038Sbostic#
1056038Sbostic
1156038Sbostic# db regression tests
1256038Sbostic
1356038Sbosticmain()
1456038Sbostic{
1556038Sbostic	DICT=/usr/share/dict/words
1656058Sbostic	PROG=obj/dbtest
1756038Sbostic	TMP1=t1
1856038Sbostic	TMP2=t2
1956038Sbostic	TMP3=t3
2056038Sbostic
2156038Sbostic	test1
2256038Sbostic	test2
2356038Sbostic	test3
2456038Sbostic	test4
2556050Sbostic	test5
2656050Sbostic	test6
2756058Sbostic	test7
2856085Sbostic	test8
2957001Sbostic	test9
3056765Sbostic	test10
3156999Sbostic	test11
3257455Sbostic	test12
3356999Sbostic	test20
3456038Sbostic	rm -f $TMP1 $TMP2 $TMP3
3556999Sbostic	exit 0
3656038Sbostic}
3756038Sbostic
3856038Sbostic# Take the first hundred entries in the dictionary, and make them
3956038Sbostic# be key/data pairs.
4056038Sbostictest1()
4156038Sbostic{
4256050Sbostic	printf "Test 1: btree, hash: small key, small data pairs\n"
4356085Sbostic	sed 200q $DICT > $TMP1
4456038Sbostic	for type in btree hash; do
4556038Sbostic		rm -f $TMP2 $TMP3
4656038Sbostic		for i in `sed 200q $DICT`; do
4756038Sbostic			printf "p\nk%s\nd%s\ng\nk%s\n" $i $i $i
4856038Sbostic		done > $TMP2
4956058Sbostic		$PROG -o $TMP3 $type $TMP2
5057460Sbostic		if (cmp -s $TMP1 $TMP3) ; then :
5156038Sbostic		else
5256038Sbostic			printf "test1: type %s: failed\n" $type
5356038Sbostic			exit 1
5456038Sbostic		fi
5556038Sbostic	done
5656050Sbostic	printf "Test 1: recno: small key, small data pairs\n"
5756038Sbostic	rm -f $TMP2 $TMP3
5856038Sbostic	sed 200q $DICT |
5956058Sbostic	awk '{
6056058Sbostic		++i;
6156058Sbostic		printf("p\nk%d\nd%s\ng\nk%d\n", i, $0, i);
6256058Sbostic	}' > $TMP2
6356058Sbostic	$PROG -o $TMP3 recno $TMP2
6457460Sbostic	if (cmp -s $TMP1 $TMP3) ; then :
6556038Sbostic	else
6656038Sbostic		printf "test1: type recno: failed\n"
6756038Sbostic		exit 1
6856038Sbostic	fi
6956038Sbostic}
7056038Sbostic
7157455Sbostic# Take the first 200 entries in the dictionary, and give them
7256038Sbostic# each a medium size data entry.
7356038Sbostictest2()
7456038Sbostic{
7556050Sbostic	printf "Test 2: btree, hash: small key, medium data pairs\n"
7656038Sbostic	mdata=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
7756038Sbostic	echo $mdata |
7856058Sbostic	awk '{ for (i = 1; i < 201; ++i) print $0 }' > $TMP1
7956038Sbostic	for type in hash btree; do
8056038Sbostic		rm -f $TMP2 $TMP3
8156038Sbostic		for i in `sed 200q $DICT`; do
8256038Sbostic			printf "p\nk%s\nd%s\ng\nk%s\n" $i $mdata $i
8356038Sbostic		done > $TMP2
8456058Sbostic		$PROG -o $TMP3 $type $TMP2
8557460Sbostic		if (cmp -s $TMP1 $TMP3) ; then :
8656038Sbostic		else
8756038Sbostic			printf "test2: type %s: failed\n" $type
8856038Sbostic			exit 1
8956038Sbostic		fi
9056038Sbostic	done
9156050Sbostic	printf "Test 2: recno: small key, medium data pairs\n"
9256038Sbostic	rm -f $TMP2 $TMP3
9356038Sbostic	echo $mdata |
9456058Sbostic	awk '{  for (i = 1; i < 201; ++i)
9556058Sbostic		printf("p\nk%d\nd%s\ng\nk%d\n", i, $0, i);
9656058Sbostic	}' > $TMP2
9756058Sbostic	$PROG -o $TMP3 recno $TMP2
9857460Sbostic	if (cmp -s $TMP1 $TMP3) ; then :
9956038Sbostic	else
10056038Sbostic		printf "test2: type recno: failed\n"
10156038Sbostic		exit 1
10256038Sbostic	fi
10356038Sbostic}
10456038Sbostic
10556038Sbostic# Insert the programs in /bin with their paths as their keys.
10656038Sbostictest3()
10756038Sbostic{
10856050Sbostic	printf "Test 3: btree, hash: small key, big data pairs\n"
10956038Sbostic	rm -f $TMP1
11056038Sbostic	(find /bin -type f -print | xargs cat) > $TMP1
11156038Sbostic	for type in hash btree; do
11256038Sbostic		rm -f $TMP2 $TMP3
11356038Sbostic		for i in `find /bin -type f -print`; do
11456038Sbostic			printf "p\nk%s\nD%s\ng\nk%s\n" $i $i $i
11556038Sbostic		done > $TMP2
11656058Sbostic		$PROG -o $TMP3 $type $TMP2
11757460Sbostic		if (cmp -s $TMP1 $TMP3) ; then :
11856038Sbostic		else
11956385Sbostic			printf "test3: type %s: failed\n" $type
12056038Sbostic			exit 1
12156038Sbostic		fi
12256038Sbostic	done
12356050Sbostic	printf "Test 3: recno: big data pairs\n"
12456038Sbostic	rm -f $TMP2 $TMP3
12556038Sbostic	find /bin -type f -print |
12656058Sbostic	awk '{
12756058Sbostic		++i;
12856058Sbostic		printf("p\nk%d\nD%s\ng\nk%d\n", i, $0, i);
12956058Sbostic	}' > $TMP2
13056058Sbostic	$PROG -o $TMP3 recno $TMP2
13157460Sbostic	if (cmp -s $TMP1 $TMP3) ; then :
13256038Sbostic	else
13356038Sbostic		printf "test3: type recno: failed\n"
13456038Sbostic		exit 1
13556038Sbostic	fi
13656038Sbostic}
13756038Sbostic
13856038Sbostic# Do random recno entries.
13956038Sbostictest4()
14056038Sbostic{
14156050Sbostic	printf "Test 4: recno: random entries\n"
14256050Sbostic	echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
14356058Sbostic	awk '{
14456058Sbostic		for (i = 37; i <= 37 + 88 * 17; i += 17)
14556058Sbostic			printf("input key %d: %.*s\n", i, i % 41, $0);
14656058Sbostic		for (i = 1; i <= 15; ++i)
14756058Sbostic			printf("input key %d: %.*s\n", i, i % 41, $0);
14856058Sbostic		for (i = 19234; i <= 19234 + 61 * 27; i += 27)
14956058Sbostic			printf("input key %d: %.*s\n", i, i % 41, $0);
15056058Sbostic		exit
15156058Sbostic	}' > $TMP1
15256058Sbostic	rm -f TMP2 $TMP3
15356058Sbostic	cat $TMP1 |
15456058Sbostic	awk 'BEGIN {
15556058Sbostic			i = 37;
15656058Sbostic			incr = 17;
15756058Sbostic		}
15856058Sbostic		{
15956058Sbostic			printf("p\nk%d\nd%s\n", i, $0);
16056058Sbostic			if (i == 19234 + 61 * 27)
16156058Sbostic				exit;
16256058Sbostic			if (i == 37 + 88 * 17) {
16356058Sbostic				i = 1;
16456058Sbostic				incr = 1;
16556058Sbostic			} else if (i == 15) {
16656058Sbostic				i = 19234;
16756058Sbostic				incr = 27;
16856058Sbostic			} else
16956058Sbostic				i += incr;
17056058Sbostic		}
17156058Sbostic		END {
17256038Sbostic			for (i = 37; i <= 37 + 88 * 17; i += 17)
17356058Sbostic				printf("g\nk%d\n", i);
17456038Sbostic			for (i = 1; i <= 15; ++i)
17556058Sbostic				printf("g\nk%d\n", i);
17656038Sbostic			for (i = 19234; i <= 19234 + 61 * 27; i += 27)
17756058Sbostic				printf("g\nk%d\n", i);
17856058Sbostic		}' > $TMP2
17956058Sbostic	$PROG -o $TMP3 recno $TMP2
18057460Sbostic	if (cmp -s $TMP1 $TMP3) ; then :
18156038Sbostic	else
18256038Sbostic		printf "test4: type recno: failed\n"
18356038Sbostic		exit 1
18456038Sbostic	fi
18556038Sbostic}
18656050Sbostic
18756050Sbostic# Do reverse order recno entries.
18856050Sbostictest5()
18956050Sbostic{
19056050Sbostic	printf "Test 5: recno: reverse order entries\n"
19156050Sbostic	echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
19256058Sbostic	awk ' {
19356058Sbostic		for (i = 1500; i; --i)
19456058Sbostic			printf("input key %d: %.*s\n", i, i % 34, $0);
19556058Sbostic		exit;
19656058Sbostic	}' > $TMP1
19756050Sbostic	rm -f TMP2 $TMP3
19856058Sbostic	cat $TMP1 |
19956058Sbostic	awk 'BEGIN {
20056058Sbostic			i = 1500;
20156058Sbostic		}
20256058Sbostic		{
20356058Sbostic			printf("p\nk%d\nd%s\n", i, $0);
20456058Sbostic			--i;
20556058Sbostic		}
20656058Sbostic		END {
20756058Sbostic			for (i = 1500; i; --i)
20856058Sbostic				printf("g\nk%d\n", i);
20956058Sbostic		}' > $TMP2
21056058Sbostic	$PROG -o $TMP3 recno $TMP2
21157460Sbostic	if (cmp -s $TMP1 $TMP3) ; then :
21256050Sbostic	else
21356050Sbostic		printf "test5: type recno: failed\n"
21456050Sbostic		exit 1
21556050Sbostic	fi
21656050Sbostic}
21756038Sbostic
21856050Sbostic# Do alternating order recno entries.
21956050Sbostictest6()
22056050Sbostic{
22156050Sbostic	printf "Test 6: recno: alternating order entries\n"
22256050Sbostic	echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
22356058Sbostic	awk ' {
22456058Sbostic		for (i = 1; i < 1200; i += 2)
22556058Sbostic			printf("input key %d: %.*s\n", i, i % 34, $0);
22656058Sbostic		for (i = 2; i < 1200; i += 2)
22756058Sbostic			printf("input key %d: %.*s\n", i, i % 34, $0);
22856058Sbostic		exit;
22956058Sbostic	}' > $TMP1
23056050Sbostic	rm -f TMP2 $TMP3
23156058Sbostic	cat $TMP1 |
23256058Sbostic	awk 'BEGIN {
23356058Sbostic			i = 1;
23456058Sbostic			even = 0;
23556058Sbostic		}
23656058Sbostic		{
23756058Sbostic			printf("p\nk%d\nd%s\n", i, $0);
23856058Sbostic			i += 2;
23956058Sbostic			if (i >= 1200) {
24056058Sbostic				if (even == 1)
24156058Sbostic					exit;
24256058Sbostic				even = 1;
24356058Sbostic				i = 2;
24456050Sbostic			}
24556058Sbostic		}
24656058Sbostic		END {
24756058Sbostic			for (i = 1; i < 1200; ++i)
24856058Sbostic				printf("g\nk%d\n", i);
24956058Sbostic		}' > $TMP2
25056058Sbostic	$PROG -o $TMP3 recno $TMP2
25156050Sbostic	sort -o $TMP1 $TMP1
25256050Sbostic	sort -o $TMP3 $TMP3
25357460Sbostic	if (cmp -s $TMP1 $TMP3) ; then :
25456050Sbostic	else
25556050Sbostic		printf "test6: type recno: failed\n"
25656050Sbostic		exit 1
25756050Sbostic	fi
25856050Sbostic}
25956050Sbostic
26056058Sbostic# Delete cursor record
26156058Sbostictest7()
26256058Sbostic{
26356058Sbostic	printf "Test 7: btree, recno: delete cursor record\n"
26456058Sbostic	echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
26556058Sbostic	awk '{
26656058Sbostic		for (i = 1; i <= 120; ++i)
26756058Sbostic			printf("%05d: input key %d: %s\n", i, i, $0);
26856058Sbostic		printf("%05d: input key %d: %s\n", 120, 120, $0);
26956058Sbostic		printf("get failed, no such key\n");
27056058Sbostic		printf("%05d: input key %d: %s\n", 1, 1, $0);
27156058Sbostic		printf("%05d: input key %d: %s\n", 2, 2, $0);
27256058Sbostic		exit;
27356058Sbostic	}' > $TMP1
27456058Sbostic	rm -f TMP2 $TMP3
27556763Sbostic
27656058Sbostic	for type in btree recno; do
27756058Sbostic		cat $TMP1 |
27856058Sbostic		awk '{
27956058Sbostic			if (i == 120)
28056058Sbostic				exit;
28156058Sbostic			printf("p\nk%d\nd%s\n", ++i, $0);
28256058Sbostic		}
28356058Sbostic		END {
28456058Sbostic			printf("fR_NEXT\n");
28556058Sbostic			for (i = 1; i <= 120; ++i)
28656058Sbostic				printf("s\n");
28756058Sbostic			printf("fR_CURSOR\ns\nk120\n");
28856058Sbostic			printf("r\nk120\n");
28956058Sbostic			printf("fR_NEXT\ns\n");
29056058Sbostic			printf("fR_CURSOR\ns\nk1\n");
29156058Sbostic			printf("r\nk1\n");
29256058Sbostic			printf("fR_FIRST\ns\n");
29356058Sbostic		}' > $TMP2
29456058Sbostic		$PROG -o $TMP3 recno $TMP2
29557460Sbostic		if (cmp -s $TMP1 $TMP3) ; then :
29656058Sbostic		else
29756058Sbostic			printf "test7: type $type: failed\n"
29856058Sbostic			exit 1
29956058Sbostic		fi
30056058Sbostic	done
30156058Sbostic}
30256058Sbostic
30356495Sbostic# Make sure that overflow pages are reused.
30456085Sbostictest8()
30556085Sbostic{
30656495Sbostic	printf "Test 8: btree, hash: repeated small key, big data pairs\n"
30756495Sbostic	rm -f $TMP1
30856495Sbostic	awk 'BEGIN {
30956556Sbostic		for (i = 1; i <= 10; ++i) {
31056495Sbostic			printf("p\nkkey1\nD/bin/sh\n");
31156495Sbostic			printf("p\nkkey2\nD/bin/csh\n");
31256554Sbostic			if (i % 8 == 0) {
31356554Sbostic				printf("c\nkkey2\nD/bin/csh\n");
31456554Sbostic				printf("c\nkkey1\nD/bin/sh\n");
31556763Sbostic				printf("e\t%d of 10 (comparison)\r\n", i);
31656554Sbostic			} else
31756763Sbostic				printf("e\t%d of 10             \r\n", i);
31856495Sbostic			printf("r\nkkey1\nr\nkkey2\n");
31956495Sbostic		}
32056556Sbostic		printf("e\n");
32156556Sbostic		printf("eend of test8 run\n");
32256495Sbostic	}' > $TMP1
32356554Sbostic	$PROG btree $TMP1
32456554Sbostic	$PROG hash $TMP1
32556495Sbostic	# No explicit test for success.
32656495Sbostic}
32756495Sbostic
32857001Sbostic# Test btree duplicate keys
32957001Sbostictest9()
33057001Sbostic{
33157001Sbostic	printf "Test 9: btree: duplicate keys\n"
33257001Sbostic	echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
33357001Sbostic	awk '{
33457001Sbostic		for (i = 1; i <= 543; ++i)
33557001Sbostic			printf("%05d: input key %d: %s\n", i, i, $0);
33657001Sbostic		exit;
33757001Sbostic	}' > $TMP1
33857001Sbostic	rm -f TMP2 $TMP3
33957001Sbostic
34057001Sbostic	for type in btree; do
34157001Sbostic		cat $TMP1 |
34257001Sbostic		awk '{
34357001Sbostic			if (i++ % 2)
34457001Sbostic				printf("p\nkduplicatekey\nd%s\n", $0);
34557001Sbostic			else
34657001Sbostic				printf("p\nkunique%dkey\nd%s\n", i, $0);
34757001Sbostic		}
34857001Sbostic		END {
34957001Sbostic				printf("o\n");
35057001Sbostic		}' > $TMP2
35157001Sbostic		$PROG -iflags=1 -o $TMP3 $type $TMP2
35257001Sbostic		sort -o $TMP3 $TMP3
35357460Sbostic		if (cmp -s $TMP1 $TMP3) ; then :
35457001Sbostic		else
35557001Sbostic			printf "test9: type $type: failed\n"
35657001Sbostic			exit 1
35757001Sbostic		fi
35857001Sbostic	done
35957001Sbostic}
36057001Sbostic
36156999Sbostic# Test use of cursor flags without initialization
36256999Sbostictest10()
36356999Sbostic{
36456999Sbostic	printf "Test 10: btree, recno: test cursor flag use\n"
36556999Sbostic	echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
36656999Sbostic	awk '{
36756999Sbostic		for (i = 1; i <= 20; ++i)
36856999Sbostic			printf("%05d: input key %d: %s\n", i, i, $0);
36956999Sbostic		exit;
37056999Sbostic	}' > $TMP1
37156999Sbostic	rm -f TMP2 $TMP3
37256999Sbostic
37356999Sbostic	# Test that R_CURSOR doesn't succeed before cursor initialized
37456999Sbostic	for type in btree recno; do
37556999Sbostic		cat $TMP1 |
37656999Sbostic		awk '{
37756999Sbostic			if (i == 10)
37856999Sbostic				exit;
37956999Sbostic			printf("p\nk%d\nd%s\n", ++i, $0);
38056999Sbostic		}
38156999Sbostic		END {
38256999Sbostic			printf("fR_CURSOR\nr\nk1\n");
38356999Sbostic			printf("eR_CURSOR SHOULD HAVE FAILED\n");
38456999Sbostic		}' > $TMP2
38556999Sbostic		$PROG -o $TMP3 $type $TMP2 > /dev/null 2>&1
38656999Sbostic		if [ -s $TMP3 ] ; then
38756999Sbostic			printf "Test 10: delete: R_CURSOR SHOULD HAVE FAILED\n"
38856999Sbostic			exit 1
38956999Sbostic		fi
39056999Sbostic	done
39156999Sbostic	for type in btree recno; do
39256999Sbostic		cat $TMP1 |
39356999Sbostic		awk '{
39456999Sbostic			if (i == 10)
39556999Sbostic				exit;
39656999Sbostic			printf("p\nk%d\nd%s\n", ++i, $0);
39756999Sbostic		}
39856999Sbostic		END {
39956999Sbostic			printf("fR_CURSOR\np\nk1\ndsome data\n");
40056999Sbostic			printf("eR_CURSOR SHOULD HAVE FAILED\n");
40156999Sbostic		}' > $TMP2
40256999Sbostic		$PROG -o $TMP3 $type $TMP2 > /dev/null 2>&1
40356999Sbostic		if [ -s $TMP3 ] ; then
40456999Sbostic			printf "Test 10: put: R_CURSOR SHOULD HAVE FAILED\n"
40556999Sbostic			exit 1
40656999Sbostic		fi
40756999Sbostic	done
40856999Sbostic}
40956999Sbostic
41056999Sbostic# Test insert in reverse order.
41156999Sbostictest11()
41256999Sbostic{
41356999Sbostic	printf "Test 11: recno: reverse order insert\n"
41456999Sbostic	echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
41556999Sbostic	awk '{
41656999Sbostic		for (i = 1; i <= 779; ++i)
41756999Sbostic			printf("%05d: input key %d: %s\n", i, i, $0);
41856999Sbostic		exit;
41956999Sbostic	}' > $TMP1
42056999Sbostic	rm -f TMP2 $TMP3
42156999Sbostic
42256999Sbostic	for type in recno; do
42356999Sbostic		cat $TMP1 |
42456999Sbostic		awk '{
42556999Sbostic			if (i == 0) {
42656999Sbostic				i = 1;
42756999Sbostic				printf("p\nk1\nd%s\n", $0);
42856999Sbostic				printf("%s\n", "fR_IBEFORE");
42956999Sbostic			} else
43056999Sbostic				printf("p\nk1\nd%s\n", $0);
43156999Sbostic		}
43256999Sbostic		END {
43356999Sbostic				printf("or\n");
43456999Sbostic		}' > $TMP2
43556999Sbostic		$PROG -o $TMP3 $type $TMP2
43657460Sbostic		if (cmp -s $TMP1 $TMP3) ; then :
43756999Sbostic		else
43856999Sbostic			printf "test11: type $type: failed\n"
43956999Sbostic			exit 1
44056999Sbostic		fi
44156999Sbostic	done
44256999Sbostic}
44356999Sbostic
44457455Sbostic# Take the first 20000 entries in the dictionary, reverse them, and give
44557455Sbostic# them each a small size data entry.  Use a small page size to make sure
44657455Sbostic# the btree split code gets hammered.
44757455Sbostictest12()
44857455Sbostic{
44957455Sbostic	printf "Test 12: btree: lots of keys, small page size\n"
45057455Sbostic	mdata=abcdefghijklmnopqrstuvwxy
45157455Sbostic	echo $mdata |
45257455Sbostic	awk '{ for (i = 1; i < 20001; ++i) print $0 }' > $TMP1
45357455Sbostic	for type in btree; do
45457455Sbostic		rm -f $TMP2 $TMP3
45557455Sbostic		for i in `sed 20000q $DICT | rev`; do
45657455Sbostic			printf "p\nk%s\nd%s\ng\nk%s\n" $i $mdata $i
45757455Sbostic		done > $TMP2
45857455Sbostic		$PROG -i psize=512 -o $TMP3 $type $TMP2
45957460Sbostic		if (cmp -s $TMP1 $TMP3) ; then :
46057455Sbostic		else
46157455Sbostic			printf "test12: type %s: failed\n" $type
46257455Sbostic			exit 1
46357455Sbostic		fi
46457455Sbostic	done
46557455Sbostic}
46657455Sbostic
46756495Sbostic# Try a variety of bucketsizes and fill factors for hashing
46856999Sbostictest20()
46956495Sbostic{
47056085Sbostic	printf\
47156999Sbostic    "Test 20: hash: bucketsize, fill factor; nelem 25000 cachesize 65536\n"
47256085Sbostic	awk 'BEGIN {
47356085Sbostic		for (i = 1; i <= 10000; ++i)
47456085Sbostic			printf("%.*s\n", i % 34,
47556085Sbostic		    "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg");
47656085Sbostic	}' > $TMP1
47756085Sbostic	sed 10000q $DICT |
47856085Sbostic	awk '{
47956085Sbostic		++i;
48056085Sbostic		printf("p\nk%s\nd%.*s\n", $0, i % 34,
48156085Sbostic		    "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg");
48256085Sbostic	}' > $TMP2
48356085Sbostic	sed 10000q $DICT |
48456085Sbostic	awk '{
48556085Sbostic		++i;
48656085Sbostic		printf("g\nk%s\n", $0);
48756085Sbostic	}' >> $TMP2
48856085Sbostic	bsize=256
48956085Sbostic	for ffactor in 11 14 21; do
490*59494Sbostic		printf "\tbucketsize %d, fill factor %d\n" $bsize $ffactor
49156495Sbostic		$PROG -o$TMP3 \
49256085Sbostic		    -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
49356085Sbostic		    hash $TMP2
49457460Sbostic		if (cmp -s $TMP1 $TMP3) ; then :
49556085Sbostic		else
49656999Sbostic			printf "test20: type hash:\
49756085Sbosticbsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed\n"
49856085Sbostic			exit 1
49956085Sbostic		fi
50056085Sbostic	done
50156085Sbostic	bsize=512
50256085Sbostic	for ffactor in 21 28 43; do
503*59494Sbostic		printf "\tbucketsize %d, fill factor %d\n" $bsize $ffactor
50456495Sbostic		$PROG -o$TMP3 \
50556085Sbostic		    -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
50656085Sbostic		    hash $TMP2
50757460Sbostic		if (cmp -s $TMP1 $TMP3) ; then :
50856085Sbostic		else
50956999Sbostic			printf "test20: type hash:\
51056085Sbosticbsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed\n"
51156085Sbostic			exit 1
51256085Sbostic		fi
51356085Sbostic	done
51456085Sbostic	bsize=1024
51556085Sbostic	for ffactor in 43 57 85; do
516*59494Sbostic		printf "\tbucketsize %d, fill factor %d\n" $bsize $ffactor
51756495Sbostic		$PROG -o$TMP3 \
51856085Sbostic		    -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
51956085Sbostic		    hash $TMP2
52057460Sbostic		if (cmp -s $TMP1 $TMP3) ; then :
52156085Sbostic		else
52256999Sbostic			printf "test20: type hash:\
52356085Sbosticbsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed\n"
52456085Sbostic			exit 1
52556085Sbostic		fi
52656085Sbostic	done
52756085Sbostic	bsize=2048
52856085Sbostic	for ffactor in 85 114 171; do
529*59494Sbostic		printf "\tbucketsize %d, fill factor %d\n" $bsize $ffactor
53056495Sbostic		$PROG -o$TMP3 \
53156085Sbostic		    -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
53256085Sbostic		    hash $TMP2
53357460Sbostic		if (cmp -s $TMP1 $TMP3) ; then :
53456085Sbostic		else
53556999Sbostic			printf "test20: type hash:\
53656085Sbosticbsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed\n"
53756085Sbostic			exit 1
53856085Sbostic		fi
53956085Sbostic	done
54056085Sbostic	bsize=4096
54156085Sbostic	for ffactor in 171 228 341; do
542*59494Sbostic		printf "\tbucketsize %d, fill factor %d\n" $bsize $ffactor
54356495Sbostic		$PROG -o$TMP3 \
54456085Sbostic		    -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
54556085Sbostic		    hash $TMP2
54657460Sbostic		if (cmp -s $TMP1 $TMP3) ; then :
54756085Sbostic		else
54856999Sbostic			printf "test20: type hash:\
54956085Sbosticbsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed\n"
55056085Sbostic			exit 1
55156085Sbostic		fi
55256085Sbostic	done
55356085Sbostic	bsize=8192
55456085Sbostic	for ffactor in 341 455 683; do
555*59494Sbostic		printf "\tbucketsize %d, fill factor %d\n" $bsize $ffactor
55656495Sbostic		$PROG -o$TMP3 \
55756085Sbostic		    -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
55856085Sbostic		    hash $TMP2
55957460Sbostic		if (cmp -s $TMP1 $TMP3) ; then :
56056085Sbostic		else
56156999Sbostic			printf "test20: type hash:\
56256085Sbosticbsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed\n"
56356085Sbostic			exit 1
56456085Sbostic		fi
56556085Sbostic	done
56656085Sbostic}
56756085Sbostic
56856038Sbosticmain
569