Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Modify the implementation of the test code in test_vfs.c so that test VFS objects may be invoked recursively. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
065e5a5ea4f82f0d3fbb2e80d3a977af |
User & Date: | dan 2011-06-22 10:37:19.411 |
References
2011-08-26
| ||
17:17 | Cherrypick the recursion fix to test_vfs.c from [065e5a5ea4f82]. Also fix the nan.test module to handle upper/lower case changes in TCL. (check-in: 41b5f86971 user: drh tags: branch-3.7.2) | |
Context
2011-06-22
| ||
10:56 | Change a test case in types3.test slightly so that it works with the latest versions of Tcl. (check-in: 6e1f4df51a user: dan tags: trunk) | |
10:37 | Modify the implementation of the test code in test_vfs.c so that test VFS objects may be invoked recursively. (check-in: 065e5a5ea4 user: dan tags: trunk) | |
2011-06-21
| ||
19:39 | Fix typo in previous tester.tcl commit. (check-in: c2e5faca14 user: shaneh tags: trunk) | |
Changes
Changes to src/test_vfs.c.
︙ | ︙ | |||
75 76 77 78 79 80 81 | */ struct Testvfs { char *zName; /* Name of this VFS */ sqlite3_vfs *pParent; /* The VFS to use for file IO */ sqlite3_vfs *pVfs; /* The testvfs registered with SQLite */ Tcl_Interp *interp; /* Interpreter to run script in */ Tcl_Obj *pScript; /* Script to execute */ | < < | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | */ struct Testvfs { char *zName; /* Name of this VFS */ sqlite3_vfs *pParent; /* The VFS to use for file IO */ sqlite3_vfs *pVfs; /* The testvfs registered with SQLite */ Tcl_Interp *interp; /* Interpreter to run script in */ Tcl_Obj *pScript; /* Script to execute */ TestvfsBuffer *pBuffer; /* List of shared buffers */ int isNoshm; int mask; /* Mask controlling [script] and [ioerr] */ TestFaultInject ioerr_err; TestFaultInject full_err; |
︙ | ︙ | |||
263 264 265 266 267 268 269 | Testvfs *p, const char *zMethod, Tcl_Obj *arg1, Tcl_Obj *arg2, Tcl_Obj *arg3 ){ int rc; /* Return code from Tcl_EvalObj() */ | < < | < < < < < < < | < < < < < < < < < | < < | | | | > > > > | | < < < < < < | 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | Testvfs *p, const char *zMethod, Tcl_Obj *arg1, Tcl_Obj *arg2, Tcl_Obj *arg3 ){ int rc; /* Return code from Tcl_EvalObj() */ Tcl_Obj *pEval; assert( p->pScript ); assert( zMethod ); assert( p ); assert( arg2==0 || arg1!=0 ); assert( arg3==0 || arg2!=0 ); pEval = Tcl_DuplicateObj(p->pScript); Tcl_IncrRefCount(p->pScript); Tcl_ListObjAppendElement(p->interp, pEval, Tcl_NewStringObj(zMethod, -1)); if( arg1 ) Tcl_ListObjAppendElement(p->interp, pEval, arg1); if( arg2 ) Tcl_ListObjAppendElement(p->interp, pEval, arg2); if( arg3 ) Tcl_ListObjAppendElement(p->interp, pEval, arg3); rc = Tcl_EvalObjEx(p->interp, pEval, TCL_EVAL_GLOBAL); if( rc!=TCL_OK ){ Tcl_BackgroundError(p->interp); Tcl_ResetResult(p->interp); } } /* ** Close an tvfs-file. */ static int tvfsClose(sqlite3_file *pFile){ |
︙ | ︙ | |||
1090 1091 1092 1093 1094 1095 1096 1097 | break; } case CMD_SCRIPT: { if( objc==3 ){ int nByte; if( p->pScript ){ Tcl_DecrRefCount(p->pScript); | > < < < | 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 | break; } case CMD_SCRIPT: { if( objc==3 ){ int nByte; if( p->pScript ){ int i; Tcl_DecrRefCount(p->pScript); p->pScript = 0; } Tcl_GetStringFromObj(objv[2], &nByte); if( nByte>0 ){ p->pScript = Tcl_DuplicateObj(objv[2]); Tcl_IncrRefCount(p->pScript); } |
︙ | ︙ | |||
1245 1246 1247 1248 1249 1250 1251 1252 1253 | } return TCL_OK; } static void testvfs_obj_del(ClientData cd){ Testvfs *p = (Testvfs *)cd; if( p->pScript ) Tcl_DecrRefCount(p->pScript); sqlite3_vfs_unregister(p->pVfs); | > < | 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 | } return TCL_OK; } static void testvfs_obj_del(ClientData cd){ Testvfs *p = (Testvfs *)cd; int i; if( p->pScript ) Tcl_DecrRefCount(p->pScript); sqlite3_vfs_unregister(p->pVfs); ckfree((char *)p->pVfs); ckfree((char *)p); } /* ** Usage: testvfs VFSNAME ?SWITCHES? ** |
︙ | ︙ |