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

Infrastructure to make simulated I/O errors persistent instead of

transient. (CVS 3689)

FossilOrigin-Name: 1a53f531ecd51938fab37a59b7088d89d8f8569d
This commit is contained in:
drh
2007-03-15 12:17:42 +00:00
parent b69d96d22c
commit d5eb79eb40
6 changed files with 34 additions and 19 deletions

View File

@@ -90,13 +90,16 @@ static unsigned int elapse;
#ifdef SQLITE_TEST
int sqlite3_io_error_hit = 0;
int sqlite3_io_error_pending = 0;
int sqlite3_io_error_persist = 0;
int sqlite3_diskfull_pending = 0;
int sqlite3_diskfull = 0;
#define SimulateIOError(CODE) \
if( sqlite3_io_error_pending ) \
if( sqlite3_io_error_pending-- == 1 ){ local_ioerr(); CODE; }
if( sqlite3_io_error_pending-- == 1 \
|| (sqlite3_io_error_persist && sqlite3_io_error_hit) ) \
{ local_ioerr(); CODE; }
static void local_ioerr(){
sqlite3_io_error_hit = 1; /* Really just a place to set a breakpoint */
sqlite3_io_error_hit = 1;
}
#define SimulateDiskfullError(CODE) \
if( sqlite3_diskfull_pending ){ \