remove temporary files when the run is done
[unix-history] / usr / src / lib / libc / db / test / run.test
CommitLineData
6bba19c8
KB
1#!/bin/sh -
2#
fefde61a 3# @(#)run.test 8.5 (Berkeley) %G%
6bba19c8
KB
4#
5
6# db regression tests
6bba19c8
KB
7main()
8{
88a50bb1 9
85ec403b
KB
10DICT=/usr/share/dict/words
11#DICT=/usr/dict/words
12PROG=./dbtest
13TMP1=t1
14TMP2=t2
15TMP3=t3
6bba19c8 16
88a50bb1
KB
17 if [ $# -ge 1 ]; then
18 for i in "$*"; do
19 test$i
20 done
21 else
22 test1
23 test2
24 test3
25 test4
26 test5
27 test6
28 test7
29 test8
30 test9
31 test10
32 test11
33 test12
34 test13
35 test20
88a50bb1 36 fi
fefde61a 37 rm -f $TMP1 $TMP2 $TMP3
d3132760 38 exit 0
6bba19c8
KB
39}
40
41# Take the first hundred entries in the dictionary, and make them
42# be key/data pairs.
43test1()
44{
88a50bb1 45 echo "Test 1: btree, hash: small key, small data pairs"
2e789ad4 46 sed 200q $DICT > $TMP1
6bba19c8
KB
47 for type in btree hash; do
48 rm -f $TMP2 $TMP3
49 for i in `sed 200q $DICT`; do
88a50bb1
KB
50 echo p
51 echo k$i
52 echo d$i
53 echo g
54 echo k$i
6bba19c8 55 done > $TMP2
66d7a193 56 $PROG -o $TMP3 $type $TMP2
ed616966 57 if (cmp -s $TMP1 $TMP3) ; then :
6bba19c8 58 else
88a50bb1 59 echo "test1: type $type: failed"
6bba19c8
KB
60 exit 1
61 fi
62 done
88a50bb1 63 echo "Test 1: recno: small key, small data pairs"
6bba19c8
KB
64 rm -f $TMP2 $TMP3
65 sed 200q $DICT |
66d7a193
KB
66 awk '{
67 ++i;
68 printf("p\nk%d\nd%s\ng\nk%d\n", i, $0, i);
69 }' > $TMP2
70 $PROG -o $TMP3 recno $TMP2
ed616966 71 if (cmp -s $TMP1 $TMP3) ; then :
6bba19c8 72 else
88a50bb1 73 echo "test1: type recno: failed"
6bba19c8
KB
74 exit 1
75 fi
76}
77
08ebe458 78# Take the first 200 entries in the dictionary, and give them
6bba19c8
KB
79# each a medium size data entry.
80test2()
81{
88a50bb1 82 echo "Test 2: btree, hash: small key, medium data pairs"
6bba19c8
KB
83 mdata=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
84 echo $mdata |
66d7a193 85 awk '{ for (i = 1; i < 201; ++i) print $0 }' > $TMP1
6bba19c8
KB
86 for type in hash btree; do
87 rm -f $TMP2 $TMP3
88 for i in `sed 200q $DICT`; do
88a50bb1
KB
89 echo p
90 echo k$i
91 echo d$mdata
92 echo g
93 echo k$i
6bba19c8 94 done > $TMP2
66d7a193 95 $PROG -o $TMP3 $type $TMP2
ed616966 96 if (cmp -s $TMP1 $TMP3) ; then :
6bba19c8 97 else
88a50bb1 98 echo "test2: type $type: failed"
6bba19c8
KB
99 exit 1
100 fi
101 done
88a50bb1 102 echo "Test 2: recno: small key, medium data pairs"
6bba19c8
KB
103 rm -f $TMP2 $TMP3
104 echo $mdata |
66d7a193
KB
105 awk '{ for (i = 1; i < 201; ++i)
106 printf("p\nk%d\nd%s\ng\nk%d\n", i, $0, i);
107 }' > $TMP2
108 $PROG -o $TMP3 recno $TMP2
ed616966 109 if (cmp -s $TMP1 $TMP3) ; then :
6bba19c8 110 else
88a50bb1 111 echo "test2: type recno: failed"
6bba19c8
KB
112 exit 1
113 fi
114}
115
116# Insert the programs in /bin with their paths as their keys.
117test3()
118{
88a50bb1 119 echo "Test 3: hash: small key, big data pairs"
6bba19c8
KB
120 rm -f $TMP1
121 (find /bin -type f -print | xargs cat) > $TMP1
cbbd2236 122 for type in hash; do
6bba19c8
KB
123 rm -f $TMP2 $TMP3
124 for i in `find /bin -type f -print`; do
88a50bb1
KB
125 echo p
126 echo k$i
127 echo D$i
128 echo g
129 echo k$i
6bba19c8 130 done > $TMP2
66d7a193 131 $PROG -o $TMP3 $type $TMP2
ed616966 132 if (cmp -s $TMP1 $TMP3) ; then :
6bba19c8 133 else
88a50bb1 134 echo "test3: $type: failed"
6bba19c8
KB
135 exit 1
136 fi
137 done
88a50bb1 138 echo "Test 3: btree: small key, big data pairs"
cbbd2236 139 for psize in 512 16384 65536; do
88a50bb1 140 echo " page size $psize"
cbbd2236
KB
141 for type in btree; do
142 rm -f $TMP2 $TMP3
143 for i in `find /bin -type f -print`; do
88a50bb1
KB
144 echo p
145 echo k$i
146 echo D$i
147 echo g
148 echo k$i
cbbd2236
KB
149 done > $TMP2
150 $PROG -i psize=$psize -o $TMP3 $type $TMP2
151 if (cmp -s $TMP1 $TMP3) ; then :
152 else
88a50bb1 153 echo "test3: $type: page size $psize: failed"
cbbd2236
KB
154 exit 1
155 fi
156 done
157 done
88a50bb1 158 echo "Test 3: recno: big data pairs"
6bba19c8
KB
159 rm -f $TMP2 $TMP3
160 find /bin -type f -print |
66d7a193
KB
161 awk '{
162 ++i;
163 printf("p\nk%d\nD%s\ng\nk%d\n", i, $0, i);
164 }' > $TMP2
cbbd2236 165 for psize in 512 16384 65536; do
88a50bb1 166 echo " page size $psize"
cbbd2236
KB
167 $PROG -i psize=$psize -o $TMP3 recno $TMP2
168 if (cmp -s $TMP1 $TMP3) ; then :
169 else
88a50bb1 170 echo "test3: recno: page size $psize: failed"
cbbd2236
KB
171 exit 1
172 fi
173 done
6bba19c8
KB
174}
175
176# Do random recno entries.
177test4()
178{
88a50bb1 179 echo "Test 4: recno: random entries"
00643224 180 echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
66d7a193 181 awk '{
88a50bb1
KB
182 for (i = 37; i <= 37 + 88 * 17; i += 17) {
183 s = substr($0, 1, i % 41);
184 printf("input key %d: %s\n", i, s);
185 }
186 for (i = 1; i <= 15; ++i) {
187 s = substr($0, 1, i % 41);
188 printf("input key %d: %s\n", i, s);
189 }
190 for (i = 19234; i <= 19234 + 61 * 27; i += 27) {
191 s = substr($0, 1, i % 41);
192 printf("input key %d: %s\n", i, s);
193 }
66d7a193
KB
194 exit
195 }' > $TMP1
50485b6c 196 rm -f $TMP2 $TMP3
66d7a193
KB
197 cat $TMP1 |
198 awk 'BEGIN {
199 i = 37;
200 incr = 17;
201 }
202 {
203 printf("p\nk%d\nd%s\n", i, $0);
204 if (i == 19234 + 61 * 27)
205 exit;
206 if (i == 37 + 88 * 17) {
207 i = 1;
208 incr = 1;
209 } else if (i == 15) {
210 i = 19234;
211 incr = 27;
212 } else
213 i += incr;
214 }
215 END {
6bba19c8 216 for (i = 37; i <= 37 + 88 * 17; i += 17)
66d7a193 217 printf("g\nk%d\n", i);
6bba19c8 218 for (i = 1; i <= 15; ++i)
66d7a193 219 printf("g\nk%d\n", i);
6bba19c8 220 for (i = 19234; i <= 19234 + 61 * 27; i += 27)
66d7a193
KB
221 printf("g\nk%d\n", i);
222 }' > $TMP2
223 $PROG -o $TMP3 recno $TMP2
ed616966 224 if (cmp -s $TMP1 $TMP3) ; then :
6bba19c8 225 else
88a50bb1 226 echo "test4: type recno: failed"
6bba19c8
KB
227 exit 1
228 fi
229}
00643224
KB
230
231# Do reverse order recno entries.
232test5()
233{
88a50bb1 234 echo "Test 5: recno: reverse order entries"
00643224 235 echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
66d7a193 236 awk ' {
88a50bb1
KB
237 for (i = 1500; i; --i) {
238 s = substr($0, 1, i % 34);
239 printf("input key %d: %s\n", i, s);
240 }
66d7a193
KB
241 exit;
242 }' > $TMP1
50485b6c 243 rm -f $TMP2 $TMP3
66d7a193
KB
244 cat $TMP1 |
245 awk 'BEGIN {
246 i = 1500;
247 }
248 {
249 printf("p\nk%d\nd%s\n", i, $0);
250 --i;
251 }
252 END {
253 for (i = 1500; i; --i)
254 printf("g\nk%d\n", i);
255 }' > $TMP2
256 $PROG -o $TMP3 recno $TMP2
ed616966 257 if (cmp -s $TMP1 $TMP3) ; then :
00643224 258 else
88a50bb1 259 echo "test5: type recno: failed"
00643224
KB
260 exit 1
261 fi
262}
6bba19c8 263
00643224
KB
264# Do alternating order recno entries.
265test6()
266{
88a50bb1 267 echo "Test 6: recno: alternating order entries"
00643224 268 echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
66d7a193 269 awk ' {
88a50bb1
KB
270 for (i = 1; i < 1200; i += 2) {
271 s = substr($0, 1, i % 34);
272 printf("input key %d: %s\n", i, s);
273 }
274 for (i = 2; i < 1200; i += 2) {
275 s = substr($0, 1, i % 34);
276 printf("input key %d: %s\n", i, s);
277 }
66d7a193
KB
278 exit;
279 }' > $TMP1
88a50bb1 280 rm -f $TMP2 $TMP3
66d7a193
KB
281 cat $TMP1 |
282 awk 'BEGIN {
283 i = 1;
284 even = 0;
285 }
286 {
287 printf("p\nk%d\nd%s\n", i, $0);
288 i += 2;
289 if (i >= 1200) {
290 if (even == 1)
291 exit;
292 even = 1;
293 i = 2;
00643224 294 }
66d7a193
KB
295 }
296 END {
297 for (i = 1; i < 1200; ++i)
298 printf("g\nk%d\n", i);
299 }' > $TMP2
300 $PROG -o $TMP3 recno $TMP2
00643224
KB
301 sort -o $TMP1 $TMP1
302 sort -o $TMP3 $TMP3
ed616966 303 if (cmp -s $TMP1 $TMP3) ; then :
00643224 304 else
88a50bb1 305 echo "test6: type recno: failed"
00643224
KB
306 exit 1
307 fi
308}
309
66d7a193
KB
310# Delete cursor record
311test7()
312{
88a50bb1 313 echo "Test 7: btree, recno: delete cursor record"
66d7a193
KB
314 echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
315 awk '{
316 for (i = 1; i <= 120; ++i)
317 printf("%05d: input key %d: %s\n", i, i, $0);
318 printf("%05d: input key %d: %s\n", 120, 120, $0);
319 printf("get failed, no such key\n");
320 printf("%05d: input key %d: %s\n", 1, 1, $0);
321 printf("%05d: input key %d: %s\n", 2, 2, $0);
322 exit;
323 }' > $TMP1
88a50bb1 324 rm -f $TMP2 $TMP3
8244ba92 325
66d7a193
KB
326 for type in btree recno; do
327 cat $TMP1 |
328 awk '{
329 if (i == 120)
330 exit;
331 printf("p\nk%d\nd%s\n", ++i, $0);
332 }
333 END {
334 printf("fR_NEXT\n");
335 for (i = 1; i <= 120; ++i)
336 printf("s\n");
337 printf("fR_CURSOR\ns\nk120\n");
338 printf("r\nk120\n");
339 printf("fR_NEXT\ns\n");
340 printf("fR_CURSOR\ns\nk1\n");
341 printf("r\nk1\n");
342 printf("fR_FIRST\ns\n");
343 }' > $TMP2
344 $PROG -o $TMP3 recno $TMP2
ed616966 345 if (cmp -s $TMP1 $TMP3) ; then :
66d7a193 346 else
88a50bb1 347 echo "test7: type $type: failed"
66d7a193
KB
348 exit 1
349 fi
350 done
351}
352
ea6b8ce7 353# Make sure that overflow pages are reused.
2e789ad4 354test8()
ea6b8ce7 355{
88a50bb1 356 echo "Test 8: btree, hash: repeated small key, big data pairs"
ea6b8ce7 357 rm -f $TMP1
88a50bb1 358 echo "" |
ea6b8ce7 359 awk 'BEGIN {
c918295b 360 for (i = 1; i <= 10; ++i) {
ea6b8ce7
KB
361 printf("p\nkkey1\nD/bin/sh\n");
362 printf("p\nkkey2\nD/bin/csh\n");
5f9f1519
KB
363 if (i % 8 == 0) {
364 printf("c\nkkey2\nD/bin/csh\n");
365 printf("c\nkkey1\nD/bin/sh\n");
8244ba92 366 printf("e\t%d of 10 (comparison)\r\n", i);
5f9f1519 367 } else
8244ba92 368 printf("e\t%d of 10 \r\n", i);
ea6b8ce7
KB
369 printf("r\nkkey1\nr\nkkey2\n");
370 }
c918295b
KB
371 printf("e\n");
372 printf("eend of test8 run\n");
ea6b8ce7 373 }' > $TMP1
5f9f1519 374 $PROG btree $TMP1
88a50bb1 375# $PROG hash $TMP1
ea6b8ce7
KB
376 # No explicit test for success.
377}
378
f89ef93f
KB
379# Test btree duplicate keys
380test9()
381{
88a50bb1 382 echo "Test 9: btree: duplicate keys"
f89ef93f
KB
383 echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
384 awk '{
385 for (i = 1; i <= 543; ++i)
386 printf("%05d: input key %d: %s\n", i, i, $0);
387 exit;
388 }' > $TMP1
88a50bb1 389 rm -f $TMP2 $TMP3
f89ef93f
KB
390
391 for type in btree; do
392 cat $TMP1 |
393 awk '{
394 if (i++ % 2)
395 printf("p\nkduplicatekey\nd%s\n", $0);
396 else
397 printf("p\nkunique%dkey\nd%s\n", i, $0);
398 }
399 END {
400 printf("o\n");
401 }' > $TMP2
402 $PROG -iflags=1 -o $TMP3 $type $TMP2
403 sort -o $TMP3 $TMP3
ed616966 404 if (cmp -s $TMP1 $TMP3) ; then :
f89ef93f 405 else
88a50bb1 406 echo "test9: type $type: failed"
f89ef93f
KB
407 exit 1
408 fi
409 done
410}
411
d3132760
KB
412# Test use of cursor flags without initialization
413test10()
414{
88a50bb1 415 echo "Test 10: btree, recno: test cursor flag use"
d3132760
KB
416 echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
417 awk '{
418 for (i = 1; i <= 20; ++i)
419 printf("%05d: input key %d: %s\n", i, i, $0);
420 exit;
421 }' > $TMP1
88a50bb1 422 rm -f $TMP2 $TMP3
d3132760
KB
423
424 # Test that R_CURSOR doesn't succeed before cursor initialized
425 for type in btree recno; do
426 cat $TMP1 |
427 awk '{
428 if (i == 10)
429 exit;
430 printf("p\nk%d\nd%s\n", ++i, $0);
431 }
432 END {
433 printf("fR_CURSOR\nr\nk1\n");
434 printf("eR_CURSOR SHOULD HAVE FAILED\n");
435 }' > $TMP2
436 $PROG -o $TMP3 $type $TMP2 > /dev/null 2>&1
437 if [ -s $TMP3 ] ; then
88a50bb1 438 echo "Test 10: delete: R_CURSOR SHOULD HAVE FAILED"
d3132760
KB
439 exit 1
440 fi
441 done
442 for type in btree recno; do
443 cat $TMP1 |
444 awk '{
445 if (i == 10)
446 exit;
447 printf("p\nk%d\nd%s\n", ++i, $0);
448 }
449 END {
450 printf("fR_CURSOR\np\nk1\ndsome data\n");
451 printf("eR_CURSOR SHOULD HAVE FAILED\n");
452 }' > $TMP2
453 $PROG -o $TMP3 $type $TMP2 > /dev/null 2>&1
454 if [ -s $TMP3 ] ; then
88a50bb1 455 echo "Test 10: put: R_CURSOR SHOULD HAVE FAILED"
d3132760
KB
456 exit 1
457 fi
458 done
459}
460
461# Test insert in reverse order.
462test11()
463{
88a50bb1 464 echo "Test 11: recno: reverse order insert"
d3132760
KB
465 echo "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg" |
466 awk '{
467 for (i = 1; i <= 779; ++i)
468 printf("%05d: input key %d: %s\n", i, i, $0);
469 exit;
470 }' > $TMP1
88a50bb1 471 rm -f $TMP2 $TMP3
d3132760
KB
472
473 for type in recno; do
474 cat $TMP1 |
475 awk '{
476 if (i == 0) {
477 i = 1;
478 printf("p\nk1\nd%s\n", $0);
479 printf("%s\n", "fR_IBEFORE");
480 } else
481 printf("p\nk1\nd%s\n", $0);
482 }
483 END {
484 printf("or\n");
485 }' > $TMP2
486 $PROG -o $TMP3 $type $TMP2
ed616966 487 if (cmp -s $TMP1 $TMP3) ; then :
d3132760 488 else
88a50bb1 489 echo "test11: type $type: failed"
d3132760
KB
490 exit 1
491 fi
492 done
493}
494
08ebe458
KB
495# Take the first 20000 entries in the dictionary, reverse them, and give
496# them each a small size data entry. Use a small page size to make sure
497# the btree split code gets hammered.
498test12()
499{
88a50bb1 500 echo "Test 12: btree: lots of keys, small page size"
08ebe458
KB
501 mdata=abcdefghijklmnopqrstuvwxy
502 echo $mdata |
503 awk '{ for (i = 1; i < 20001; ++i) print $0 }' > $TMP1
504 for type in btree; do
505 rm -f $TMP2 $TMP3
506 for i in `sed 20000q $DICT | rev`; do
88a50bb1
KB
507 echo p
508 echo k$i
509 echo d$mdata
510 echo g
511 echo k$i
08ebe458
KB
512 done > $TMP2
513 $PROG -i psize=512 -o $TMP3 $type $TMP2
ed616966 514 if (cmp -s $TMP1 $TMP3) ; then :
08ebe458 515 else
88a50bb1 516 echo "test12: type $type: failed"
08ebe458
KB
517 exit 1
518 fi
519 done
520}
521
4077c34b
KB
522# Test different byte orders.
523test13()
524{
88a50bb1 525 echo "Test 13: btree, hash: differing byte orders"
4077c34b
KB
526 sed 50q $DICT > $TMP1
527 for order in 1234 4321; do
528 for type in btree hash; do
529 rm -f byte.file $TMP2 $TMP3
530 for i in `sed 50q $DICT`; do
88a50bb1
KB
531 echo p
532 echo k$i
533 echo d$i
534 echo g
535 echo k$i
4077c34b
KB
536 done > $TMP2
537 $PROG -ilorder=$order -f byte.file -o $TMP3 $type $TMP2
538 if (cmp -s $TMP1 $TMP3) ; then :
539 else
88a50bb1 540 echo "test13: $type/$order put failed"
4077c34b
KB
541 exit 1
542 fi
543 for i in `sed 50q $DICT`; do
88a50bb1
KB
544 echo g
545 echo k$i
4077c34b
KB
546 done > $TMP2
547 $PROG -ilorder=$order -f byte.file -o $TMP3 $type $TMP2
548 if (cmp -s $TMP1 $TMP3) ; then :
549 else
88a50bb1 550 echo "test13: $type/$order get failed"
4077c34b
KB
551 exit 1
552 fi
553 done
554 done
555 rm -f byte.file
556}
557
ea6b8ce7 558# Try a variety of bucketsizes and fill factors for hashing
d3132760 559test20()
2e789ad4 560{
88a50bb1
KB
561 echo\
562 "Test 20: hash: bucketsize, fill factor; nelem 25000 cachesize 65536"
2e789ad4
KB
563 awk 'BEGIN {
564 for (i = 1; i <= 10000; ++i)
565 printf("%.*s\n", i % 34,
566 "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg");
567 }' > $TMP1
568 sed 10000q $DICT |
569 awk '{
570 ++i;
571 printf("p\nk%s\nd%.*s\n", $0, i % 34,
572 "abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg");
573 }' > $TMP2
574 sed 10000q $DICT |
575 awk '{
576 ++i;
577 printf("g\nk%s\n", $0);
578 }' >> $TMP2
579 bsize=256
580 for ffactor in 11 14 21; do
88a50bb1 581 echo " bucketsize $bsize, fill factor $ffactor"
ea6b8ce7 582 $PROG -o$TMP3 \
2e789ad4
KB
583 -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
584 hash $TMP2
ed616966 585 if (cmp -s $TMP1 $TMP3) ; then :
2e789ad4 586 else
88a50bb1
KB
587 echo "test20: type hash:\
588bsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed"
2e789ad4
KB
589 exit 1
590 fi
591 done
592 bsize=512
593 for ffactor in 21 28 43; do
88a50bb1 594 echo " bucketsize $bsize, fill factor $ffactor"
ea6b8ce7 595 $PROG -o$TMP3 \
2e789ad4
KB
596 -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
597 hash $TMP2
ed616966 598 if (cmp -s $TMP1 $TMP3) ; then :
2e789ad4 599 else
88a50bb1
KB
600 echo "test20: type hash:\
601bsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed"
2e789ad4
KB
602 exit 1
603 fi
604 done
605 bsize=1024
606 for ffactor in 43 57 85; do
88a50bb1 607 echo " bucketsize $bsize, fill factor $ffactor"
ea6b8ce7 608 $PROG -o$TMP3 \
2e789ad4
KB
609 -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
610 hash $TMP2
ed616966 611 if (cmp -s $TMP1 $TMP3) ; then :
2e789ad4 612 else
88a50bb1
KB
613 echo "test20: type hash:\
614bsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed"
2e789ad4
KB
615 exit 1
616 fi
617 done
618 bsize=2048
619 for ffactor in 85 114 171; do
88a50bb1 620 echo " bucketsize $bsize, fill factor $ffactor"
ea6b8ce7 621 $PROG -o$TMP3 \
2e789ad4
KB
622 -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
623 hash $TMP2
ed616966 624 if (cmp -s $TMP1 $TMP3) ; then :
2e789ad4 625 else
88a50bb1
KB
626 echo "test20: type hash:\
627bsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed"
2e789ad4
KB
628 exit 1
629 fi
630 done
631 bsize=4096
632 for ffactor in 171 228 341; do
88a50bb1 633 echo " bucketsize $bsize, fill factor $ffactor"
ea6b8ce7 634 $PROG -o$TMP3 \
2e789ad4
KB
635 -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
636 hash $TMP2
ed616966 637 if (cmp -s $TMP1 $TMP3) ; then :
2e789ad4 638 else
88a50bb1
KB
639 echo "test20: type hash:\
640bsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed"
2e789ad4
KB
641 exit 1
642 fi
643 done
644 bsize=8192
645 for ffactor in 341 455 683; do
88a50bb1 646 echo " bucketsize $bsize, fill factor $ffactor"
ea6b8ce7 647 $PROG -o$TMP3 \
2e789ad4
KB
648 -ibsize=$bsize,ffactor=$ffactor,nelem=25000,cachesize=65536\
649 hash $TMP2
ed616966 650 if (cmp -s $TMP1 $TMP3) ; then :
2e789ad4 651 else
88a50bb1
KB
652 echo "test20: type hash:\
653bsize=$bsize ffactor=$ffactor nelem=25000 cachesize=65536 failed"
2e789ad4
KB
654 exit 1
655 fi
656 done
657}
658
88a50bb1 659main $*