1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Add a new sqlite3_test_control() that indicates that database files are

always well-formed.  Use this during testing to enable assert() statements
that prove conditions that are always true for well-formed databases.

FossilOrigin-Name: 15e4f63d1f3cbcd0aa789fd3e460cd6e4d3338f9
This commit is contained in:
drh
2013-11-29 15:06:27 +00:00
parent 1b4b334abb
commit 09fe614372
25 changed files with 169 additions and 33 deletions

View File

@@ -3296,6 +3296,19 @@ int sqlite3_test_control(int op, ...){
}
#endif
/* sqlite3_test_control(SQLITE_TESTCTRL_NEVER_CORRUPT, int);
**
** Set or clear a flag that indicates that the database file is always well-
** formed and never corrupt. This flag is clear by default, indicating that
** database files might have arbitrary corruption. Setting the flag during
** testing causes certain assert() statements in the code to be activated
** that demonstrat invariants on well-formed database files.
*/
case SQLITE_TESTCTRL_NEVER_CORRUPT: {
sqlite3Config.neverCorrupt = va_arg(ap, int);
break;
}
}
va_end(ap);
#endif /* SQLITE_OMIT_BUILTIN_TEST */