From 63847496f14c813a5d80efd5b7de0f1294ffe1e3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 16:07:11 +0200 Subject: Adding upstream version 3.45.1. Signed-off-by: Daniel Baumann --- src/test_vdbecov.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 src/test_vdbecov.c (limited to 'src/test_vdbecov.c') diff --git a/src/test_vdbecov.c b/src/test_vdbecov.c new file mode 100644 index 0000000..a001b1d --- /dev/null +++ b/src/test_vdbecov.c @@ -0,0 +1,120 @@ +/* +** 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 -- cgit v1.2.3