/* ** 2019 April 02 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** */ #if SQLITE_TEST /* This file is used for testing only */ #include "sqlite3.h" #include "sqliteInt.h" #if defined(INCLUDE_SQLITE_TCL_H) # include "sqlite_tcl.h" #else # include "tcl.h" #endif #ifdef SQLITE_VDBE_COVERAGE static u8 aBranchArray[200000]; static void test_vdbe_branch( void *pCtx, unsigned int iSrc, unsigned char iBranch, unsigned char iType ){ if( iSrc> 4)==4); if( b ){ if( (b & 0x01)==0 ){ appendToList(pRes, i, 0, bFlag ? "less than" : "falls through"); } if( (b & 0x02)==0 ){ appendToList(pRes, i, 1, bFlag ? "equal" : "taken"); } if( (b & 0x04)==0 ){ appendToList(pRes, i, 2, bFlag ? "greater-than" : "NULL"); } } } Tcl_SetObjResult(interp, pRes); Tcl_DecrRefCount(pRes); break; }; default: /* stop */ sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE, 0, 0); break; } return TCL_OK; } #endif /* SQLITE_VDBE_COVERAGE */ int Sqlitetestvdbecov_Init(Tcl_Interp *interp){ #ifdef SQLITE_VDBE_COVERAGE Tcl_CreateObjCommand(interp, "vdbe_coverage", test_vdbe_coverage, 0, 0); #endif return TCL_OK; } #endif