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