aboutsummaryrefslogtreecommitdiff
path: root/src/test_vfs.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2013-04-05 20:40:43 +0000
committerdan <dan@noemail.net>2013-04-05 20:40:43 +0000
commitd7a558a9fbf6feb84ed990c67e41fe45dafd4a18 (patch)
treee469400027f8a5c9c1d55e2141b1f5747c9b8c87 /src/test_vfs.c
parentced9813b12a9320e0a16ddf7926a323d672ce36b (diff)
downloadsqlite-d7a558a9fbf6feb84ed990c67e41fe45dafd4a18.tar.gz
sqlite-d7a558a9fbf6feb84ed990c67e41fe45dafd4a18.zip
Improve the code coverage of "permutations.test coverage-pager".
FossilOrigin-Name: b095e2cdb61ca8487255687f58fb1024d40f3986
Diffstat (limited to 'src/test_vfs.c')
-rw-r--r--src/test_vfs.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/test_vfs.c b/src/test_vfs.c
index 933de9951..fcd577439 100644
--- a/src/test_vfs.c
+++ b/src/test_vfs.c
@@ -125,8 +125,9 @@ struct Testvfs {
#define TESTVFS_ACCESS_MASK 0x00004000
#define TESTVFS_FULLPATHNAME_MASK 0x00008000
#define TESTVFS_READ_MASK 0x00010000
+#define TESTVFS_UNLOCK_MASK 0x00020000
-#define TESTVFS_ALL_MASK 0x0001FFFF
+#define TESTVFS_ALL_MASK 0x0003FFFF
#define TESTVFS_MAX_PAGES 1024
@@ -467,8 +468,12 @@ static int tvfsLock(sqlite3_file *pFile, int eLock){
** Unlock an tvfs-file.
*/
static int tvfsUnlock(sqlite3_file *pFile, int eLock){
- TestvfsFd *p = tvfsGetFd(pFile);
- return sqlite3OsUnlock(p->pReal, eLock);
+ TestvfsFd *pFd = tvfsGetFd(pFile);
+ Testvfs *p = (Testvfs *)pFd->pVfs->pAppData;
+ if( p->mask&TESTVFS_WRITE_MASK && tvfsInjectIoerr(p) ){
+ return SQLITE_IOERR_UNLOCK;
+ }
+ return sqlite3OsUnlock(pFd->pReal, eLock);
}
/*
@@ -1101,6 +1106,7 @@ static int testvfs_obj_cmd(
{ "xClose", TESTVFS_CLOSE_MASK },
{ "xAccess", TESTVFS_ACCESS_MASK },
{ "xFullPathname", TESTVFS_FULLPATHNAME_MASK },
+ { "xUnlock", TESTVFS_UNLOCK_MASK },
};
Tcl_Obj **apElem = 0;
int nElem = 0;