diff options
author | dan <dan@noemail.net> | 2013-04-05 20:40:43 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2013-04-05 20:40:43 +0000 |
commit | d7a558a9fbf6feb84ed990c67e41fe45dafd4a18 (patch) | |
tree | e469400027f8a5c9c1d55e2141b1f5747c9b8c87 /src | |
parent | ced9813b12a9320e0a16ddf7926a323d672ce36b (diff) | |
download | sqlite-d7a558a9fbf6feb84ed990c67e41fe45dafd4a18.tar.gz sqlite-d7a558a9fbf6feb84ed990c67e41fe45dafd4a18.zip |
Improve the code coverage of "permutations.test coverage-pager".
FossilOrigin-Name: b095e2cdb61ca8487255687f58fb1024d40f3986
Diffstat (limited to 'src')
-rw-r--r-- | src/test_vfs.c | 12 |
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; |