xref: /csrg-svn/lib/libc/db/test/run.test (revision 57001)
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*57001Sbostic#	@(#)run.test	5.12 (Berkeley) 12/04/92
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
29*57001Sbostic	test9
3056765Sbostic	test10
3156999Sbostic	test11
3256999Sbostic	test20
3356038Sbostic	rm -f $TMP1 $TMP2 $TMP3
3456999Sbostic	exit 0
3556038Sbostic}
3656038Sbostic
3756038Sbostic# Take the first hundred entries in the dictionary, and make them
3856038Sbostic# be key/data pairs.
3956038Sbostictest1()
4056038Sbostic{
4156050Sbostic	printf "Test 1: btree, hash: small key, small data pairs\n"
4256085Sbostic	sed 200q $DICT > $TMP1
4356038Sbostic	for type in btree hash; do
4456038Sbostic		rm -f $TMP2 $TMP3
4556038Sbostic		for i in `sed 200q $DICT`; do
4656038Sbostic			printf "p\nk%s\nd%s\ng\nk%s\n" $i $i $i
4756038Sbostic		done > $TMP2
4856058Sbostic		$PROG -o $TMP3 $type $TMP2
4956038Sbostic		if (cmp -s $TMP1 $TMP3) ; then
5056038Sbostic		else
5156038Sbostic			printf "test1: type %s: failed\n" $type
5256038Sbostic			exit 1
5356038Sbostic		fi
5456038Sbostic	done
5556050Sbostic	printf "Test 1: recno: small key, small data pairs\n"
5656038Sbostic	rm -f $TMP2 $TMP3
5756038Sbostic	sed 200q $DICT |
5856058Sbostic	awk '{
5956058Sbostic		++i;
6056058Sbostic		printf("p\nk%d\nd%s\ng\nk%d\n", i, $0, i);
6156058Sbostic	}' > $TMP2
6256058Sbostic	$PROG -o $TMP3 recno $TMP2
6356038Sbostic	if (cmp -s $TMP1 $TMP3) ; then
6456038Sbostic	else
6556038Sbostic		printf "test1: type recno: failed\n"
6656038Sbostic		exit 1
6756038Sbostic	fi
6856038Sbostic}
6956038Sbostic
7056038Sbostic# Take the first hundred entries in the dictionary, and give them
7156038Sbostic# each a medium size data entry.
7256038Sbostictest2()
7356038Sbostic{
7456050Sbostic	printf "Test 2: btree, hash: small key, medium data pairs\n"
7556038Sbostic	mdata=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
7656038Sbostic	echo $mdata |
7756058Sbostic	awk '{ for (i = 1; i < 201; ++i) print $0 }' > $TMP1
7856038Sbostic	for type in hash btree; do
7956038Sbostic		rm -f $TMP2 $TMP3
8056038Sbostic		for i in `sed 200q $DICT`; do
8156038Sbostic			printf "p\nk%s\nd%s\ng\nk%s\n" $i $mdata $i
8256038Sbostic		done > $TMP2
8356058Sbostic		$PROG -o $TMP3 $type $TMP2
8456038Sbostic		if (cmp -s $TMP1 $TMP3) ; then
8556038Sbostic		else
8656038Sbostic			printf "test2: type %s: failed\n" $type
8756038Sbostic			exit 1
8856038Sbostic		fi
8956038Sbostic	done
9056050Sbostic	printf "Test 2: recno: small key, medium data pairs\n"
9156038Sbostic	rm -f $TMP2 $TMP3
9256038Sbostic	echo $mdata |
9356058Sbostic	awk '{  for (i = 1; i < 201; ++i)
9456058Sbostic		printf("p\nk%d\nd%s\ng\nk%d\n", i, $0, i);
9556058Sbostic	}' > $TMP2
9656058Sbostic	$PROG -o $TMP3 recno $TMP2
9756038Sbostic	if (cmp -s $TMP1 $TMP3) ; then
9856038Sbostic	else
9956038Sbostic		printf "test2: type recno: failed\n"
10056038Sbostic		exit 1
10156038Sbostic	fi
10256038Sbostic}
10356038Sbostic
10456038Sbostic# Insert the programs in /bin with their paths as their keys.
10556038Sbostictest3()
10656038Sbostic{
10756050Sbostic	printf "Test 3: btree, hash: small key, big data pairs\n"
10856038Sbostic	rm -f $TMP1
10956038Sbostic	(find /bin -type f -print | xargs cat) > $TMP1
11056038Sbostic	for type in hash btree; do
11156038Sbostic		rm -f $TMP2 $TMP3
11256038Sbostic		for i in `find /bin -type f -print`; do
11356038Sbostic			printf "p\nk%s\nD%s\ng\nk%s\n" $i $i $i
11456038Sbostic		done > $TMP2
11556058Sbostic		$PROG -o $TMP3 $type $TMP2
11656038Sbostic		if (cmp -s $TMP1 $TMP3) ; then
11756038Sbostic		else
11856385Sbostic			printf "test3: type %s: failed\n" $type
11956038Sbostic			exit 1
12056038Sbostic		fi
12156038Sbostic	done
12256050Sbostic	printf "Test 3: recno: big data pairs\n"
12356038Sbostic	rm -f $TMP2 $TMP3
12456038Sbostic	find /bin -type f -print |
12556058Sbostic	awk '{
12656058Sbostic		++i;
12756058Sbostic		printf("p\nk%d\nD%s\ng\nk%d\n", i, $0, i);
12856058Sbostic	}' > $TMP2
12956058Sbostic	$PROG -o $TMP3 recno $TMP2
13056038Sbostic	if (cmp -s $TMP1 $TMP3) ; then
13156038Sbostic	else
13256038Sbostic		printf "test3: type recno: failed\n"
13356038Sbostic		exit 1
13456038Sbostic	fi
13556038Sbostic}
13656038Sbostic
13756038Sbostic# Do random recno entries.
13856038Sbostictest4()
13956038Sbostic{
14056050Sbostic	printf "Test 4: recno: random entries\n"
14156050Sbostic	echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
14256058Sbostic	awk '{
14356058Sbostic		for (i = 37; i <= 37 + 88 * 17; i += 17)
14456058Sbostic			printf("input key %d: %.*s\n", i, i % 41, $0);
14556058Sbostic		for (i = 1; i <= 15; ++i)
14656058Sbostic			printf("input key %d: %.*s\n", i, i % 41, $0);
14756058Sbostic		for (i = 19234; i <= 19234 + 61 * 27; i += 27)
14856058Sbostic			printf("input key %d: %.*s\n", i, i % 41, $0);
14956058Sbostic		exit
15056058Sbostic	}' > $TMP1
15156058Sbostic	rm -f TMP2 $TMP3
15256058Sbostic	cat $TMP1 |
15356058Sbostic	awk 'BEGIN {
15456058Sbostic			i = 37;
15556058Sbostic			incr = 17;
15656058Sbostic		}
15756058Sbostic		{
15856058Sbostic			printf("p\nk%d\nd%s\n", i, $0);
15956058Sbostic			if (i == 19234 + 61 * 27)
16056058Sbostic				exit;
16156058Sbostic			if (i == 37 + 88 * 17) {
16256058Sbostic				i = 1;
16356058Sbostic				incr = 1;
16456058Sbostic			} else if (i == 15) {
16556058Sbostic				i = 19234;
16656058Sbostic				incr = 27;
16756058Sbostic			} else
16856058Sbostic				i += incr;
16956058Sbostic		}
17056058Sbostic		END {
17156038Sbostic			for (i = 37; i <= 37 + 88 * 17; i += 17)
17256058Sbostic				printf("g\nk%d\n", i);
17356038Sbostic			for (i = 1; i <= 15; ++i)
17456058Sbostic				printf("g\nk%d\n", i);
17556038Sbostic			for (i = 19234; i <= 19234 + 61 * 27; i += 27)
17656058Sbostic				printf("g\nk%d\n", i);
17756058Sbostic		}' > $TMP2
17856058Sbostic	$PROG -o $TMP3 recno $TMP2
17956038Sbostic	if (cmp -s $TMP1 $TMP3) ; then
18056038Sbostic	else
18156038Sbostic		printf "test4: type recno: failed\n"
18256038Sbostic		exit 1
18356038Sbostic	fi
18456038Sbostic}
18556050Sbostic
18656050Sbostic# Do reverse order recno entries.
18756050Sbostictest5()
18856050Sbostic{
18956050Sbostic	printf "Test 5: recno: reverse order entries\n"
19056050Sbostic	echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
19156058Sbostic	awk ' {
19256058Sbostic		for (i = 1500; i; --i)
19356058Sbostic			printf("input key %d: %.*s\n", i, i % 34, $0);
19456058Sbostic		exit;
19556058Sbostic	}' > $TMP1
19656050Sbostic	rm -f TMP2 $TMP3
19756058Sbostic	cat $TMP1 |
19856058Sbostic	awk 'BEGIN {
19956058Sbostic			i = 1500;
20056058Sbostic		}
20156058Sbostic		{
20256058Sbostic			printf("p\nk%d\nd%s\n", i, $0);
20356058Sbostic			--i;
20456058Sbostic		}
20556058Sbostic		END {
20656058Sbostic			for (i = 1500; i; --i)
20756058Sbostic				printf("g\nk%d\n", i);
20856058Sbostic		}' > $TMP2
20956058Sbostic	$PROG -o $TMP3 recno $TMP2
21056050Sbostic	if (cmp -s $TMP1 $TMP3) ; then
21156050Sbostic	else
21256050Sbostic		printf "test5: type recno: failed\n"
21356050Sbostic		exit 1
21456050Sbostic	fi
21556050Sbostic}
21656038Sbostic
21756050Sbostic# Do alternating order recno entries.
21856050Sbostictest6()
21956050Sbostic{
22056050Sbostic	printf "Test 6: recno: alternating order entries\n"
22156050Sbostic	echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
22256058Sbostic	awk ' {
22356058Sbostic		for (i = 1; i < 1200; i += 2)
22456058Sbostic			printf("input key %d: %.*s\n", i, i % 34, $0);
22556058Sbostic		for (i = 2; i < 1200; i += 2)
22656058Sbostic			printf("input key %d: %.*s\n", i, i % 34, $0);
22756058Sbostic		exit;
22856058Sbostic	}' > $TMP1
22956050Sbostic	rm -f TMP2 $TMP3
23056058Sbostic	cat $TMP1 |
23156058Sbostic	awk 'BEGIN {
23256058Sbostic			i = 1;
23356058Sbostic			even = 0;
23456058Sbostic		}
23556058Sbostic		{
23656058Sbostic			printf("p\nk%d\nd%s\n", i, $0);
23756058Sbostic			i += 2;
23856058Sbostic			if (i >= 1200) {
23956058Sbostic				if (even == 1)
24056058Sbostic					exit;
24156058Sbostic				even = 1;
24256058Sbostic				i = 2;
24356050Sbostic			}
24456058Sbostic		}
24556058Sbostic		END {
24656058Sbostic			for (i = 1; i < 1200; ++i)
24756058Sbostic				printf("g\nk%d\n", i);
24856058Sbostic		}' > $TMP2
24956058Sbostic	$PROG -o $TMP3 recno $TMP2
25056050Sbostic	sort -o $TMP1 $TMP1
25156050Sbostic	sort -o $TMP3 $TMP3
25256050Sbostic	if (cmp -s $TMP1 $TMP3) ; then
25356050Sbostic	else
25456050Sbostic		printf "test6: type recno: failed\n"
25556050Sbostic		exit 1
25656050Sbostic	fi
25756050Sbostic}
25856050Sbostic
25956058Sbostic# Delete cursor record
26056058Sbostictest7()
26156058Sbostic{
26256058Sbostic	printf "Test 7: btree, recno: delete cursor record\n"
26356058Sbostic	echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
26456058Sbostic	awk '{
26556058Sbostic		for (i = 1; i <= 120; ++i)
26656058Sbostic			printf("%05d: input key %d: %s\n", i, i, $0);
26756058Sbostic		printf("%05d: input key %d: %s\n", 120, 120, $0);
26856058Sbostic		printf("get failed, no such key\n");
26956058Sbostic		printf("%05d: input key %d: %s\n", 1, 1, $0);
27056058Sbostic		printf("%05d: input key %d: %s\n", 2, 2, $0);
27156058Sbostic		exit;
27256058Sbostic	}' > $TMP1
27356058Sbostic	rm -f TMP2 $TMP3
27456763Sbostic
27556058Sbostic	for type in btree recno; do
27656058Sbostic		cat $TMP1 |
27756058Sbostic		awk '{
27856058Sbostic			if (i == 120)
27956058Sbostic				exit;
28056058Sbostic			printf("p\nk%d\nd%s\n", ++i, $0);
28156058Sbostic		}
28256058Sbostic		END {
28356058Sbostic			printf("fR_NEXT\n");
28456058Sbostic			for (i = 1; i <= 120; ++i)
28556058Sbostic				printf("s\n");
28656058Sbostic			printf("fR_CURSOR\ns\nk120\n");
28756058Sbostic			printf("r\nk120\n");
28856058Sbostic			printf("fR_NEXT\ns\n");
28956058Sbostic			printf("fR_CURSOR\ns\nk1\n");
29056058Sbostic			printf("r\nk1\n");
29156058Sbostic			printf("fR_FIRST\ns\n");
29256058Sbostic		}' > $TMP2
29356058Sbostic		$PROG -o $TMP3 recno $TMP2
29456058Sbostic		if (cmp -s $TMP1 $TMP3) ; then
29556058Sbostic		else
29656058Sbostic			printf "test7: type $type: failed\n"
29756058Sbostic			exit 1
29856058Sbostic		fi
29956058Sbostic	done
30056058Sbostic}
30156058Sbostic
30256495Sbostic# Make sure that overflow pages are reused.
30356085Sbostictest8()
30456085Sbostic{
30556495Sbostic	printf "Test 8: btree, hash: repeated small key, big data pairs\n"
30656495Sbostic	rm -f $TMP1
30756495Sbostic	awk 'BEGIN {
30856556Sbostic		for (i = 1; i <= 10; ++i) {
30956495Sbostic			printf("p\nkkey1\nD/bin/sh\n");
31056495Sbostic			printf("p\nkkey2\nD/bin/csh\n");
31156554Sbostic			if (i % 8 == 0) {
31256554Sbostic				printf("c\nkkey2\nD/bin/csh\n");
31356554Sbostic				printf("c\nkkey1\nD/bin/sh\n");
31456763Sbostic				printf("e\t%d of 10 (comparison)\r\n", i);
31556554Sbostic			} else
31656763Sbostic				printf("e\t%d of 10             \r\n", i);
31756495Sbostic			printf("r\nkkey1\nr\nkkey2\n");
31856495Sbostic		}
31956556Sbostic		printf("e\n");
32056556Sbostic		printf("eend of test8 run\n");
32156495Sbostic	}' > $TMP1
32256554Sbostic	$PROG btree $TMP1
32356554Sbostic	$PROG hash $TMP1
32456495Sbostic	# No explicit test for success.
32556495Sbostic}
32656495Sbostic
327*57001Sbostic# Test btree duplicate keys
328*57001Sbostictest9()
329*57001Sbostic{
330*57001Sbostic	printf "Test 9: btree: duplicate keys\n"
331*57001Sbostic	echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
332*57001Sbostic	awk '{
333*57001Sbostic		for (i = 1; i <= 543; ++i)
334*57001Sbostic			printf("%05d: input key %d: %s\n", i, i, $0);
335*57001Sbostic		exit;
336*57001Sbostic	}' > $TMP1
337*57001Sbostic	rm -f TMP2 $TMP3
338*57001Sbostic
339*57001Sbostic	for type in btree; do
340*57001Sbostic		cat $TMP1 |
341*57001Sbostic		awk '{
342*57001Sbostic			if (i++ % 2)
343*57001Sbostic				printf("p\nkduplicatekey\nd%s\n", $0);
344*57001Sbostic			else
345*57001Sbostic				printf("p\nkunique%dkey\nd%s\n", i, $0);
346*57001Sbostic		}
347*57001Sbostic		END {
348*57001Sbostic				printf("o\n");
349*57001Sbostic		}' > $TMP2
350*57001Sbostic		$PROG -iflags=1 -o $TMP3 $type $TMP2
351*57001Sbostic		sort -o $TMP3 $TMP3
352*57001Sbostic		if (cmp -s $TMP1 $TMP3) ; then
353*57001Sbostic		else
354*57001Sbostic			printf "test9: type $type: failed\n"
355*57001Sbostic			exit 1
356*57001Sbostic		fi
357*57001Sbostic	done
358*57001Sbostic}
359*57001Sbostic
36056999Sbostic# Test use of cursor flags without initialization
36156999Sbostictest10()
36256999Sbostic{
36356999Sbostic	printf "Test 10: btree, recno: test cursor flag use\n"
36456999Sbostic	echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
36556999Sbostic	awk '{
36656999Sbostic		for (i = 1; i <= 20; ++i)
36756999Sbostic			printf("%05d: input key %d: %s\n", i, i, $0);
36856999Sbostic		exit;
36956999Sbostic	}' > $TMP1
37056999Sbostic	rm -f TMP2 $TMP3
37156999Sbostic
37256999Sbostic	# Test that R_CURSOR doesn't succeed before cursor initialized
37356999Sbostic	for type in btree recno; do
37456999Sbostic		cat $TMP1 |
37556999Sbostic		awk '{
37656999Sbostic			if (i == 10)
37756999Sbostic				exit;
37856999Sbostic			printf("p\nk%d\nd%s\n", ++i, $0);
37956999Sbostic		}
38056999Sbostic		END {
38156999Sbostic			printf("fR_CURSOR\nr\nk1\n");
38256999Sbostic			printf("eR_CURSOR SHOULD HAVE FAILED\n");
38356999Sbostic		}' > $TMP2
38456999Sbostic		$PROG -o $TMP3 $type $TMP2 > /dev/null 2>&1
38556999Sbostic		if [ -s $TMP3 ] ; then
38656999Sbostic			printf "Test 10: delete: R_CURSOR SHOULD HAVE FAILED\n"
38756999Sbostic			exit 1
38856999Sbostic		fi
38956999Sbostic	done
39056999Sbostic	for type in btree recno; do
39156999Sbostic		cat $TMP1 |
39256999Sbostic		awk '{
39356999Sbostic			if (i == 10)
39456999Sbostic				exit;
39556999Sbostic			printf("p\nk%d\nd%s\n", ++i, $0);
39656999Sbostic		}
39756999Sbostic		END {
39856999Sbostic			printf("fR_CURSOR\np\nk1\ndsome data\n");
39956999Sbostic			printf("eR_CURSOR SHOULD HAVE FAILED\n");
40056999Sbostic		}' > $TMP2
40156999Sbostic		$PROG -o $TMP3 $type $TMP2 > /dev/null 2>&1
40256999Sbostic		if [ -s $TMP3 ] ; then
40356999Sbostic			printf "Test 10: put: R_CURSOR SHOULD HAVE FAILED\n"
40456999Sbostic			exit 1
40556999Sbostic		fi
40656999Sbostic	done
40756999Sbostic}
40856999Sbostic
40956999Sbostic# Test insert in reverse order.
41056999Sbostictest11()
41156999Sbostic{
41256999Sbostic	printf "Test 11: recno: reverse order insert\n"
41356999Sbostic	echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
41456999Sbostic	awk '{
41556999Sbostic		for (i = 1; i <= 779; ++i)
41656999Sbostic			printf("%05d: input key %d: %s\n", i, i, $0);
41756999Sbostic		exit;
41856999Sbostic	}' > $TMP1
41956999Sbostic	rm -f TMP2 $TMP3
42056999Sbostic
42156999Sbostic	for type in recno; do
42256999Sbostic		cat $TMP1 |
42356999Sbostic		awk '{
42456999Sbostic			if (i == 0) {
42556999Sbostic				i = 1;
42656999Sbostic				printf("p\nk1\nd%s\n", $0);
42756999Sbostic				printf("%s\n", "fR_IBEFORE");
42856999Sbostic			} else
42956999Sbostic				printf("p\nk1\nd%s\n", $0);
43056999Sbostic		}
43156999Sbostic		END {
43256999Sbostic				printf("or\n");
43356999Sbostic		}' > $TMP2
43456999Sbostic		$PROG -o $TMP3 $type $TMP2
43556999Sbostic		if (cmp -s $TMP1 $TMP3) ; then
43656999Sbostic		else
43756999Sbostic			printf "test11: type $type: failed\n"
43856999Sbostic			exit 1
43956999Sbostic		fi
44056999Sbostic	done
44156999Sbostic}
44256999Sbostic
44356495Sbostic# Try a variety of bucketsizes and fill factors for hashing
44456999Sbostictest20()
44556495Sbostic{
44656085Sbostic	printf\
44756999Sbostic    "Test 20: hash: bucketsize, fill factor; nelem 25000 cachesize 65536\n"
44856085Sbostic	awk 'BEGIN {
44956085Sbostic		for (i = 1; i <= 10000; ++i)
45056085Sbostic			printf("%.*s\n", i % 34,
45156085Sbostic		    "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg");
45256085Sbostic	}' > $TMP1
45356085Sbostic	sed 10000q $DICT |
45456085Sbostic	awk '{
45556085Sbostic		++i;
45656085Sbostic		printf("p\nk%s\nd%.*s\n", $0, i % 34,
45756085Sbostic		    "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg");
45856085Sbostic	}' > $TMP2
45956085Sbostic	sed 10000q $DICT |
46056085Sbostic	awk '{
46156085Sbostic		++i;
46256085Sbostic		printf("g\nk%s\n", $0);
46356085Sbostic	}' >> $TMP2
46456085Sbostic	bsize=256
46556085Sbostic	for ffactor in 11 14 21; do
46656085Sbostic		printf "\tbucketsize %d, fill factor %d\n" $bsize, $ffactor
46756495Sbostic		$PROG -o$TMP3 \
46856085Sbostic		    -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
46956085Sbostic		    hash $TMP2
47056085Sbostic		if (cmp -s $TMP1 $TMP3) ; then
47156085Sbostic		else
47256999Sbostic			printf "test20: type hash:\
47356085Sbosticbsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed\n"
47456085Sbostic			exit 1
47556085Sbostic		fi
47656085Sbostic	done
47756085Sbostic	bsize=512
47856085Sbostic	for ffactor in 21 28 43; do
47956085Sbostic		printf "\tbucketsize %d, fill factor %d\n" $bsize, $ffactor
48056495Sbostic		$PROG -o$TMP3 \
48156085Sbostic		    -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
48256085Sbostic		    hash $TMP2
48356085Sbostic		if (cmp -s $TMP1 $TMP3) ; then
48456085Sbostic		else
48556999Sbostic			printf "test20: type hash:\
48656085Sbosticbsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed\n"
48756085Sbostic			exit 1
48856085Sbostic		fi
48956085Sbostic	done
49056085Sbostic	bsize=1024
49156085Sbostic	for ffactor in 43 57 85; do
49256085Sbostic		printf "\tbucketsize %d, fill factor %d\n" $bsize, $ffactor
49356495Sbostic		$PROG -o$TMP3 \
49456085Sbostic		    -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
49556085Sbostic		    hash $TMP2
49656085Sbostic		if (cmp -s $TMP1 $TMP3) ; then
49756085Sbostic		else
49856999Sbostic			printf "test20: type hash:\
49956085Sbosticbsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed\n"
50056085Sbostic			exit 1
50156085Sbostic		fi
50256085Sbostic	done
50356085Sbostic	bsize=2048
50456085Sbostic	for ffactor in 85 114 171; do
50556085Sbostic		printf "\tbucketsize %d, fill factor %d\n" $bsize, $ffactor
50656495Sbostic		$PROG -o$TMP3 \
50756085Sbostic		    -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
50856085Sbostic		    hash $TMP2
50956085Sbostic		if (cmp -s $TMP1 $TMP3) ; then
51056085Sbostic		else
51156999Sbostic			printf "test20: type hash:\
51256085Sbosticbsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed\n"
51356085Sbostic			exit 1
51456085Sbostic		fi
51556085Sbostic	done
51656085Sbostic	bsize=4096
51756085Sbostic	for ffactor in 171 228 341; do
51856085Sbostic		printf "\tbucketsize %d, fill factor %d\n" $bsize, $ffactor
51956495Sbostic		$PROG -o$TMP3 \
52056085Sbostic		    -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
52156085Sbostic		    hash $TMP2
52256085Sbostic		if (cmp -s $TMP1 $TMP3) ; then
52356085Sbostic		else
52456999Sbostic			printf "test20: type hash:\
52556085Sbosticbsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed\n"
52656085Sbostic			exit 1
52756085Sbostic		fi
52856085Sbostic	done
52956085Sbostic	bsize=8192
53056085Sbostic	for ffactor in 341 455 683; do
53156085Sbostic		printf "\tbucketsize %d, fill factor %d\n" $bsize, $ffactor
53256495Sbostic		$PROG -o$TMP3 \
53356085Sbostic		    -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
53456085Sbostic		    hash $TMP2
53556085Sbostic		if (cmp -s $TMP1 $TMP3) ; then
53656085Sbostic		else
53756999Sbostic			printf "test20: type hash:\
53856085Sbosticbsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed\n"
53956085Sbostic			exit 1
54056085Sbostic		fi
54156085Sbostic	done
54256085Sbostic}
54356085Sbostic
54456038Sbosticmain
545