You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2004/02/16 16:54:50 UTC

cvs commit: apr-util/test Makefile.in testdbm.c

jorton      2004/02/16 07:54:50

  Modified:    dbm      apr_dbm_sdbm.c
               test     Makefile.in testdbm.c
  Log:
  * dbm/apr_dbm_sdbm.c (vt_sdbm_exists): Fix (size_t *) -> (int *) casts
  missed in earlier fix for PR 14861. (broken only on bigendian LP64
  platforms)
  
  * test/testdb.c (doit): Add regression test.
  
  * test/Makefile.in: Link test programs using -no-install.
  
  Revision  Changes    Path
  1.12      +4 -2      apr-util/dbm/apr_dbm_sdbm.c
  
  Index: apr_dbm_sdbm.c
  ===================================================================
  RCS file: /home/cvs/apr-util/dbm/apr_dbm_sdbm.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -b -d -u -r1.11 -r1.12
  --- apr_dbm_sdbm.c	13 Feb 2004 09:55:25 -0000	1.11
  +++ apr_dbm_sdbm.c	16 Feb 2004 15:54:50 -0000	1.12
  @@ -179,11 +179,13 @@
   static int vt_sdbm_exists(apr_dbm_t *dbm, apr_datum_t key)
   {
       int exists;
  -    apr_sdbm_datum_t *ckey = (apr_sdbm_datum_t *)&key;
  +    apr_sdbm_datum_t ckey;
  +
  +    CONVERT_DATUM(ckey, &key);
   
       {
           apr_sdbm_datum_t value;
  -        if (apr_sdbm_fetch(dbm->file, &value, *ckey) != APR_SUCCESS) {
  +        if (apr_sdbm_fetch(dbm->file, &value, ckey) != APR_SUCCESS) {
               exists = 0;
           }
           else
  
  
  
  1.38      +1 -1      apr-util/test/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/apr-util/test/Makefile.in,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -b -d -u -r1.37 -r1.38
  --- Makefile.in	28 May 2003 04:45:46 -0000	1.37
  +++ Makefile.in	16 Feb 2004 15:54:50 -0000	1.38
  @@ -13,7 +13,7 @@
   # bring in rules.mk for standard functionality
   @INCLUDE_RULES@
   PROGRAM_DEPENDENCIES = @APRUTIL_LIBS@
  -APRUTIL_LDFLAGS = @APRUTIL_LDFLAGS@
  +APRUTIL_LDFLAGS = -no-install @APRUTIL_LDFLAGS@
   
   all: $(PROGRAMS)
   
  
  
  
  1.22      +5 -1      apr-util/test/testdbm.c
  
  Index: testdbm.c
  ===================================================================
  RCS file: /home/cvs/apr-util/test/testdbm.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -b -d -u -r1.21 -r1.22
  --- testdbm.c	13 Feb 2004 09:55:26 -0000	1.21
  +++ testdbm.c	16 Feb 2004 15:54:50 -0000	1.22
  @@ -307,7 +307,7 @@
                   }
               }
               fputs("OK\n", stderr);
  -            fputs("Testing retrieval: ", stderr);
  +            fputs("Testing existence/retrieval: ", stderr);
               for (i = 0; i < 10; i++) {
                   int j;
                   char c, keydata[10];
  @@ -316,6 +316,10 @@
                   }
                   key.dptr = keydata;
                   key.dsize = 10;
  +                if (!apr_dbm_exists(db, key)) {
  +                    prdatum(stderr, key);
  +                    oops(db, 0, "exists: %s", "failed");
  +                }
                   rv = apr_dbm_fetch(db, key, &val);
                   if (rv != APR_SUCCESS || val.dsize != 10 ||
                       (strncmp(val.dptr, valdata, 10) != 0) ) {