/ Check-in [f79d5b18]
Login

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

Overview
Comment:Add testfixture command "vfs_current_time_int64". Returns the value returned by the xCurrentTimeInt64 method of the default VFS.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f79d5b1853b3d4316ea08de8206ffca33e44c395
User & Date: dan 2015-11-16 15:28:54
Context
2015-11-17
19:16
Fix harmless compiler warning. check-in: eea26b6c user: mistachkin tags: trunk
2015-11-16
15:28
Add testfixture command "vfs_current_time_int64". Returns the value returned by the xCurrentTimeInt64 method of the default VFS. check-in: f79d5b18 user: dan tags: trunk
08:54
In the shell tool, avoid testing if (sqlite3_vfs.xGetCurrentInt64) is NULL for a version 1 VFS. This field is only defined for version 2 and greater. check-in: ad5fcaa5 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test1.c.

  2234   2234   */
  2235   2235   static int test_config_sqllog(
  2236   2236     void * clientData,
  2237   2237     Tcl_Interp *interp,
  2238   2238     int objc,
  2239   2239     Tcl_Obj *CONST objv[]
  2240   2240   ){
  2241         -  sqlite3_stmt *pStmt;            /* First argument */
  2242   2241     if( objc!=1 ){
  2243   2242       Tcl_WrongNumArgs(interp, 1, objv, "");
  2244   2243       return TCL_ERROR;
  2245   2244     }
  2246   2245     sqlite3_config(SQLITE_CONFIG_SQLLOG, 0, 0);
  2247   2246     return TCL_OK;
  2248   2247   }
  2249   2248   #endif
         2249  +
         2250  +/*
         2251  +** Usage: vfs_current_time_int64
         2252  +**
         2253  +** Return the value returned by the default VFS's xCurrentTimeInt64 method.
         2254  +*/
         2255  +static int vfsCurrentTimeInt64(
         2256  +  void * clientData,
         2257  +  Tcl_Interp *interp,
         2258  +  int objc,
         2259  +  Tcl_Obj *CONST objv[]
         2260  +){
         2261  +  i64 t;
         2262  +  sqlite3_vfs *pVfs = sqlite3_vfs_find(0);
         2263  +  if( objc!=1 ){
         2264  +    Tcl_WrongNumArgs(interp, 1, objv, "");
         2265  +    return TCL_ERROR;
         2266  +  }
         2267  +  pVfs->xCurrentTimeInt64(pVfs, &t);
         2268  +  Tcl_SetObjResult(interp, Tcl_NewWideIntObj(t));
         2269  +  return TCL_OK;
         2270  +}
  2250   2271   
  2251   2272   /*
  2252   2273   ** Usage:  sqlite3_next_stmt  DB  STMT
  2253   2274   **
  2254   2275   ** Return the next statment in sequence after STMT.
  2255   2276   */
  2256   2277   static int test_next_stmt(
................................................................................
  7057   7078   #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
  7058   7079        { "sqlite3_stmt_scanstatus",       test_stmt_scanstatus,   0 },
  7059   7080        { "sqlite3_stmt_scanstatus_reset", test_stmt_scanstatus_reset,   0 },
  7060   7081   #endif
  7061   7082   #ifdef SQLITE_ENABLE_SQLLOG
  7062   7083        { "sqlite3_config_sqllog",         test_config_sqllog,   0 },
  7063   7084   #endif
  7064         -
         7085  +     { "vfs_current_time_int64",           vfsCurrentTimeInt64,   0 },
  7065   7086     };
  7066   7087     static int bitmask_size = sizeof(Bitmask)*8;
  7067   7088     static int longdouble_size = sizeof(LONGDOUBLE_TYPE);
  7068   7089     int i;
  7069   7090     extern int sqlite3_sync_count, sqlite3_fullsync_count;
  7070   7091     extern int sqlite3_opentemp_count;
  7071   7092     extern int sqlite3_like_count;