diff options
author | dan <dan@noemail.net> | 2015-11-16 15:28:54 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2015-11-16 15:28:54 +0000 |
commit | e4e416e87ea95696a8630e37d09836e2adf7753c (patch) | |
tree | d75c03238281775da6b8a17090797fe090d4c7f3 /src | |
parent | 3fd415b2bf46be65360579d1b84d4dd20b2dbbf7 (diff) | |
download | sqlite-e4e416e87ea95696a8630e37d09836e2adf7753c.tar.gz sqlite-e4e416e87ea95696a8630e37d09836e2adf7753c.zip |
Add testfixture command "vfs_current_time_int64". Returns the value returned by the xCurrentTimeInt64 method of the default VFS.
FossilOrigin-Name: f79d5b1853b3d4316ea08de8206ffca33e44c395
Diffstat (limited to 'src')
-rw-r--r-- | src/test1.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/test1.c b/src/test1.c index 43feb2dc2..186e4e468 100644 --- a/src/test1.c +++ b/src/test1.c @@ -2238,7 +2238,6 @@ static int test_config_sqllog( int objc, Tcl_Obj *CONST objv[] ){ - sqlite3_stmt *pStmt; /* First argument */ if( objc!=1 ){ Tcl_WrongNumArgs(interp, 1, objv, ""); return TCL_ERROR; @@ -2249,6 +2248,28 @@ static int test_config_sqllog( #endif /* +** Usage: vfs_current_time_int64 +** +** Return the value returned by the default VFS's xCurrentTimeInt64 method. +*/ +static int vfsCurrentTimeInt64( + void * clientData, + Tcl_Interp *interp, + int objc, + Tcl_Obj *CONST objv[] +){ + i64 t; + sqlite3_vfs *pVfs = sqlite3_vfs_find(0); + if( objc!=1 ){ + Tcl_WrongNumArgs(interp, 1, objv, ""); + return TCL_ERROR; + } + pVfs->xCurrentTimeInt64(pVfs, &t); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(t)); + return TCL_OK; +} + +/* ** Usage: sqlite3_next_stmt DB STMT ** ** Return the next statment in sequence after STMT. @@ -7061,7 +7082,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ #ifdef SQLITE_ENABLE_SQLLOG { "sqlite3_config_sqllog", test_config_sqllog, 0 }, #endif - + { "vfs_current_time_int64", vfsCurrentTimeInt64, 0 }, }; static int bitmask_size = sizeof(Bitmask)*8; static int longdouble_size = sizeof(LONGDOUBLE_TYPE); |