/ Check-in [e99e28ef]
Login

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

Overview
Comment:Added new tests of the scratch memory allocator for increased test coverage. (CVS 6388)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e99e28efbbfff3e46eec0f90d566991de4406fd8
User & Date: drh 2009-03-26 12:20:33
Context
2009-03-26
14:48
Prevent the tcl test suite from throwing an exception when a threadsafe SQLite is linked against a non-threadsafe Tcl for testing. Print a warning instead. Ticket #3753. (CVS 6389) check-in: a22e7c81 user: danielk1977 tags: trunk
12:20
Added new tests of the scratch memory allocator for increased test coverage. (CVS 6388) check-in: e99e28ef user: drh tags: trunk
11:49
Ensure that the test vfs in test_journal.c zeroes sqlite3_file.pMethods if an xOpen() call fails. Similar problem to that fixed by #6384. This was a problem with test code, not SQLite itself. (CVS 6387) check-in: 45ae830d user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/memsubsys1.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   # This file contains tests of the memory allocation subsystem
    13     13   #
    14         -# $Id: memsubsys1.test,v 1.13 2008/10/01 13:55:51 drh Exp $
           14  +# $Id: memsubsys1.test,v 1.14 2009/03/26 12:20:33 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   sqlite3_reset_auto_extension
    19     19   
    20     20   # This procedure constructs a new database in test.db.  It fills
    21     21   # this database with many small records (enough to force multiple
................................................................................
   248    248   } 1
   249    249   do_test memsubsys1-7.6 {
   250    250     set s_used [lindex [sqlite3_status SQLITE_STATUS_SCRATCH_USED 0] 2]
   251    251   } 1
   252    252   do_test memsubsys1-7.7 {
   253    253     set s_ovfl [lindex [sqlite3_status SQLITE_STATUS_SCRATCH_OVERFLOW 0] 2]
   254    254   } 0
          255  +
          256  +# Test 8:  Disable PAGECACHE.  Make available SCRATCH zero.  Verify that
          257  +# the SCRATCH overflow logic works.
          258  +#
          259  +db close
          260  +sqlite3_shutdown
          261  +sqlite3_config_pagecache 0 0
          262  +sqlite3_config_scratch 25000 0
          263  +sqlite3_initialize
          264  +reset_highwater_marks
          265  +do_test memsubsys1-8.1 {
          266  +  set pg_used [lindex [sqlite3_status SQLITE_STATUS_SCRATCH_USED 0] 2]
          267  +} 0
          268  +do_test memsubsys1-8.2 {
          269  +  set s_ovfl [lindex [sqlite3_status SQLITE_STATUS_SCRATCH_OVERFLOW 0] 2]
          270  +} 0
          271  +do_test memsubsys1-8.3 {
          272  +  sqlite3 db :memory:
          273  +  db eval {
          274  +    CREATE TABLE t1(x);
          275  +    INSERT INTO t1 VALUES(zeroblob(400));
          276  +    INSERT INTO t1 VALUES(zeroblob(400));
          277  +    INSERT INTO t1 SELECT * FROM t1;
          278  +    INSERT INTO t1 SELECT * FROM t1;
          279  +    INSERT INTO t1 SELECT * FROM t1;
          280  +  }
          281  +  expr {[lindex [sqlite3_status SQLITE_STATUS_SCRATCH_OVERFLOW 0] 2]>0}
          282  +} 1
          283  +db close
          284  +sqlite3_shutdown
          285  +sqlite3_config_memstatus 0
          286  +sqlite3_initialize
          287  +do_test memsubsys1-8.4 {
          288  +  sqlite3 db :memory:
          289  +  db eval {
          290  +    CREATE TABLE t1(x);
          291  +    INSERT INTO t1 VALUES(zeroblob(400));
          292  +    INSERT INTO t1 VALUES(zeroblob(400));
          293  +    INSERT INTO t1 SELECT * FROM t1;
          294  +    INSERT INTO t1 SELECT * FROM t1;
          295  +    INSERT INTO t1 SELECT * FROM t1;
          296  +    SELECT rowid FROM t1;
          297  +  }
          298  +} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16}
          299  +
   255    300   
   256    301   db close
   257    302   sqlite3_shutdown
          303  +sqlite3_config_memstatus 1
   258    304   sqlite3_config_pagecache 0 0
   259    305   sqlite3_config_scratch 0 0
   260    306   sqlite3_config_lookaside 100 500
   261    307   sqlite3_initialize
   262    308   autoinstall_test_functions
   263    309   finish_test