/ Check-in [edd207b9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minor test coverage enhancements. (CVS 4877)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: edd207b9a9df5d73ec34474a4e90fcb592f06cf1
User & Date: drh 2008-03-18 13:01:38
Context
2008-03-18
13:46
Test script changes that go with the coverage enhancements of the previous check-in. (CVS 4878) check-in: f87ddf83 user: drh tags: trunk
13:01
Minor test coverage enhancements. (CVS 4877) check-in: edd207b9 user: drh tags: trunk
00:54
Fix a memory leak introduced by the previous bug fix. (CVS 4876) check-in: b9c5dce3 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** Main file for the SQLite library.  The routines in this file
    13     13   ** implement the programmer interface to the library.  Routines in
    14     14   ** other files are for internal use by SQLite and should not be
    15     15   ** accessed by users of the library.
    16     16   **
    17         -** $Id: main.c,v 1.421 2008/03/07 21:37:19 drh Exp $
           17  +** $Id: main.c,v 1.422 2008/03/18 13:01:38 drh Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include <ctype.h>
    21     21   #ifdef SQLITE_ENABLE_FTS3
    22     22   # include "fts3.h"
    23     23   #endif
    24     24   
................................................................................
   998    998     ** and UTF-16, so add a version for each to avoid any unnecessary
   999    999     ** conversions. The only error that can occur here is a malloc() failure.
  1000   1000     */
  1001   1001     createCollation(db, "BINARY", SQLITE_UTF8, 0, binCollFunc, 0);
  1002   1002     createCollation(db, "BINARY", SQLITE_UTF16BE, 0, binCollFunc, 0);
  1003   1003     createCollation(db, "BINARY", SQLITE_UTF16LE, 0, binCollFunc, 0);
  1004   1004     createCollation(db, "RTRIM", SQLITE_UTF8, (void*)1, binCollFunc, 0);
  1005         -  if( db->mallocFailed ||
  1006         -      (db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "BINARY", 6, 0))==0 
  1007         -  ){
  1008         -    assert( db->mallocFailed );
         1005  +  if( db->mallocFailed ){
  1009   1006       db->magic = SQLITE_MAGIC_SICK;
  1010   1007       goto opendb_out;
  1011   1008     }
         1009  +  db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "BINARY", 6, 0);
         1010  +  assert( db->pDfltColl!=0 );
  1012   1011   
  1013   1012     /* Also add a UTF-8 case-insensitive collation sequence. */
  1014   1013     createCollation(db, "NOCASE", SQLITE_UTF8, 0, nocaseCollatingFunc, 0);
  1015   1014   
  1016   1015     /* Set flags on the built-in collating sequences */
  1017   1016     db->pDfltColl->type = SQLITE_COLL_BINARY;
  1018   1017     pColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "NOCASE", 6, 0);

Changes to src/test_malloc.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   **
    13     13   ** This file contains code used to implement test interfaces to the
    14     14   ** memory allocation subsystem.
    15     15   **
    16         -** $Id: test_malloc.c,v 1.16 2008/03/18 00:07:11 drh Exp $
           16  +** $Id: test_malloc.c,v 1.17 2008/03/18 13:01:38 drh Exp $
    17     17   */
    18     18   #include "sqliteInt.h"
    19     19   #include "tcl.h"
    20     20   #include <stdlib.h>
    21     21   #include <string.h>
    22     22   #include <assert.h>
    23     23   
................................................................................
   433    433   
   434    434       if( zErr ){
   435    435         Tcl_AppendResult(interp, zErr, zOption, 0);
   436    436         return TCL_ERROR;
   437    437       }
   438    438     }
   439    439     
          440  +  sqlite3_test_control(-12345); /* Just to stress the test_control interface */
   440    441     nBenign = sqlite3_test_control(SQLITE_TESTCTRL_FAULT_BENIGN_FAILURES,
   441    442                                    SQLITE_FAULTINJECTOR_MALLOC);
   442    443     nFail = sqlite3_test_control(SQLITE_TESTCTRL_FAULT_FAILURES,
   443    444                                  SQLITE_FAULTINJECTOR_MALLOC);
   444    445     sqlite3_test_control(SQLITE_TESTCTRL_FAULT_CONFIG,
   445    446                          SQLITE_FAULTINJECTOR_MALLOC, iFail, nRepeat);
   446    447     if( pBenignCnt ){

Changes to src/test_md5.c.

   379    379     char zBuf[33];
   380    380     p = sqlite3_aggregate_context(context, sizeof(*p));
   381    381     MD5Final(digest,p);
   382    382     DigestToBase16(digest, zBuf);
   383    383     sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
   384    384   }
   385    385   int Md5_Register(sqlite3 *db){
   386         -  return sqlite3_create_function(db, "md5sum", -1, SQLITE_UTF8, 0, 0, 
          386  +  int rc = sqlite3_create_function(db, "md5sum", -1, SQLITE_UTF8, 0, 0, 
   387    387                                    md5step, md5finalize);
          388  +  sqlite3_overload_function(db, "md5sum", -1);  /* To exercise this API */
          389  +  return rc;
   388    390   }