summaryrefslogtreecommitdiff
path: root/Examples/test-suite/tcl/newobject1_runme.tcl
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2005-08-18 20:38:23 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2005-08-18 20:38:23 +0000
commit878f80fc0c07d1cfee750ccac3034b5a00c12630 (patch)
tree4090d42099e672424b0f25cc096095d8940692d5 /Examples/test-suite/tcl/newobject1_runme.tcl
parentb366ef3d48c1e7896b0e7aa72d3af69a15cc7e2c (diff)
downloadswig-878f80fc0c07d1cfee750ccac3034b5a00c12630.tar.gz
%newobject tests from Bob Marinier
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7378 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/test-suite/tcl/newobject1_runme.tcl')
-rw-r--r--Examples/test-suite/tcl/newobject1_runme.tcl27
1 files changed, 27 insertions, 0 deletions
diff --git a/Examples/test-suite/tcl/newobject1_runme.tcl b/Examples/test-suite/tcl/newobject1_runme.tcl
new file mode 100644
index 000000000..e8806b4f8
--- /dev/null
+++ b/Examples/test-suite/tcl/newobject1_runme.tcl
@@ -0,0 +1,27 @@
+if [ catch { load ./newobject1[info sharedlibextension] newobject1} err_msg ] {
+ puts stderr "Could not load shared object:\n$err_msg"
+}
+
+set foo1 [Foo_makeFoo]
+if {[Foo_fooCount] != 1} {
+ puts stderr "newobject1 test 1 failed"
+ exit 1
+}
+
+set foo2 [$foo1 makeMore]
+if {[Foo_fooCount] != 2} {
+ puts stderr "newobject1 test 2 failed"
+ exit 1
+}
+
+$foo1 -delete
+if {[Foo_fooCount] != 1} {
+ puts stderr "newobject1 test 3 failed"
+ exit 1
+}
+
+$foo2 -delete
+if {[Foo_fooCount] != 0} {
+ puts stderr "newobject1 test 4 failed"
+ exit 1
+}