1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-06 15:49:35 +03:00

Move (almost all) malloc failure test logic from fault.c to test_malloc.c. (CVS 5253)

FossilOrigin-Name: 4ae21e3419ad7e69dd735ca45fdc5a2de93d1840
This commit is contained in:
danielk1977
2008-06-20 11:05:37 +00:00
parent af83758645
commit ef05f2dfe3
6 changed files with 233 additions and 239 deletions

View File

@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
** @(#) $Id: sqliteInt.h,v 1.718 2008/06/19 18:17:50 danielk1977 Exp $
** @(#) $Id: sqliteInt.h,v 1.719 2008/06/20 11:05:38 danielk1977 Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_
@@ -2203,30 +2203,18 @@ CollSeq *sqlite3BinaryCompareCollSeq(Parse *, Expr *, Expr *);
#define SQLITE_FAULTINJECTOR_COUNT 1
/*
** The interface to the fault injector subsystem. If the fault injector
** mechanism is disabled at compile-time then set up macros so that no
** unnecessary code is generated.
** The interface to the code in fault.c used for identifying "benign"
** malloc failures. This is only present if SQLITE_OMIT_BUILTIN_TEST
** is not defined.
*/
#ifndef SQLITE_OMIT_BUILTIN_TEST
void sqlite3FaultConfig(int,int,int);
int sqlite3FaultFailures(int);
int sqlite3FaultBenignFailures(int);
int sqlite3FaultPending(int);
void sqlite3FaultBeginBenign(int);
void sqlite3FaultEndBenign(int);
int sqlite3FaultStep(int);
int sqlite3FaultsimInstall(int);
int sqlite3FaultIsBenign(void);
#else
# define sqlite3FaultConfig(A,B,C)
# define sqlite3FaultFailures(A) 0
# define sqlite3FaultBenignFailures(A) 0
# define sqlite3FaultPending(A) (-1)
# define sqlite3FaultBeginBenign(A)
# define sqlite3FaultEndBenign(A)
# define sqlite3FaultStep(A) 0
#define sqlite3FaultBeginBenign()
#define sqlite3FaultEndBenign()
#endif
#define IN_INDEX_ROWID 1
#define IN_INDEX_EPH 2