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

# · TCL · 73 lines · 55 code · 15 blank · 3 comment · 27 complexity · 5490d0086480b2810ec64069e584071b MD5 · raw file

  1. if [ catch { load ./bools[info sharedlibextension] bools} err_msg ] {
  2. puts stderr "Could not load shared object:\n$err_msg"
  3. }
  4. # bool constant check
  5. if {$constbool != 0} {
  6. puts stderr "Runtime test 1 failed"
  7. exit 1
  8. }
  9. # bool variables check
  10. if {$bool1 != 1} {
  11. puts stderr "Runtime test 2 failed"
  12. exit 1
  13. }
  14. if {$bool2 != 0} {
  15. puts stderr "Runtime test 3 failed"
  16. exit 1
  17. }
  18. if { [ value $pbool ] != $bool1} {
  19. puts stderr "Runtime test 4 failed"
  20. exit 1
  21. }
  22. if { [ value $rbool ] != $bool2} {
  23. puts stderr "Runtime test 5 failed"
  24. exit 1
  25. }
  26. if { [ value $const_pbool ] != $bool1} {
  27. puts stderr "Runtime test 6 failed"
  28. exit 1
  29. }
  30. if { $const_rbool != $bool2} {
  31. puts stderr "Runtime test 7 failed"
  32. exit 1
  33. }
  34. # bool functions check
  35. if { [ bo 0 ] != 0} {
  36. puts stderr "Runtime test 8 failed"
  37. exit 1
  38. }
  39. if { [ bo 1 ] != 1} {
  40. puts stderr "Runtime test 9 failed"
  41. exit 1
  42. }
  43. if { [ value [ rbo $rbool ] ] != [ value $rbool ]} {
  44. puts stderr "Runtime test 10 failed"
  45. exit 1
  46. }
  47. if { [ value [ pbo $pbool ] ] != [ value $pbool ]} {
  48. puts stderr "Runtime test 11 failed"
  49. exit 1
  50. }
  51. if { [ const_rbo $const_rbool ] != $const_rbool } {
  52. puts stderr "Runtime test 12 failed"
  53. exit 1
  54. }
  55. if { [ value [ const_pbo $const_pbool ] ] != [ value $const_pbool ]} {
  56. puts stderr "Runtime test 13 failed"
  57. exit 1
  58. }