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

Add an assert() and five testcase() macros to the OP_Cast opcode implementation

to help verify that it is fully tested.

FossilOrigin-Name: af364cce9da0961593ef876b646197f82df08ad5
This commit is contained in:
drh
2014-08-25 22:37:19 +00:00
parent ec3e4f753b
commit 05bbb2e824
3 changed files with 13 additions and 7 deletions

View File

@@ -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);