summaryrefslogtreecommitdiff
path: root/src/regress/lib/libc/db/run.test
diff options
context:
space:
mode:
Diffstat (limited to 'src/regress/lib/libc/db/run.test')
-rw-r--r--src/regress/lib/libc/db/run.test35
1 files changed, 21 insertions, 14 deletions
diff --git a/src/regress/lib/libc/db/run.test b/src/regress/lib/libc/db/run.test
index 4073310a31..acbd3f49e1 100644
--- a/src/regress/lib/libc/db/run.test
+++ b/src/regress/lib/libc/db/run.test
@@ -1,19 +1,27 @@
1#!/bin/sh - 1#!/bin/sh -
2# $NetBSD: run.test,v 1.7 1995/04/20 22:39:27 cgd Exp $
3# 2#
4# @(#)run.test 8.8 (Berkeley) 6/16/94 3# $NetBSD: run.test,v 1.8 1996/05/03 21:57:51 cgd Exp $
4# @(#)run.test 8.10 (Berkeley) 7/26/94
5# 5#
6 6
7# db regression tests 7# db regression tests
8main() 8main()
9{ 9{
10 10
11DICT=/usr/share/dict/web2 11 PROG=./dbtest
12PROG=./dbtest 12 TMP1=t1
13TMP1=t1 13 TMP2=t2
14TMP2=t2 14 TMP3=t3
15TMP3=t3
16 15
16 if [ -f /usr/share/dict/words ]; then
17 DICT=/usr/share/dict/words
18 elif [ -f /usr/dict/words ]; then
19 DICT=/usr/dict/words
20 else
21 echo 'run.test: no dictionary'
22 exit 1
23 fi
24
17 if [ $# -eq 0 ]; then 25 if [ $# -eq 0 ]; then
18 for t in 1 2 3 4 5 6 7 8 9 10 11 12 13 20; do 26 for t in 1 2 3 4 5 6 7 8 9 10 11 12 13 20; do
19 test$t 27 test$t
@@ -345,7 +353,7 @@ test7()
345 for (i = 1; i <= 120; ++i) 353 for (i = 1; i <= 120; ++i)
346 printf("%05d: input key %d: %s\n", i, i, $0); 354 printf("%05d: input key %d: %s\n", i, i, $0);
347 printf("%05d: input key %d: %s\n", 120, 120, $0); 355 printf("%05d: input key %d: %s\n", 120, 120, $0);
348 printf("get failed, no such key\n"); 356 printf("seq failed, no such key\n");
349 printf("%05d: input key %d: %s\n", 1, 1, $0); 357 printf("%05d: input key %d: %s\n", 1, 1, $0);
350 printf("%05d: input key %d: %s\n", 2, 2, $0); 358 printf("%05d: input key %d: %s\n", 2, 2, $0);
351 exit; 359 exit;
@@ -364,10 +372,10 @@ test7()
364 for (i = 1; i <= 120; ++i) 372 for (i = 1; i <= 120; ++i)
365 printf("s\n"); 373 printf("s\n");
366 printf("fR_CURSOR\ns\nk120\n"); 374 printf("fR_CURSOR\ns\nk120\n");
367 printf("r\nk120\n"); 375 printf("r\n");
368 printf("fR_NEXT\ns\n"); 376 printf("fR_NEXT\ns\n");
369 printf("fR_CURSOR\ns\nk1\n"); 377 printf("fR_CURSOR\ns\nk1\n");
370 printf("r\nk1\n"); 378 printf("r\n");
371 printf("fR_FIRST\ns\n"); 379 printf("fR_FIRST\ns\n");
372 }' > $TMP2 380 }' > $TMP2
373 $PROG -o $TMP3 recno $TMP2 381 $PROG -o $TMP3 recno $TMP2
@@ -397,8 +405,6 @@ test8()
397 printf("e\t%d of 10 \n", i); 405 printf("e\t%d of 10 \n", i);
398 printf("r\nkkey1\nr\nkkey2\n"); 406 printf("r\nkkey1\nr\nkkey2\n");
399 } 407 }
400 printf("e\n");
401 printf("eend of test8 run\n");
402 }' > $TMP1 408 }' > $TMP1
403 $PROG btree $TMP1 409 $PROG btree $TMP1
404# $PROG hash $TMP1 410# $PROG hash $TMP1
@@ -459,7 +465,7 @@ test10()
459 printf("p\nk%d\nd%s\n", ++i, $0); 465 printf("p\nk%d\nd%s\n", ++i, $0);
460 } 466 }
461 END { 467 END {
462 printf("fR_CURSOR\nr\nk1\n"); 468 printf("fR_CURSOR\nr\n");
463 printf("eR_CURSOR SHOULD HAVE FAILED\n"); 469 printf("eR_CURSOR SHOULD HAVE FAILED\n");
464 }' > $TMP2 470 }' > $TMP2
465 $PROG -o $TMP3 $type $TMP2 > /dev/null 2>&1 471 $PROG -o $TMP3 $type $TMP2 > /dev/null 2>&1
@@ -573,7 +579,8 @@ test13()
573 echo g 579 echo g
574 echo k$i 580 echo k$i
575 done > $TMP2 581 done > $TMP2
576 $PROG -ilorder=$order -f byte.file -o $TMP3 $type $TMP2 582 $PROG -s \
583 -ilorder=$order -f byte.file -o $TMP3 $type $TMP2
577 if (cmp -s $TMP1 $TMP3) ; then : 584 if (cmp -s $TMP1 $TMP3) ; then :
578 else 585 else
579 echo "test13: $type/$order get failed" 586 echo "test13: $type/$order get failed"