diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2010-06-02 20:53:17 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2010-06-02 20:53:17 +0000 |
commit | 2824b0cbb66e715490e1ef13250bd675d87b32d9 (patch) | |
tree | c3bc8d54c6d73f2b7ce08cac34172dbc9f5e5b95 /trunk/Examples/test-suite/python/minherit_runme.py | |
parent | 289cfef4b4766ff266f3b1bdda8ca3a952e5a047 (diff) | |
download | swig-2.0.0.tar.gz |
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/tags/rel-2.0.0@12089 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'trunk/Examples/test-suite/python/minherit_runme.py')
-rw-r--r-- | trunk/Examples/test-suite/python/minherit_runme.py | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/trunk/Examples/test-suite/python/minherit_runme.py b/trunk/Examples/test-suite/python/minherit_runme.py new file mode 100644 index 000000000..d7ad0b36b --- /dev/null +++ b/trunk/Examples/test-suite/python/minherit_runme.py @@ -0,0 +1,71 @@ + +import minherit + +a = minherit.Foo() +b = minherit.Bar() +c = minherit.FooBar() +d = minherit.Spam() + +if a.xget() != 1: + raise RuntimeError, "Bad attribute value" + +if b.yget() != 2: + raise RuntimeError, "Bad attribute value" + +if c.xget() != 1 or c.yget() != 2 or c.zget() != 3: + raise RuntimeError, "Bad attribute value" + +if d.xget() != 1 or d.yget() != 2 or d.zget() != 3 or d.wget() != 4: + raise RuntimeError, "Bad attribute value" + + +if minherit.xget(a) != 1: + raise RuntimeError, "Bad attribute value %d" % (minherit.xget(a)) + +if minherit.yget(b) != 2: + raise RuntimeError, "Bad attribute value %d" % (minherit.yget(b)) + +if minherit.xget(c) != 1 or minherit.yget(c) != 2 or minherit.zget(c) != 3: + raise RuntimeError, "Bad attribute value %d %d %d" % (minherit.xget(c), minherit.yget(c), minherit.zget(c)) + +if minherit.xget(d) != 1 or minherit.yget(d) != 2 or minherit.zget(d) != 3 or minherit.wget(d) != 4: + raise RuntimeError, "Bad attribute value %d %d %d %d" % (minherit.xget(d), minherit.yget(d), minherit.zget(d), minherit.wget(d)) + +# Cleanse all of the pointers and see what happens + +aa = minherit.toFooPtr(a) +bb = minherit.toBarPtr(b) +cc = minherit.toFooBarPtr(c) +dd = minherit.toSpamPtr(d) + +if aa.xget() != 1: + raise RuntimeError, "Bad attribute value" + +if bb.yget() != 2: + raise RuntimeError, "Bad attribute value" + +if cc.xget() != 1 or cc.yget() != 2 or cc.zget() != 3: + raise RuntimeError, "Bad attribute value" + +if dd.xget() != 1 or dd.yget() != 2 or dd.zget() != 3 or dd.wget() != 4: + raise RuntimeError, "Bad attribute value" + +if minherit.xget(aa) != 1: + raise RuntimeError, "Bad attribute value %d" % (minherit.xget(aa)) + +if minherit.yget(bb) != 2: + raise RuntimeError, "Bad attribute value %d" % (minherit.yget(bb)) + +if minherit.xget(cc) != 1 or minherit.yget(cc) != 2 or minherit.zget(cc) != 3: + raise RuntimeError, "Bad attribute value %d %d %d" % (minherit.xget(cc), minherit.yget(cc), minherit.zget(cc)) + +if minherit.xget(dd) != 1 or minherit.yget(dd) != 2 or minherit.zget(dd) != 3 or minherit.wget(dd) != 4: + raise RuntimeError, "Bad attribute value %d %d %d %d" % (minherit.xget(dd), minherit.yget(dd), minherit.zget(dd), minherit.wget(dd)) + + + + + + + + |