aboutsummaryrefslogtreecommitdiff
path: root/src/test_malloc.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2009-01-07 03:59:47 +0000
committerdrh <drh@noemail.net>2009-01-07 03:59:47 +0000
commitf2a84e3ca6ba12edb05cdaa24cd82fa9c8c9aa7b (patch)
tree1cc49ef7336f2c10650f96370412207deb019b3a /src/test_malloc.c
parentd6e5e098165150062ab2e8c1acd311a9b5c2bee8 (diff)
downloadsqlite-f2a84e3ca6ba12edb05cdaa24cd82fa9c8c9aa7b.tar.gz
sqlite-f2a84e3ca6ba12edb05cdaa24cd82fa9c8c9aa7b.zip
Add a HIGHSTRESS parameter to the sqlite3_config_alt_pcache debugging
command in the test harness - to force calling pagerStress() more frequently. (CVS 6127) FossilOrigin-Name: e426860b94f5b47e3a265549dbac64a421cae425
Diffstat (limited to 'src/test_malloc.c')
-rw-r--r--src/test_malloc.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/test_malloc.c b/src/test_malloc.c
index 2009f5428..7519b5f7a 100644
--- a/src/test_malloc.c
+++ b/src/test_malloc.c
@@ -13,7 +13,7 @@
** This file contains code used to implement test interfaces to the
** memory allocation subsystem.
**
-** $Id: test_malloc.c,v 1.51 2008/11/19 01:20:26 drh Exp $
+** $Id: test_malloc.c,v 1.52 2009/01/07 03:59:47 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -962,22 +962,32 @@ static int test_alt_pcache(
Tcl_Obj *CONST objv[]
){
int installFlag;
- int discardChance;
- int prngSeed;
- extern void installTestPCache(int,unsigned,unsigned);
- if( objc!=4 ){
- Tcl_WrongNumArgs(interp, 1, objv, "INSTALLFLAG DISCARDCHANCE PRNGSEEED");
+ int discardChance = 0;
+ int prngSeed = 0;
+ int highStress = 0;
+ extern void installTestPCache(int,unsigned,unsigned,unsigned);
+ if( objc<2 || objc>5 ){
+ Tcl_WrongNumArgs(interp, 1, objv,
+ "INSTALLFLAG DISCARDCHANCE PRNGSEEED HIGHSTRESS");
return TCL_ERROR;
}
if( Tcl_GetIntFromObj(interp, objv[1], &installFlag) ) return TCL_ERROR;
- if( Tcl_GetIntFromObj(interp, objv[2], &discardChance) ) return TCL_ERROR;
- if( Tcl_GetIntFromObj(interp, objv[3], &prngSeed) ) return TCL_ERROR;
+ if( objc>=3 && Tcl_GetIntFromObj(interp, objv[2], &discardChance) ){
+ return TCL_ERROR;
+ }
+ if( objc>=4 && Tcl_GetIntFromObj(interp, objv[3], &prngSeed) ){
+ return TCL_ERROR;
+ }
+ if( objc>=5 && Tcl_GetIntFromObj(interp, objv[4], &highStress) ){
+ return TCL_ERROR;
+ }
if( discardChance<0 || discardChance>100 ){
Tcl_AppendResult(interp, "discard-chance should be between 0 and 100",
(char*)0);
return TCL_ERROR;
}
- installTestPCache(installFlag, (unsigned)discardChance, (unsigned)prngSeed);
+ installTestPCache(installFlag, (unsigned)discardChance, (unsigned)prngSeed,
+ (unsigned)highStress);
return TCL_OK;
}