PageRenderTime 17ms CodeModel.GetById 2ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
TCL | 108 lines | 87 code | 18 blank | 3 comment | 35 complexity | a2ee0397b284e64775b1356d849e589f MD5 | raw file
  1if [ catch { load ./reference_global_vars[info sharedlibextension] reference_global_vars} err_msg ] {
  2	puts stderr "Could not load shared object:\n$err_msg"
  3}
  4
  5# const class reference variable
  6if {[ [getconstTC ] cget -num] != 33 } {
  7   puts stderr "test 1 failed"
  8   exit 1
  9}
 10
 11# primitive reference variables
 12set var_bool [createref_bool 0]
 13if {[value_bool $var_bool] != 0} {
 14   puts stderr "test 2 failed"
 15   exit 1
 16}
 17
 18set var_bool [createref_bool 1]
 19if {[value_bool $var_bool] != 1} {
 20   puts stderr "test 3 failed"
 21   exit 1
 22}
 23
 24set var_char [createref_char "w"]
 25if {[value_char $var_char] != "w"} {
 26   puts stderr "test 4 failed"
 27   exit 1
 28}
 29
 30set var_unsigned_char [createref_unsigned_char 10]
 31if {[value_unsigned_char $var_unsigned_char] != 10} {
 32   puts stderr "test 5 failed"
 33   exit 1
 34}
 35
 36set var_signed_char [createref_signed_char 10]
 37if {[value_signed_char $var_signed_char] != 10} {
 38   puts stderr "test 6 failed"
 39   exit 1
 40}
 41
 42set var_short [createref_short 10]
 43if {[value_short $var_short] != 10} {
 44   puts stderr "test 7 failed"
 45   exit 1
 46}
 47
 48set var_unsigned_short [createref_unsigned_short 10]
 49if {[value_unsigned_short $var_unsigned_short] != 10} {
 50   puts stderr "test 8 failed"
 51   exit 1
 52}
 53
 54set var_int [createref_int 10]
 55if {[value_int $var_int] != 10} {
 56   puts stderr "test 9 failed"
 57   exit 1
 58}
 59
 60set var_unsigned_int [createref_unsigned_int 10]
 61if {[value_unsigned_int $var_unsigned_int] != 10} {
 62   puts stderr "test 10 failed"
 63   exit 1
 64}
 65
 66set var_long [createref_long 10]
 67if {[value_long $var_long] != 10} {
 68   puts stderr "test 11 failed"
 69   exit 1
 70}
 71
 72set var_unsigned_long [createref_unsigned_long 10]
 73if {[value_unsigned_long $var_unsigned_long] != 10} {
 74   puts stderr "test 12 failed"
 75   exit 1
 76}
 77
 78set var_long_long [createref_long_long 10]
 79if {[value_long_long $var_long_long] != 10} {
 80   puts stderr "test 13 failed"
 81   exit 1
 82}
 83
 84set var_unsigned_long_long [createref_unsigned_long_long 10]
 85if {[value_unsigned_long_long $var_unsigned_long_long] != 10} {
 86   puts stderr "test 14 failed"
 87   exit 1
 88}
 89
 90set var_float [createref_float 10.5]
 91if {[value_float $var_float] != 10.5} {
 92   puts stderr "test 15 failed"
 93   exit 1
 94}
 95
 96set var_double [createref_double 10.5]
 97if {[value_double $var_double] != 10.5} {
 98   puts stderr "test 16 failed"
 99   exit 1
100}
101
102# class reference variable
103set var_TestClass [createref_TestClass [TestClass tc 20] ]
104if {[ [value_TestClass $var_TestClass] cget -num] != 20} {
105   puts stderr "test 17 failed"
106   exit 1
107}
108