Enabled the testcase() macros under SQLITE_DEBUG.

FossilOrigin-Name: 0ae8dd132db8331ca9cc42ad511066924f9d3a1d158ecdb630cebc41b6bd2493
This commit is contained in:
drh 2021-10-20 17:58:33 +00:00
parent dec8572d8a
commit 9fdd66e3c0
8 changed files with 25 additions and 28 deletions

View File

@ -436,7 +436,7 @@ struct RtreeMatchArg {
** it is not, make it a no-op.
*/
#ifndef SQLITE_AMALGAMATION
# ifdef SQLITE_COVERAGE_TEST
# if defined(SQLITE_COVERAGE_TEST) || defined(SQLITE_DEBUG)
unsigned int sqlite3RtreeTestcase = 0;
# define testcase(X) if( X ){ sqlite3RtreeTestcase += __LINE__; }
# else

View File

@ -1,5 +1,5 @@
C Fix\sa\sproblem\swith\sthe\sCARRAY\sextension\swhen\sthe\sSQLITE_TRANSIENT\sdestructor\nis\sused\sfor\snon-text\sarrays.\n[forum:/forumpost/48e525b266|Forum\sthread\s48e525b266].
D 2021-10-20T13:48:12.145
C Enabled\sthe\stestcase()\smacros\sunder\sSQLITE_DEBUG.
D 2021-10-20T17:58:33.677
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -394,7 +394,7 @@ F ext/repair/test/checkindex01.test b530f141413b587c9eb78ff734de6bb79bc3515c3350
F ext/repair/test/test.tcl 686d76d888dffd021f64260abf29a55c57b2cedfa7fc69150b42b1d6119aac3c
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
F ext/rtree/geopoly.c a7021cb524621573ccda213a35b0339371849dd4acc4909f689786ee1f964b7f
F ext/rtree/rtree.c f2658ccaf20c65f2c2d7b097e42aa71be7272a3b49af586a57d9eed8ceb8436f
F ext/rtree/rtree.c a602c5ba860c93a3087ec0c41ad4c4c0c2e9ba2f0008617d4b444200e3b3625d
F ext/rtree/rtree.h 4a690463901cb5e6127cf05eb8e642f127012fd5003830dbc974eca5802d9412
F ext/rtree/rtree1.test 35c3bc0def71317b7601ee0d1149e7df2cd8fc4f13ec89a64761ac3f46ca123f
F ext/rtree/rtree2.test 9d9deddbb16fd0c30c36e6b4fdc3ee3132d765567f0f9432ee71e1303d32603d
@ -493,7 +493,7 @@ F src/btmutex.c 8acc2f464ee76324bf13310df5692a262b801808984c1b79defb2503bbafadb6
F src/btree.c 0604f4af97624ffbe2f0757c559c51f57760c6ad3d8ee3ee94fa6ec5795f2832
F src/btree.h 74d64b8f28cfa4a894d14d4ed64fa432cd697b98b61708d4351482ae15913e22
F src/btreeInt.h ee9348c4cb9077243b049edc93a82c1f32ca48baeabf2140d41362b9f9139ff7
F src/build.c e2eae084ad154b4ca78b0bb8f165e61d90d11b9054c2a28d986fd6518834e352
F src/build.c 8bdda90f9b1189c7b0813575171b3c6b2d74b3ade57c11cb4383776781ea9335
F src/callback.c 106b585da1edd57d75fa579d823a5218e0bf37f191dbf7417eeb4a8a9a267dbc
F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
F src/ctime.c 8159d5f706551861c18ec6c8f6bdf105e15ea00367f05d9ab65d31a1077facc1
@ -505,7 +505,7 @@ F src/expr.c 529f7eca2821e874a375b1b318e697d62cb28f56069677c93f587f2de5dceb54
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
F src/fkey.c 187b67af20c5795953a592832c5d985e4313fe503ebd8f95e3e9e9ad5a730bb5
F src/func.c 1cfb09d7ffca81238eccefdb0293e1f5b7cfebbd1816dfad5ec6024742a7496b
F src/global.c 612ea60c9acbcb45754c2ed659b4a56936a06814718e969636fedc7e3b889808
F src/global.c 59bfd5705a623f0b45e91622699953cfd1be2c176e78d8ff610463f2ea4ec51b
F src/hash.c 8d7dda241d0ebdafb6ffdeda3149a412d7df75102cecfc1021c98d6219823b19
F src/hash.h 9d56a9079d523b648774c1784b74b89bd93fac7b365210157482e4319a468f38
F src/hwtime.h cb1d7e3e1ed94b7aa6fde95ae2c2daccc3df826be26fc9ed7fd90d1750ae6144
@ -554,7 +554,7 @@ F src/shell.c.in e80fe5118fc3b942c1becc67ebfca6a887dbab9295e0bd5b6da61c4375baa63
F src/sqlite.h.in f0c1ecb5af508aa8e970cd8bc0ec851e6c380b81825038d458846c2fcdfcef50
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h e97f4e9b509408fea4c4e9bef5a41608dfac343b4d3c7a990dedde1e19af9510
F src/sqliteInt.h 642c17df9e5a3517db452ac73a2b953143449a8bc2f6570c60de455a89a8571c
F src/sqliteInt.h df3bc11691f5977041efb0d16fcd2b5e10e97bc5f8231edd3fbc0ed24978be30
F src/sqliteLimit.h d7323ffea5208c6af2734574bae933ca8ed2ab728083caa117c9738581a31657
F src/status.c 4b8bc2a6905163a38b739854a35b826c737333fab5b1f8e03fa7eb9a4799c4c1
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
@ -619,13 +619,13 @@ F src/trigger.c 3f612ce5f0858b6c23460a3c799d01f408b49b0b29d931d8b8e6fc224a8667de
F src/update.c 69c4c10bc6873a80c0a77cb578f9fc60ee90003d03f9530bc3370fa24615772d
F src/upsert.c 8789047a8f0a601ea42fa0256d1ba3190c13746b6ba940fe2d25643a7e991937
F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0
F src/util.c 34b6b9a82ec6a15eaf94dd69cbb21362dffc9f27682ca1d6f1eccc352cf89d3e
F src/util.c 30df8356e231dad33be10bb27897655002668343280004ba28c734489414a167
F src/vacuum.c 454973a59fb20bb982efc2df568a098616db6328a0491b6e84e2e07f7333db45
F src/vdbe.c a80943ed189ed5f4215636bde0aa7901319b051baffc0706f93a786bdf49ffcf
F src/vdbe.h 25dabb25c7e157b84e59260cfb5b466c3ac103ede9f36f4db371332c47601abe
F src/vdbeInt.h 38206c8dd6b60ff03d9fd4f626b1b4fd0eef7cdc44f2fc2c1973b0f932a3f26b
F src/vdbeapi.c 7b83468feb1d42a09d4c2e5241a3eaa3d1f138e289a843cba9fd3f1dad95ca67
F src/vdbeaux.c 897912feb91ec3cd8dedc3fce21d192fd6d37d299538a13d9d93100b22e4d4a0
F src/vdbeaux.c a57c760d1897f1b72f6fae26983df363db7a2c42d88721187e907f2c84862b42
F src/vdbeblob.c 292e96c01c4219fca71d74e1002906d43eb232af4bd83f7552a3faec741f3eb8
F src/vdbemem.c 8be0af1060012520381d3296fcb1718e80cd5b99ce04f51f7e1c4dba4072caac
F src/vdbesort.c cd5130f683706c1a43e165a74187745fb3351cb56052cf9dc91de820634bbde2
@ -1929,7 +1929,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 699117156e0b5a7beda606de56bd511af322e3efa4eee6e60f0a8d60561def64
R cf56933f6006b45d93d99fc6072efe54
P cac910c15f409c5358843643b2f90252eb90328b9e5ff84cedbccb604d9891af
R b58b0d6940cbb987a3db5591c7793ff3
U drh
Z 590b76cfe5702e43cf5589b10e3b6679
Z ed1a880f40a6b2e9669ca472c69ec5e6

View File

@ -1 +1 @@
cac910c15f409c5358843643b2f90252eb90328b9e5ff84cedbccb604d9891af
0ae8dd132db8331ca9cc42ad511066924f9d3a1d158ecdb630cebc41b6bd2493

View File

@ -2218,7 +2218,6 @@ static void estimateIndexWidth(Index *pIdx){
*/
static int hasColumn(const i16 *aiCol, int nCol, int x){
while( nCol-- > 0 ){
assert( aiCol[0]>=0 );
if( x==*(aiCol++) ){
return 1;
}

View File

@ -298,6 +298,12 @@ SQLITE_WSD struct Sqlite3Config sqlite3Config = {
*/
FuncDefHash sqlite3BuiltinFunctions;
/*
** Counter used for coverage testing. Does not come into play for
** release builds.
*/
unsigned int sqlite3CoverageCounter;
#ifdef VDBE_PROFILE
/*
** The following performance counter can be used in place of

View File

@ -437,9 +437,11 @@
** can insure that all cases are evaluated.
**
*/
#ifdef SQLITE_COVERAGE_TEST
void sqlite3Coverage(int);
# define testcase(X) if( X ){ sqlite3Coverage(__LINE__); }
#if defined(SQLITE_COVERAGE_TEST) || defined(SQLITE_DEBUG)
# ifndef SQLITE_AMALGAMATION
extern unsigned int sqlite3CoverageCounter;
# endif
# define testcase(X) if( X ){ sqlite3CoverageCounter += (unsigned)__LINE__; }
#else
# define testcase(X)
#endif

View File

@ -21,16 +21,6 @@
#include <math.h>
#endif
/*
** Routine needed to support the testcase() macro.
*/
#ifdef SQLITE_COVERAGE_TEST
void sqlite3Coverage(int x){
static unsigned dummy = 0;
dummy += (unsigned)x;
}
#endif
/*
** Calls to sqlite3FaultSim() are used to simulate a failure during testing,
** or to bypass normal error detection during testing in order to let

View File

@ -1907,8 +1907,8 @@ static void releaseMemArray(Mem *p, int N){
*/
testcase( p->flags & MEM_Agg );
testcase( p->flags & MEM_Dyn );
testcase( p->xDel==sqlite3VdbeFrameMemDel );
if( p->flags&(MEM_Agg|MEM_Dyn) ){
testcase( (p->flags & MEM_Dyn)!=0 && p->xDel==sqlite3VdbeFrameMemDel );
sqlite3VdbeMemRelease(p);
}else if( p->szMalloc ){
sqlite3DbFreeNN(db, p->zMalloc);