PageRenderTime 23ms CodeModel.GetById 14ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 1ms

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

#
TCL | 33 lines | 18 code | 15 blank | 0 comment | 31 complexity | afa2efbf9cda9229415787f3f1fbf501 MD5 | raw file
 1
 2if [ catch { load ./primitive_types[info sharedlibextension] primitive_types} err_msg ] {
 3	puts stderr "Could not load shared object:\n$err_msg"
 4}
 5
 6
 7if {[val_int 10] != 10 }  { error "bad int map"  }
 8if {[val_schar 10] != 10 } { error "bad char map" }
 9if {[val_short 10] != 10 } { error "bad schar map" }
10
11
12if [catch { val_schar 10000 } ] {} else { error "bad schar map" }
13if [catch { val_uint  -100 } ]  {} else { error "bad uint map"  }
14if [catch { val_uchar -100 } ]  {} else { error "bad uchar map" }
15
16if {[val_uint 10] != 10 }  { error "bad uint map"  }
17if {[val_uchar 10] != 10 } { error "bad uchar map" }
18if {[val_ushort 10] != 10 } { error "bad ushort map" }
19
20
21if {[val_double 10] != 10 } { error "bad double map" }
22if {[val_float 10] != 10 } { error "bad double map" }
23
24
25
26if [catch { val_float hello } ] {} else { error "bad double map" }
27
28if {[val_char c] != "c" } { error "bad char map" }
29if {[val_char "c"] != "c" } { error "bad char map" }
30if {[val_char 101] != "e" } { error "bad char map" }
31
32
33