diff options
Diffstat (limited to 'src/test1.c')
-rw-r--r-- | src/test1.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/test1.c b/src/test1.c index 503ed3fea..ac3fae305 100644 --- a/src/test1.c +++ b/src/test1.c @@ -13,7 +13,7 @@ ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test1.c,v 1.216 2006/06/27 20:06:45 drh Exp $ +** $Id: test1.c,v 1.217 2006/07/06 10:59:58 drh Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -3231,6 +3231,33 @@ static int get_autocommit( } /* +** Usage: sqlite3_busy_timeout DB MS +** +** Set the busy timeout. This is more easily done using the timeout +** method of the TCL interface. But we need a way to test the case +** where it returns SQLITE_MISUSE. +*/ +static int test_busy_timeout( + void * clientData, + Tcl_Interp *interp, + int argc, + char **argv +){ + int rc, ms; + sqlite3 *db; + if( argc!=3 ){ + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + " DB", 0); + return TCL_ERROR; + } + if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; + if( Tcl_GetInt(interp, argv[2], &ms) ) return TCL_ERROR; + rc = sqlite3_busy_timeout(db, ms); + Tcl_AppendResult(interp, sqlite3TestErrorName(rc), 0); + return TCL_OK; +} + +/* ** Usage: tcl_variable_type VARIABLENAME ** ** Return the name of the internal representation for the @@ -3715,6 +3742,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ { "sqlite_delete_collation", (Tcl_CmdProc*)delete_collation }, { "sqlite3_get_autocommit", (Tcl_CmdProc*)get_autocommit }, { "sqlite3_stack_used", (Tcl_CmdProc*)test_stack_used }, + { "sqlite3_busy_timeout", (Tcl_CmdProc*)test_busy_timeout }, }; static struct { char *zName; |