diff options
-rw-r--r-- | generic/tclExecute.c | 8 | ||||
-rw-r--r-- | tests/execute.test | 236 |
2 files changed, 155 insertions, 89 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 4378d34..c7e05a4 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.6 1999/04/16 00:46:46 stanton Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.7 1999/06/16 21:56:33 stanton Exp $ */ #include "tclInt.h" @@ -1052,7 +1052,7 @@ TclExecuteByteCode(interp, codePtr) case INST_LOAD_SCALAR1: #ifdef TCL_COMPILE_DEBUG - opnd = TclGetInt1AtPtr(pc+1); + opnd = TclGetUInt1AtPtr(pc+1); DECACHE_STACK_INFO(); valuePtr = TclGetIndexedScalar(interp, opnd, /*leaveErrorMsg*/ 1); @@ -1067,8 +1067,8 @@ TclExecuteByteCode(interp, codePtr) TRACE_WITH_OBJ(("%u => ", opnd), valuePtr); #else /* TCL_COMPILE_DEBUG */ DECACHE_STACK_INFO(); - valuePtr = TclGetIndexedScalar(interp, TclGetInt1AtPtr(pc+1), - /*leaveErrorMsg*/ 1); + opnd = TclGetUInt1AtPtr(pc+1); + valuePtr = TclGetIndexedScalar(interp, opnd, /*leaveErrorMsg*/ 1); CACHE_STACK_INFO(); if (valuePtr == NULL) { result = TCL_ERROR; diff --git a/tests/execute.test b/tests/execute.test index aebe67b..71cc822 100644 --- a/tests/execute.test +++ b/tests/execute.test @@ -14,7 +14,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: execute.test,v 1.3 1999/04/16 00:47:27 stanton Exp $ +# RCS: @(#) $Id: execute.test,v 1.4 1999/06/16 21:56:33 stanton Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { source [file join [pwd] [file dirname [info script]] defs.tcl] @@ -44,8 +44,71 @@ set ::tcltest::testConfig(testobj) \ # INST_INVOKE_STK1 not tested # INST_EVAL_STK not tested # INST_EXPR_STK not tested -# INST_LOAD_SCALAR1 not tested -# INST_LOAD_SCALAR4 not tested + +# INST_LOAD_SCALAR1 + +test execute-1.1 {TclExecuteByteCode, INST_LOAD_SCALAR1, small opnd} { + proc foo {} { + set x 1 + return $x + } + foo +} 1 +test execute-1.2 {TclExecuteByteCode, INST_LOAD_SCALAR1, large opnd} { + # Bug: 2243 + set body {} + for {set i 0} {$i < 129} {incr i} { + append body "set x$i x\n" + } + append body { + set y 1 + return $y + } + + proc foo {} $body + foo +} 1 +test execute-1.3 {TclExecuteByteCode, INST_LOAD_SCALAR1, error} { + proc foo {} { + set x 1 + unset x + return $x + } + list [catch {foo} msg] $msg +} {1 {can't read "x": no such variable}} + + +# INST_LOAD_SCALAR4 + +test execute-2.1 {TclExecuteByteCode, INST_LOAD_SCALAR4, simple case} { + set body {} + for {set i 0} {$i < 256} {incr i} { + append body "set x$i x\n" + } + append body { + set y 1 + return $y + } + + proc foo {} $body + foo +} 1 +test execute-2.2 {TclExecuteByteCode, INST_LOAD_SCALAR4, error} { + set body {} + for {set i 0} {$i < 256} {incr i} { + append body "set x$i x\n" + } + append body { + set y 1 + unset y + return $y + } + + proc foo {} $body + list [catch {foo} msg] $msg +} {1 {can't read "y": no such variable}} + + # INST_LOAD_SCALAR_STK not tested # INST_LOAD_ARRAY4 not tested # INST_LOAD_ARRAY1 not tested @@ -90,311 +153,311 @@ set ::tcltest::testConfig(testobj) \ # INST_BITAND not tested # INST_ADD is partially tested: -test execute-1.1 {TclExecuteByteCode, INST_ADD, op1 is int} {testobj} { +test execute-3.1 {TclExecuteByteCode, INST_ADD, op1 is int} {testobj} { set x [testintobj set 0 1] expr {$x + 1} } 2 -test execute-1.2 {TclExecuteByteCode, INST_ADD, op1 is double} {testobj} { +test execute-3.2 {TclExecuteByteCode, INST_ADD, op1 is double} {testobj} { set x [testdoubleobj set 0 1] expr {$x + 1} } 2.0 -test execute-1.3 {TclExecuteByteCode, INST_ADD, op1 is double with string} {testobj} { +test execute-3.3 {TclExecuteByteCode, INST_ADD, op1 is double with string} {testobj} { set x [testintobj set 0 1] testobj convert 0 double expr {$x + 1} } 2 -test execute-1.4 {TclExecuteByteCode, INST_ADD, op1 is string int} {testobj} { +test execute-3.4 {TclExecuteByteCode, INST_ADD, op1 is string int} {testobj} { set x [teststringobj set 0 1] expr {$x + 1} } 2 -test execute-1.5 {TclExecuteByteCode, INST_ADD, op1 is string double} {testobj} { +test execute-3.5 {TclExecuteByteCode, INST_ADD, op1 is string double} {testobj} { set x [teststringobj set 0 1.0] expr {$x + 1} } 2.0 -test execute-1.6 {TclExecuteByteCode, INST_ADD, op1 is non-numeric} {testobj} { +test execute-3.6 {TclExecuteByteCode, INST_ADD, op1 is non-numeric} {testobj} { set x [teststringobj set 0 foo] list [catch {expr {$x + 1}} msg] $msg } {1 {can't use non-numeric string as operand of "+"}} -test execute-1.7 {TclExecuteByteCode, INST_ADD, op2 is int} {testobj} { +test execute-3.7 {TclExecuteByteCode, INST_ADD, op2 is int} {testobj} { set x [testintobj set 0 1] expr {1 + $x} } 2 -test execute-1.8 {TclExecuteByteCode, INST_ADD, op2 is double} {testobj} { +test execute-3.8 {TclExecuteByteCode, INST_ADD, op2 is double} {testobj} { set x [testdoubleobj set 0 1] expr {1 + $x} } 2.0 -test execute-1.9 {TclExecuteByteCode, INST_ADD, op2 is double with string} {testobj} { +test execute-3.9 {TclExecuteByteCode, INST_ADD, op2 is double with string} {testobj} { set x [testintobj set 0 1] testobj convert 0 double expr {1 + $x} } 2 -test execute-1.10 {TclExecuteByteCode, INST_ADD, op2 is string int} {testobj} { +test execute-3.10 {TclExecuteByteCode, INST_ADD, op2 is string int} {testobj} { set x [teststringobj set 0 1] expr {1 + $x} } 2 -test execute-1.11 {TclExecuteByteCode, INST_ADD, op2 is string double} {testobj} { +test execute-3.11 {TclExecuteByteCode, INST_ADD, op2 is string double} {testobj} { set x [teststringobj set 0 1.0] expr {1 + $x} } 2.0 -test execute-1.12 {TclExecuteByteCode, INST_ADD, op2 is non-numeric} {testobj} { +test execute-3.12 {TclExecuteByteCode, INST_ADD, op2 is non-numeric} {testobj} { set x [teststringobj set 0 foo] list [catch {expr {1 + $x}} msg] $msg } {1 {can't use non-numeric string as operand of "+"}} # INST_SUB is partially tested: -test execute-1.13 {TclExecuteByteCode, INST_SUB, op1 is int} {testobj} { +test execute-3.13 {TclExecuteByteCode, INST_SUB, op1 is int} {testobj} { set x [testintobj set 0 1] expr {$x - 1} } 0 -test execute-1.14 {TclExecuteByteCode, INST_SUB, op1 is double} {testobj} { +test execute-3.14 {TclExecuteByteCode, INST_SUB, op1 is double} {testobj} { set x [testdoubleobj set 0 1] expr {$x - 1} } 0.0 -test execute-1.15 {TclExecuteByteCode, INST_SUB, op1 is double with string} {testobj} { +test execute-3.15 {TclExecuteByteCode, INST_SUB, op1 is double with string} {testobj} { set x [testintobj set 0 1] testobj convert 0 double expr {$x - 1} } 0 -test execute-1.16 {TclExecuteByteCode, INST_SUB, op1 is string int} {testobj} { +test execute-3.16 {TclExecuteByteCode, INST_SUB, op1 is string int} {testobj} { set x [teststringobj set 0 1] expr {$x - 1} } 0 -test execute-1.17 {TclExecuteByteCode, INST_SUB, op1 is string double} {testobj} { +test execute-3.17 {TclExecuteByteCode, INST_SUB, op1 is string double} {testobj} { set x [teststringobj set 0 1.0] expr {$x - 1} } 0.0 -test execute-1.18 {TclExecuteByteCode, INST_SUB, op1 is non-numeric} {testobj} { +test execute-3.18 {TclExecuteByteCode, INST_SUB, op1 is non-numeric} {testobj} { set x [teststringobj set 0 foo] list [catch {expr {$x - 1}} msg] $msg } {1 {can't use non-numeric string as operand of "-"}} -test execute-1.19 {TclExecuteByteCode, INST_SUB, op2 is int} {testobj} { +test execute-3.19 {TclExecuteByteCode, INST_SUB, op2 is int} {testobj} { set x [testintobj set 0 1] expr {1 - $x} } 0 -test execute-1.20 {TclExecuteByteCode, INST_SUB, op2 is double} {testobj} { +test execute-3.20 {TclExecuteByteCode, INST_SUB, op2 is double} {testobj} { set x [testdoubleobj set 0 1] expr {1 - $x} } 0.0 -test execute-1.21 {TclExecuteByteCode, INST_SUB, op2 is double with string} {testobj} { +test execute-3.21 {TclExecuteByteCode, INST_SUB, op2 is double with string} {testobj} { set x [testintobj set 0 1] testobj convert 0 double expr {1 - $x} } 0 -test execute-1.22 {TclExecuteByteCode, INST_SUB, op2 is string int} {testobj} { +test execute-3.22 {TclExecuteByteCode, INST_SUB, op2 is string int} {testobj} { set x [teststringobj set 0 1] expr {1 - $x} } 0 -test execute-1.23 {TclExecuteByteCode, INST_SUB, op2 is string double} {testobj} { +test execute-3.23 {TclExecuteByteCode, INST_SUB, op2 is string double} {testobj} { set x [teststringobj set 0 1.0] expr {1 - $x} } 0.0 -test execute-1.24 {TclExecuteByteCode, INST_SUB, op2 is non-numeric} {testobj} { +test execute-3.24 {TclExecuteByteCode, INST_SUB, op2 is non-numeric} {testobj} { set x [teststringobj set 0 foo] list [catch {expr {1 - $x}} msg] $msg } {1 {can't use non-numeric string as operand of "-"}} # INST_MULT is partially tested: -test execute-1.25 {TclExecuteByteCode, INST_MULT, op1 is int} {testobj} { +test execute-3.25 {TclExecuteByteCode, INST_MULT, op1 is int} {testobj} { set x [testintobj set 1 1] expr {$x * 1} } 1 -test execute-1.26 {TclExecuteByteCode, INST_MULT, op1 is double} {testobj} { +test execute-3.26 {TclExecuteByteCode, INST_MULT, op1 is double} {testobj} { set x [testdoubleobj set 1 2.0] expr {$x * 1} } 2.0 -test execute-1.27 {TclExecuteByteCode, INST_MULT, op1 is double with string} {testobj} { +test execute-3.27 {TclExecuteByteCode, INST_MULT, op1 is double with string} {testobj} { set x [testintobj set 1 2] testobj convert 1 double expr {$x * 1} } 2 -test execute-1.28 {TclExecuteByteCode, INST_MULT, op1 is string int} {testobj} { +test execute-3.28 {TclExecuteByteCode, INST_MULT, op1 is string int} {testobj} { set x [teststringobj set 1 1] expr {$x * 1} } 1 -test execute-1.29 {TclExecuteByteCode, INST_MULT, op1 is string double} {testobj} { +test execute-3.29 {TclExecuteByteCode, INST_MULT, op1 is string double} {testobj} { set x [teststringobj set 1 1.0] expr {$x * 1} } 1.0 -test execute-1.30 {TclExecuteByteCode, INST_MULT, op1 is non-numeric} {testobj} { +test execute-3.30 {TclExecuteByteCode, INST_MULT, op1 is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {$x * 1}} msg] $msg } {1 {can't use non-numeric string as operand of "*"}} -test execute-1.31 {TclExecuteByteCode, INST_MULT, op2 is int} {testobj} { +test execute-3.31 {TclExecuteByteCode, INST_MULT, op2 is int} {testobj} { set x [testintobj set 1 1] expr {1 * $x} } 1 -test execute-1.32 {TclExecuteByteCode, INST_MULT, op2 is double} {testobj} { +test execute-3.32 {TclExecuteByteCode, INST_MULT, op2 is double} {testobj} { set x [testdoubleobj set 1 2.0] expr {1 * $x} } 2.0 -test execute-1.33 {TclExecuteByteCode, INST_MULT, op2 is double with string} {testobj} { +test execute-3.33 {TclExecuteByteCode, INST_MULT, op2 is double with string} {testobj} { set x [testintobj set 1 2] testobj convert 1 double expr {1 * $x} } 2 -test execute-1.34 {TclExecuteByteCode, INST_MULT, op2 is string int} {testobj} { +test execute-3.34 {TclExecuteByteCode, INST_MULT, op2 is string int} {testobj} { set x [teststringobj set 1 1] expr {1 * $x} } 1 -test execute-1.35 {TclExecuteByteCode, INST_MULT, op2 is string double} {testobj} { +test execute-3.35 {TclExecuteByteCode, INST_MULT, op2 is string double} {testobj} { set x [teststringobj set 1 1.0] expr {1 * $x} } 1.0 -test execute-1.36 {TclExecuteByteCode, INST_MULT, op2 is non-numeric} {testobj} { +test execute-3.36 {TclExecuteByteCode, INST_MULT, op2 is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {1 * $x}} msg] $msg } {1 {can't use non-numeric string as operand of "*"}} # INST_DIV is partially tested: -test execute-1.37 {TclExecuteByteCode, INST_DIV, op1 is int} {testobj} { +test execute-3.37 {TclExecuteByteCode, INST_DIV, op1 is int} {testobj} { set x [testintobj set 1 1] expr {$x / 1} } 1 -test execute-1.38 {TclExecuteByteCode, INST_DIV, op1 is double} {testobj} { +test execute-3.38 {TclExecuteByteCode, INST_DIV, op1 is double} {testobj} { set x [testdoubleobj set 1 2.0] expr {$x / 1} } 2.0 -test execute-1.39 {TclExecuteByteCode, INST_DIV, op1 is double with string} {testobj} { +test execute-3.39 {TclExecuteByteCode, INST_DIV, op1 is double with string} {testobj} { set x [testintobj set 1 2] testobj convert 1 double expr {$x / 1} } 2 -test execute-1.40 {TclExecuteByteCode, INST_DIV, op1 is string int} {testobj} { +test execute-3.40 {TclExecuteByteCode, INST_DIV, op1 is string int} {testobj} { set x [teststringobj set 1 1] expr {$x / 1} } 1 -test execute-1.41 {TclExecuteByteCode, INST_DIV, op1 is string double} {testobj} { +test execute-3.41 {TclExecuteByteCode, INST_DIV, op1 is string double} {testobj} { set x [teststringobj set 1 1.0] expr {$x / 1} } 1.0 -test execute-1.42 {TclExecuteByteCode, INST_DIV, op1 is non-numeric} {testobj} { +test execute-3.42 {TclExecuteByteCode, INST_DIV, op1 is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {$x / 1}} msg] $msg } {1 {can't use non-numeric string as operand of "/"}} -test execute-1.43 {TclExecuteByteCode, INST_DIV, op2 is int} {testobj} { +test execute-3.43 {TclExecuteByteCode, INST_DIV, op2 is int} {testobj} { set x [testintobj set 1 1] expr {2 / $x} } 2 -test execute-1.44 {TclExecuteByteCode, INST_DIV, op2 is double} {testobj} { +test execute-3.44 {TclExecuteByteCode, INST_DIV, op2 is double} {testobj} { set x [testdoubleobj set 1 1.0] expr {2 / $x} } 2.0 -test execute-1.45 {TclExecuteByteCode, INST_DIV, op2 is double with string} {testobj} { +test execute-3.45 {TclExecuteByteCode, INST_DIV, op2 is double with string} {testobj} { set x [testintobj set 1 1] testobj convert 1 double expr {2 / $x} } 2 -test execute-1.46 {TclExecuteByteCode, INST_DIV, op2 is string int} {testobj} { +test execute-3.46 {TclExecuteByteCode, INST_DIV, op2 is string int} {testobj} { set x [teststringobj set 1 1] expr {2 / $x} } 2 -test execute-1.47 {TclExecuteByteCode, INST_DIV, op2 is string double} {testobj} { +test execute-3.47 {TclExecuteByteCode, INST_DIV, op2 is string double} {testobj} { set x [teststringobj set 1 1.0] expr {2 / $x} } 2.0 -test execute-1.48 {TclExecuteByteCode, INST_DIV, op2 is non-numeric} {testobj} { +test execute-3.48 {TclExecuteByteCode, INST_DIV, op2 is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {1 / $x}} msg] $msg } {1 {can't use non-numeric string as operand of "/"}} # INST_UPLUS is partially tested: -test execute-1.49 {TclExecuteByteCode, INST_UPLUS, op is int} {testobj} { +test execute-3.49 {TclExecuteByteCode, INST_UPLUS, op is int} {testobj} { set x [testintobj set 1 1] expr {+ $x} } 1 -test execute-1.50 {TclExecuteByteCode, INST_UPLUS, op is double} {testobj} { +test execute-3.50 {TclExecuteByteCode, INST_UPLUS, op is double} {testobj} { set x [testdoubleobj set 1 1.0] expr {+ $x} } 1.0 -test execute-1.51 {TclExecuteByteCode, INST_UPLUS, op is double with string} {testobj} { +test execute-3.51 {TclExecuteByteCode, INST_UPLUS, op is double with string} {testobj} { set x [testintobj set 1 1] testobj convert 1 double expr {+ $x} } 1 -test execute-1.52 {TclExecuteByteCode, INST_UPLUS, op is string int} {testobj} { +test execute-3.52 {TclExecuteByteCode, INST_UPLUS, op is string int} {testobj} { set x [teststringobj set 1 1] expr {+ $x} } 1 -test execute-1.53 {TclExecuteByteCode, INST_UPLUS, op is string double} {testobj} { +test execute-3.53 {TclExecuteByteCode, INST_UPLUS, op is string double} {testobj} { set x [teststringobj set 1 1.0] expr {+ $x} } 1.0 -test execute-1.54 {TclExecuteByteCode, INST_UPLUS, op is non-numeric} {testobj} { +test execute-3.54 {TclExecuteByteCode, INST_UPLUS, op is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {+ $x}} msg] $msg } {1 {can't use non-numeric string as operand of "+"}} # INST_UMINUS is partially tested: -test execute-1.55 {TclExecuteByteCode, INST_UMINUS, op is int} {testobj} { +test execute-3.55 {TclExecuteByteCode, INST_UMINUS, op is int} {testobj} { set x [testintobj set 1 1] expr {- $x} } -1 -test execute-1.56 {TclExecuteByteCode, INST_UMINUS, op is double} {testobj} { +test execute-3.56 {TclExecuteByteCode, INST_UMINUS, op is double} {testobj} { set x [testdoubleobj set 1 1.0] expr {- $x} } -1.0 -test execute-1.57 {TclExecuteByteCode, INST_UMINUS, op is double with string} {testobj} { +test execute-3.57 {TclExecuteByteCode, INST_UMINUS, op is double with string} {testobj} { set x [testintobj set 1 1] testobj convert 1 double expr {- $x} } -1 -test execute-1.58 {TclExecuteByteCode, INST_UMINUS, op is string int} {testobj} { +test execute-3.58 {TclExecuteByteCode, INST_UMINUS, op is string int} {testobj} { set x [teststringobj set 1 1] expr {- $x} } -1 -test execute-1.59 {TclExecuteByteCode, INST_UMINUS, op is string double} {testobj} { +test execute-3.59 {TclExecuteByteCode, INST_UMINUS, op is string double} {testobj} { set x [teststringobj set 1 1.0] expr {- $x} } -1.0 -test execute-1.60 {TclExecuteByteCode, INST_UMINUS, op is non-numeric} {testobj} { +test execute-3.60 {TclExecuteByteCode, INST_UMINUS, op is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {- $x}} msg] $msg } {1 {can't use non-numeric string as operand of "-"}} # INST_LNOT is partially tested: -test execute-1.61 {TclExecuteByteCode, INST_LNOT, op is int} {testobj} { +test execute-3.61 {TclExecuteByteCode, INST_LNOT, op is int} {testobj} { set x [testintobj set 1 2] expr {! $x} } 0 -test execute-1.62 {TclExecuteByteCode, INST_LNOT, op is int} {testobj} { +test execute-3.62 {TclExecuteByteCode, INST_LNOT, op is int} {testobj} { set x [testintobj set 1 0] expr {! $x} } 1 -test execute-1.63 {TclExecuteByteCode, INST_LNOT, op is double} {testobj} { +test execute-3.63 {TclExecuteByteCode, INST_LNOT, op is double} {testobj} { set x [testdoubleobj set 1 1.0] expr {! $x} } 0 -test execute-1.64 {TclExecuteByteCode, INST_LNOT, op is double} {testobj} { +test execute-3.64 {TclExecuteByteCode, INST_LNOT, op is double} {testobj} { set x [testdoubleobj set 1 0.0] expr {! $x} } 1 -test execute-1.65 {TclExecuteByteCode, INST_LNOT, op is double with string} {testobj} { +test execute-3.65 {TclExecuteByteCode, INST_LNOT, op is double with string} {testobj} { set x [testintobj set 1 1] testobj convert 1 double expr {! $x} } 0 -test execute-1.66 {TclExecuteByteCode, INST_LNOT, op is double with string} {testobj} { +test execute-3.66 {TclExecuteByteCode, INST_LNOT, op is double with string} {testobj} { set x [testintobj set 1 0] testobj convert 1 double expr {! $x} } 1 -test execute-1.67 {TclExecuteByteCode, INST_LNOT, op is string int} {testobj} { +test execute-3.67 {TclExecuteByteCode, INST_LNOT, op is string int} {testobj} { set x [teststringobj set 1 1] expr {! $x} } 0 -test execute-1.68 {TclExecuteByteCode, INST_LNOT, op is string int} {testobj} { +test execute-3.68 {TclExecuteByteCode, INST_LNOT, op is string int} {testobj} { set x [teststringobj set 1 0] expr {! $x} } 1 -test execute-1.69 {TclExecuteByteCode, INST_LNOT, op is string double} {testobj} { +test execute-3.69 {TclExecuteByteCode, INST_LNOT, op is string double} {testobj} { set x [teststringobj set 1 1.0] expr {! $x} } 0 -test execute-1.70 {TclExecuteByteCode, INST_LNOT, op is string double} {testobj} { +test execute-3.70 {TclExecuteByteCode, INST_LNOT, op is string double} {testobj} { set x [teststringobj set 1 0.0] expr {! $x} } 1 -test execute-1.71 {TclExecuteByteCode, INST_LNOT, op is non-numeric} {testobj} { +test execute-3.71 {TclExecuteByteCode, INST_LNOT, op is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {! $x}} msg] $msg } {1 {can't use non-numeric string as operand of "!"}} @@ -404,28 +467,28 @@ test execute-1.71 {TclExecuteByteCode, INST_LNOT, op is non-numeric} {testobj} { # INST_CALL_FUNC1 not tested # INST_TRY_CVT_TO_NUMERIC is partially tested: -test execute-1.72 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is int} {testobj} { +test execute-3.72 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is int} {testobj} { set x [testintobj set 1 1] expr {$x} } 1 -test execute-1.73 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is double} {testobj} { +test execute-3.73 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is double} {testobj} { set x [testdoubleobj set 1 1.0] expr {$x} } 1.0 -test execute-1.74 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is double with string} {testobj} { +test execute-3.74 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is double with string} {testobj} { set x [testintobj set 1 1] testobj convert 1 double expr {$x} } 1 -test execute-1.75 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is string int} {testobj} { +test execute-3.75 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is string int} {testobj} { set x [teststringobj set 1 1] expr {$x} } 1 -test execute-1.76 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is string double} {testobj} { +test execute-3.76 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is string double} {testobj} { set x [teststringobj set 1 1.0] expr {$x} } 1.0 -test execute-1.77 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is non-numeric} {testobj} { +test execute-3.77 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is non-numeric} {testobj} { set x [teststringobj set 1 foo] expr {$x} } foo @@ -439,7 +502,7 @@ test execute-1.77 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is non-numeri # INST_PUSH_RESULT not tested # INST_PUSH_RETURN_CODE not tested -test execute-2.1 {Tcl_GetCommandFromObj, convert to tclCmdNameType} { +test execute-4.1 {Tcl_GetCommandFromObj, convert to tclCmdNameType} { catch {eval namespace delete [namespace children :: test_ns_*]} catch {unset x} catch {unset y} @@ -457,7 +520,7 @@ test execute-2.1 {Tcl_GetCommandFromObj, convert to tclCmdNameType} { [catch {namespace which -command ${x}${y}cmd2} msg] $msg \ [catch {namespace which -command ${x}${y}:cmd2} msg] $msg } {::test_ns_1::test_ns_2::cmd1 0 {} 0 {}} -test execute-2.2 {Tcl_GetCommandFromObj, check if cached tclCmdNameType is invalid} { +test execute-4.2 {Tcl_GetCommandFromObj, check if cached tclCmdNameType is invalid} { catch {eval namespace delete [namespace children :: test_ns_*]} catch {rename foo ""} catch {unset l} @@ -479,7 +542,7 @@ test execute-2.2 {Tcl_GetCommandFromObj, check if cached tclCmdNameType is inval lappend l [test_ns_1::whichFoo] set l } {::foo ::test_ns_1::foo} -test execute-2.3 {Tcl_GetCommandFromObj, command never found} { +test execute-4.3 {Tcl_GetCommandFromObj, command never found} { catch {eval namespace delete [namespace children :: test_ns_*]} catch {rename foo ""} namespace eval test_ns_1 { @@ -497,7 +560,7 @@ test execute-2.3 {Tcl_GetCommandFromObj, command never found} { [catch {namespace eval test_ns_1 {namespace which -command foo}} msg] $msg } {::test_ns_1::foo {} 0 {}} -test execute-3.1 {SetCmdNameFromAny, set cmd name to empty heap string if NULL} { +test execute-5.1 {SetCmdNameFromAny, set cmd name to empty heap string if NULL} { catch {eval namespace delete [namespace children :: test_ns_*]} catch {unset l} proc {} {} {return {}} @@ -507,7 +570,7 @@ test execute-3.1 {SetCmdNameFromAny, set cmd name to empty heap string if NULL} {} } {} -test execute-4.1 {UpdateStringOfCmdName: called for duplicate of empty cmdName object} { +test execute-6.1 {UpdateStringOfCmdName: called for duplicate of empty cmdName object} { proc {} {} {} proc { } {} {} proc p {} { @@ -546,3 +609,6 @@ return + + + |