Subject: Re: db-1.85

From: [email-masked] (Mark Andrews)
Date: Mon, 16 Oct 1995 13:09:01 -0400 (EDT)

> 
> I have tested your ports and it works with my test programs.
> Currently I have tested only small databases (15MB). 
> 
> But however test 12 from the db-1.85 test directory doesn't
> work! Do you have the same results running test 12. 

All tests work for me, but I had to make a few changes to the
test script and Makefile to get it working. These changes would not
have been in the files I sent you earlier. Here are the diffs:

*** db.1.85/test/Makefile       Sun Aug 28 11:42:52 1994
--- db.1.85/test/Makefile.irix  Wed Mar  1 11:52:47 1995
***************
*** 9,15 ****
  INC=  -I${PORTDIR}/include -I${PORTDIR}
  OORG= -g
  #STAT=        -DSTATISTICS
! CFLAGS=       -D__DBINTERFACE_PRIVATE -DDEBUG ${STAT} ${OORG} ${INC}
  
  dbtest: ${OBJS} ${PORTDIR}/libdb.a
        ${CC} -o $@ ${OBJS} ${PORTDIR}/libdb.a
--- 9,15 ----
  INC=  -I${PORTDIR}/include -I${PORTDIR}
  OORG= -g
  #STAT=        -DSTATISTICS
! CFLAGS=       -D__DBINTERFACE_PRIVATE -DDEBUG ${STAT} ${OORG} ${INC} -D__BIT_TYPES_DEFINED__
  
  dbtest: ${OBJS} ${PORTDIR}/libdb.a
        ${CC} -o $@ ${OBJS} ${PORTDIR}/libdb.a

*** db.1.85/test/run.test       Thu Sep  1 18:04:44 1994
--- db.1.85/test/run.test.irix  Mon Oct 16 12:43:41 1995
***************
*** 16,21 ****
--- 16,23 ----
                DICT=/usr/share/dict/words
        elif [ -f /usr/dict/words ]; then
                DICT=/usr/dict/words
+       elif [ -f /usr/share/lib/dict/words ]; then
+               DICT=/usr/share/lib/dict/words
        else
                echo 'run.test: no dictionary'
                exit 1

==========================================================================

With respect to test 12, you may not have the rev utility which is used
for that testi (run.test:540). I had to compile a version of my own to get
the tests working as it is not an IRIX utility.

The following is a diff to the 4.3BSD Net2 rev source (old/rev/rev.c
at various ftp sites):

*** rev.c       Mon Mar 23 11:57:00 1992
--- /u/mandrews/src/BSD/db/db.1.85/test/rev.c   Mon Oct 16 12:58:26 1995
***************
*** 46,54 ****
--- 46,56 ----
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
+ #include "cdefs.h"
  
  void usage __P((void));
  void warn __P((const char *, ...));
+ char *fgetline __P((FILE *, size_t *));
  
  int
  main(argc, argv)
***************
*** 130,133 ****
--- 132,149 ----
  {
        (void)fprintf(stderr, "usage: rev [file ...]\n");
        exit(1);
+ }
+ 
+ char *
+ fgetline(FILE *fp, size_t *n)
+ {
+     static char buf[BUFSIZ];
+ 
+     if ((fgets(buf, BUFSIZ, fp)) == NULL)
+         *n = 0;
+     else {
+         *n = strlen(buf) - 1;
+         buf[(*n)] = '\0';
+     }
+     return(*n == 0 ? (char *)NULL : buf);
  }

If you place the patched source in db.1.85/test, the compile/link line is:

    cc -O -I ../PORT/include rev.c -o rev

Once you have the executable, make sure it is on your command search path
so that the tests can find it.

FYI, here's the output of the tests:

Test 1: btree, hash: small key, small data pairs
Test 1: recno: small key, small data pairs
Test 2: btree, hash: small key, medium data pairs
Test 2: recno: small key, medium data pairs
Test 3: hash: small key, big data pairs
Test 3: btree: small key, big data pairs
    page size 512
    page size 16384
    page size 65536
Test 3: recno: big data pairs
    page size 512
    page size 16384
    page size 65536
Test 4: recno: random entries
Test 5: recno: reverse order entries
Test 6: recno: alternating order entries
Test 7: btree, recno: delete cursor record
Test 8: btree, hash: repeated small key, big data pairs
        1 of 10             
        2 of 10             
        3 of 10             
        4 of 10             
        5 of 10             
        6 of 10             
        7 of 10             
        8 of 10 (comparison)
        9 of 10             
        10 of 10             
Test 9: btree: duplicate keys
Test 10: btree, recno: test cursor flag use
Test 11: recno: reverse order insert
Test 12: btree: lots of keys, small page size
Test 13: btree, hash: differing byte orders
Test 20: hash: bucketsize, fill factor; nelem 25000 cachesize 65536
    bucketsize 256, fill factor 11
    bucketsize 256, fill factor 14
    bucketsize 256, fill factor 21
    bucketsize 512, fill factor 21
    bucketsize 512, fill factor 28
    bucketsize 512, fill factor 43
    bucketsize 1024, fill factor 43
    bucketsize 1024, fill factor 57
    bucketsize 1024, fill factor 85
    bucketsize 2048, fill factor 85
    bucketsize 2048, fill factor 114
    bucketsize 2048, fill factor 171
    bucketsize 4096, fill factor 171
    bucketsize 4096, fill factor 228
    bucketsize 4096, fill factor 341
    bucketsize 8192, fill factor 341
    bucketsize 8192, fill factor 455
    bucketsize 8192, fill factor 683

If you continue to have trouble, let me know.