diff options
Diffstat (limited to 'Examples/test-suite/tcl/li_std_vector_runme.tcl')
-rw-r--r-- | Examples/test-suite/tcl/li_std_vector_runme.tcl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Examples/test-suite/tcl/li_std_vector_runme.tcl b/Examples/test-suite/tcl/li_std_vector_runme.tcl new file mode 100644 index 000000000..24aa9aa42 --- /dev/null +++ b/Examples/test-suite/tcl/li_std_vector_runme.tcl @@ -0,0 +1,15 @@ + +if [ catch { load ./li_std_vector[info sharedlibextension] Li_std_vector} err_msg ] { + puts stderr "Could not load shared object:\n$err_msg" +} + +# Regression test for bug fixed in SWIG 4.1.0. +if {[sum []] != 0} { error "bad vector sum" } + +IntPtrVector v 6 +if {[v empty] != 0} { error "bad std::vector::empty()" } +if {[v size] != 6} { error "bad std::vector::size()" } +# Test that calling get succeeds +v get 0 +v pop +if {[v size] != 5} { error "bad std::vector::size()" } |