/ Check-in [e559e810]
Login

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

Overview
Comment:More test coverage improvements. (CVS 2605)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e559e810a51427def6928763ae0d6f7347366d04
User & Date: drh 2005-08-20 13:47:42
Context
2005-08-21
16:54
Do not overwrite small files (less than 1024 bytes) that are not databases. Ticket #1370. (CVS 2606) check-in: 7f430268 user: drh tags: trunk
2005-08-20
13:47
More test coverage improvements. (CVS 2605) check-in: e559e810 user: drh tags: trunk
03:03
Increased test coverage. Some malloc tests now fail though this is believed to be an instrumentation problem not a real error. (CVS 2604) check-in: f786f37a user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbemem.c.

   665    665       /* Cannot define a string subtype for non-string objects */
   666    666       assert( (pMem->flags & (MEM_Static|MEM_Dyn|MEM_Ephem|MEM_Short))==0 );
   667    667       assert( pMem->xDel==0 );
   668    668     }
   669    669     /* MEM_Null excludes all other types */
   670    670     assert( (pMem->flags&(MEM_Str|MEM_Int|MEM_Real|MEM_Blob))==0
   671    671             || (pMem->flags&MEM_Null)==0 );
   672         -  if( (pMem->flags & (MEM_Int|MEM_Real))==(MEM_Int|MEM_Real) ){
   673         -    assert( pMem->r==pMem->i );
   674         -  }
          672  +  /* If the MEM is both real and integer, the values are equal */
          673  +  assert( (pMem->flags & (MEM_Int|MEM_Real))!=(MEM_Int|MEM_Real) 
          674  +          || pMem->r==pMem->i );
   675    675   }
   676    676   #endif
   677    677   
   678    678   /* This function is only available internally, it is not part of the
   679    679   ** external API. It works in a similar way to sqlite3_value_text(),
   680    680   ** except the data returned is in the encoding specified by the second
   681    681   ** parameter, which must be one of SQLITE_UTF16BE, SQLITE_UTF16LE or

Changes to test/ioerr.test.

    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing for correct handling of I/O errors
    13     13   # such as writes failing because the disk is full.
    14     14   # 
    15     15   # The tests in this file use special facilities that are only
    16     16   # available in the SQLite test fixture.
    17     17   #
    18         -# $Id: ioerr.test,v 1.20 2005/03/10 12:58:22 drh Exp $
           18  +# $Id: ioerr.test,v 1.21 2005/08/20 13:47:42 drh Exp $
    19     19   
    20     20   set testdir [file dirname $argv0]
    21     21   source $testdir/tester.tcl
           22  +
    22     23   
    23     24   # If SQLITE_DEFAULT_AUTOVACUUM is set to true, then a simulated IO error
    24     25   # on the 8th IO operation in the SQL script below doesn't report an error.
    25     26   #
    26     27   # This is because the 8th IO call attempts to read page 2 of the database
    27     28   # file when the file on disk is only 1 page. The pager layer detects that
    28     29   # this has happened and suppresses the error returned by the OS layer.
................................................................................
   180    181     } -tclbody {
   181    182       sqlite3 db test.db
   182    183       db eval {
   183    184         SELECT * FROM t1;
   184    185       }
   185    186     } -exclude 1
   186    187   }
          188  +
          189  +# For test coverage:  Cause an I/O failure while trying to read a
          190  +# short field (one that fits into a Mem buffer without mallocing
          191  +# for space).
          192  +#
          193  +do_ioerr_test ioerr-8 -tclprep {
          194  +  execsql {
          195  +    CREATE TABLE t1(a,b,c);
          196  +    INSERT INTO t1 VALUES(randstr(200,200), randstr(1000,1000), 2);
          197  +  }
          198  +  db close
          199  +  sqlite3 db test.db
          200  +} -sqlbody {
          201  +  SELECT c FROM t1;
          202  +}
   187    203   
   188    204   finish_test