/ Check-in [9283478e]
Login

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

Overview
Comment:After running speed1.test and speed1p.test, reset the size of the lookaside buffer. Otherwise, subsequent runs of malloc5.test may report an error. Changes to test code only. (CVS 5824)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9283478e69d84aa99b2d4636587c8c0b34e7c4da
User & Date: danielk1977 2008-10-15 11:43:55
Context
2008-10-15
11:59
Version 3.6.4 (CVS 5825) check-in: cd73cffa user: drh tags: trunk, release
11:43
After running speed1.test and speed1p.test, reset the size of the lookaside buffer. Otherwise, subsequent runs of malloc5.test may report an error. Changes to test code only. (CVS 5824) check-in: 9283478e user: danielk1977 tags: trunk
2008-10-14
19:21
Disable the page-cache at the end of pcache2.test. (CVS 5823) check-in: 3d2d05b6 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

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.48 2008/10/10 17:41:29 drh Exp $
           16  +** $Id: test_malloc.c,v 1.49 2008/10/15 11:43:55 danielk1977 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   
................................................................................
   997    997     void * clientData,
   998    998     Tcl_Interp *interp,
   999    999     int objc,
  1000   1000     Tcl_Obj *CONST objv[]
  1001   1001   ){
  1002   1002     int rc;
  1003   1003     int sz, cnt;
         1004  +  Tcl_Obj *pRet;
  1004   1005     if( objc!=3 ){
  1005   1006       Tcl_WrongNumArgs(interp, 1, objv, "SIZE COUNT");
  1006   1007       return TCL_ERROR;
  1007   1008     }
  1008   1009     if( Tcl_GetIntFromObj(interp, objv[1], &sz) ) return TCL_ERROR;
  1009   1010     if( Tcl_GetIntFromObj(interp, objv[2], &cnt) ) return TCL_ERROR;
         1011  +  pRet = Tcl_NewObj();
         1012  +  Tcl_ListObjAppendElement(
         1013  +      interp, pRet, Tcl_NewIntObj(sqlite3GlobalConfig.szLookaside)
         1014  +  );
         1015  +  Tcl_ListObjAppendElement(
         1016  +      interp, pRet, Tcl_NewIntObj(sqlite3GlobalConfig.nLookaside)
         1017  +  );
  1010   1018     rc = sqlite3_config(SQLITE_CONFIG_LOOKASIDE, sz, cnt);
  1011         -  Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
         1019  +  Tcl_SetObjResult(interp, pRet);
  1012   1020     return TCL_OK;
  1013   1021   }
  1014   1022   
  1015   1023   
  1016   1024   /*
  1017   1025   ** Usage:    sqlite3_db_config_lookaside  CONNECTION  BUFID  SIZE  COUNT
  1018   1026   **

Changes to test/speed1.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   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script is measuring executing speed.
    13     13   #
    14         -# $Id: speed1.test,v 1.9 2008/07/30 13:15:46 drh Exp $
           14  +# $Id: speed1.test,v 1.10 2008/10/15 11:43:55 danielk1977 Exp $
    15     15   #
    16     16   
    17     17   sqlite3_shutdown
    18     18   #sqlite3_config_scratch 29000 1
    19         -sqlite3_config_lookaside 1000 300
           19  +set old_lookaside [sqlite3_config_lookaside 1000 300]
    20     20   #sqlite3_config_pagecache 1024 10000
    21     21   set testdir [file dirname $argv0]
    22     22   source $testdir/tester.tcl
    23     23   speed_trial_init speed1
    24     24   
    25     25   # Set a uniform random seed
    26     26   expr srand(0)
................................................................................
   286    286       (SELECT rowid FROM t1 ORDER BY random() LIMIT 20000)
   287    287   }
   288    288   do_test speed1-1.2 {
   289    289     db one {SELECT count(*) FROM t1}
   290    290   } 10000
   291    291   speed_trial_summary speed1
   292    292   
          293  +db close
          294  +sqlite3_shutdown
          295  +eval sqlite3_config_lookaside $old_lookaside
   293    296   finish_test

Changes to test/speed1p.test.

     9      9   #
    10     10   #*************************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script is measuring executing speed.  
    13     13   #
    14     14   # This is a copy of speed1.test modified to user prepared statements.
    15     15   #
    16         -# $Id: speed1p.test,v 1.5 2008/07/30 13:15:46 drh Exp $
           16  +# $Id: speed1p.test,v 1.6 2008/10/15 11:43:55 danielk1977 Exp $
    17     17   #
    18     18   
    19     19   sqlite3_shutdown
    20     20   #sqlite3_config_scratch 29000 1
    21         -sqlite3_config_lookaside 2048 300
           21  +set old_lookaside [sqlite3_config_lookaside 2048 300]
    22     22   #sqlite3_config_pagecache 1024 11000
    23     23   set testdir [file dirname $argv0]
    24     24   source $testdir/tester.tcl
    25     25   speed_trial_init speed1
    26     26   
    27     27   # Set a uniform random seed
    28     28   expr srand(0)
................................................................................
   322    322   speed_trial speed1p-random-del1 20000 row {
   323    323     DELETE FROM t1 WHERE rowid IN
   324    324       (SELECT rowid FROM t1 ORDER BY random() LIMIT 20000)
   325    325   }
   326    326   do_test speed1p-1.1 {
   327    327     db one {SELECT count(*) FROM t1}
   328    328   } 30000
   329         -
   330    329       
   331    330   # Delete 20000 more rows at random from the table.
   332    331   #
   333    332   speed_trial speed1p-random-del2 20000 row {
   334    333     DELETE FROM t1 WHERE rowid IN
   335    334       (SELECT rowid FROM t1 ORDER BY random() LIMIT 20000)
   336    335   }
   337    336   do_test speed1p-1.2 {
   338    337     db one {SELECT count(*) FROM t1}
   339    338   } 10000
   340    339   speed_trial_summary speed1
   341    340   
          341  +db close
          342  +sqlite3_shutdown
          343  +eval sqlite3_config_lookaside $old_lookaside
   342    344   finish_test