1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00

Enhanced I/O error simulation. (CVS 3418)

FossilOrigin-Name: 86931854fc5a63571719639d9a23b1d6614a6153
This commit is contained in:
drh
2006-09-14 13:47:11 +00:00
parent f800e3e63a
commit 5968593b51
6 changed files with 58 additions and 41 deletions

View File

@@ -92,18 +92,18 @@ int sqlite3_io_error_hit = 0;
int sqlite3_io_error_pending = 0;
int sqlite3_diskfull_pending = 0;
int sqlite3_diskfull = 0;
#define SimulateIOError(A) \
#define SimulateIOError(CODE) \
if( sqlite3_io_error_pending ) \
if( sqlite3_io_error_pending-- == 1 ){ local_ioerr(); return A; }
if( sqlite3_io_error_pending-- == 1 ){ local_ioerr(); CODE; }
static void local_ioerr(){
sqlite3_io_error_hit = 1; /* Really just a place to set a breakpoint */
}
#define SimulateDiskfullError \
#define SimulateDiskfullError(CODE) \
if( sqlite3_diskfull_pending ){ \
if( sqlite3_diskfull_pending == 1 ){ \
local_ioerr(); \
sqlite3_diskfull = 1; \
return SQLITE_FULL; \
CODE; \
}else{ \
sqlite3_diskfull_pending--; \
} \