diff options
author | drh <drh@noemail.net> | 2019-04-05 17:22:50 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-04-05 17:22:50 +0000 |
commit | ce059e5219aaba9408cfadee7289ff6d8f4647ca (patch) | |
tree | 684e9c51d259f97fcc07edc590aab189ad279fe1 /src | |
parent | 94c7ab5038510e3eb84920f5ef2b0ec704d7b470 (diff) | |
download | sqlite-ce059e5219aaba9408cfadee7289ff6d8f4647ca.tar.gz sqlite-ce059e5219aaba9408cfadee7289ff6d8f4647ca.zip |
Improved comment on the sqlite3FaultSim() function. No changes to code.
FossilOrigin-Name: 08b29672c552e5a6a3874746c6cc7025295e0e44dec43a1bfba3022acce849ff
Diffstat (limited to 'src')
-rw-r--r-- | src/util.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/util.c b/src/util.c index 8432d897f..1d8699846 100644 --- a/src/util.c +++ b/src/util.c @@ -32,15 +32,23 @@ void sqlite3Coverage(int x){ #endif /* -** Give a callback to the test harness that can be used to simulate faults -** in places where it is difficult or expensive to do so purely by means -** of inputs. +** Calls to sqlite3FaultSim() are used to simulate a failure during testing, +** or to bypass normal error detection during testing in order to let +** execute proceed futher downstream. ** -** The intent of the integer argument is to let the fault simulator know -** which of multiple sqlite3FaultSim() calls has been hit. +** In deployment, sqlite3FaultSim() *always* return SQLITE_OK (0). The +** sqlite3FaultSim() function only returns non-zero during testing. ** -** Return whatever integer value the test callback returns, or return -** SQLITE_OK if no test callback is installed. +** During testing, if the test harness has set a fault-sim callback using +** a call to sqlite3_test_control(SQLITE_TESTCTRL_FAULT_INSTALL), then +** each call to sqlite3FaultSim() is relayed to that application-supplied +** callback and the integer return value form the application-supplied +** callback is returned by sqlite3FaultSim(). +** +** The integer argument to sqlite3FaultSim() is a code to identify which +** sqlite3FaultSim() instance is being invoked. Each call to sqlite3FaultSim() +** should have a unique code. To prevent legacy testing applications from +** breaking, the codes should not be changed or reused. */ #ifndef SQLITE_UNTESTABLE int sqlite3FaultSim(int iTest){ |