diff options
author | drh <drh@noemail.net> | 2014-08-25 22:37:19 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-08-25 22:37:19 +0000 |
commit | 05bbb2e824df2af559aaf301a4a44f16c080ffc8 (patch) | |
tree | eefc1f51aae6eeeefcc13dcd7823a4723d044477 /src | |
parent | ec3e4f753bbd67ea8d8a931291b4c9293208d55e (diff) | |
download | sqlite-05bbb2e824df2af559aaf301a4a44f16c080ffc8.tar.gz sqlite-05bbb2e824df2af559aaf301a4a44f16c080ffc8.zip |
Add an assert() and five testcase() macros to the OP_Cast opcode implementation
to help verify that it is fully tested.
FossilOrigin-Name: af364cce9da0961593ef876b646197f82df08ad5
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbe.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vdbe.c b/src/vdbe.c index ec2b64f77..5d440d825 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -1783,6 +1783,12 @@ case OP_RealAffinity: { /* in1 */ ** A NULL value is not changed by this routine. It remains NULL. */ case OP_Cast: { /* in1 */ + assert( pOp->p2>=SQLITE_AFF_TEXT && pOp->p2<=SQLITE_AFF_REAL ); + testcase( pOp->p2==SQLITE_AFF_TEXT ); + testcase( pOp->p2==SQLITE_AFF_NONE ); + testcase( pOp->p2==SQLITE_AFF_NUMERIC ); + testcase( pOp->p2==SQLITE_AFF_INTEGER ); + testcase( pOp->p2==SQLITE_AFF_REAL ); pIn1 = &aMem[pOp->p1]; memAboutToChange(p, pIn1); rc = ExpandBlob(pIn1); |