PageRenderTime 26ms CodeModel.GetById 14ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

/trunk/Examples/test-suite/tcl/primitive_ref_runme.tcl

#
TCL | 19 lines | 14 code | 3 blank | 2 comment | 23 complexity | 8d418c307fc8f0c1118dfdc3f682b8c2 MD5 | raw file
 1# Primitive ref testcase.  Tests to make sure references to 
 2# primitive types are passed by value
 3
 4if [ catch { load ./primitive_ref[info sharedlibextension] primitive_ref} err_msg ] {
 5	puts stderr "Could not load shared object:\n$err_msg"
 6}
 7
 8if { [ref_int 3] != 3 } { puts stderr "ref_int failed" }
 9if { [ref_uint 3] != 3 } { puts stderr "ref_uint failed" }
10if { [ref_short 3] != 3 } { puts stderr "ref_short failed" }
11if { [ref_ushort 3] != 3 } { puts stderr "ref_ushort failed" }
12if { [ref_long 3] != 3 } { puts stderr "ref_long failed" }
13if { [ref_ulong 3] != 3 } { puts stderr "ref_ulong failed" }
14if { [ref_schar 3] != 3 } { puts stderr "ref_schar failed" }
15if { [ref_uchar 3] != 3 } { puts stderr "ref_uchar failed" }
16if { [ref_float 3.5] != 3.5 } { puts stderr "ref_float failed" }
17if { [ref_double 3.5] != 3.5 } { puts stderr "ref_double failed" }
18if { [ref_char x] != "x" } { puts stderr "ref_char failed" }
19