aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 62500441b..d4e862ed7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
-** $Id: main.c,v 1.415 2008/01/31 13:35:49 drh Exp $
+** $Id: main.c,v 1.416 2008/01/31 14:43:24 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1470,3 +1470,39 @@ int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
sqlite3_mutex_leave(db->mutex);
return rc;
}
+
+/*
+** Interface to the testing logic.
+*/
+int sqlite3_test_control(int op, ...){
+ va_list ap;
+ int rc = 0;
+ va_start(ap, op);
+ switch( op ){
+#ifndef SQLITE_OMIT_FAULTINJECTOR
+ case SQLITE_TESTCTRL_FAULT_CONFIG: {
+ int id = va_arg(ap, int);
+ int nDelay = va_arg(ap, int);
+ int nRepeat = va_arg(ap, int);
+ sqlite3FaultConfig(id, nDelay, nRepeat);
+ break;
+ }
+ case SQLITE_TESTCTRL_FAULT_FAILURES: {
+ int id = va_arg(ap, int);
+ rc = sqlite3FaultFailures(id);
+ break;
+ }
+ case SQLITE_TESTCTRL_FAULT_BENIGN_FAILURES: {
+ int id = va_arg(ap, int);
+ rc = sqlite3FaultBenignFailures(id);
+ break;
+ }
+ case SQLITE_TESTCTRL_FAULT_PENDING: {
+ int id = va_arg(ap, int);
+ rc = sqlite3FaultPending(id);
+ break;
+ }
+#endif /* SQLITE_OMIT_FAULTINJECTOR */
+ }
+ va_end(ap);
+}