summaryrefslogtreecommitdiff
path: root/py/test/Ice/slicing/exceptions/AllTests.py
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2005-05-19 01:47:35 +0000
committerMichi Henning <michi@zeroc.com>2005-05-19 01:47:35 +0000
commitc672443296deee643ff325b23738f413b557488d (patch)
tree69649b23f0ce78188b4d250a095161ebbcfc8973 /py/test/Ice/slicing/exceptions/AllTests.py
parentFixed http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=324. (diff)
downloadice-c672443296deee643ff325b23738f413b557488d.tar.bz2
ice-c672443296deee643ff325b23738f413b557488d.tar.xz
ice-c672443296deee643ff325b23738f413b557488d.zip
Fixed http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=324
Diffstat (limited to 'py/test/Ice/slicing/exceptions/AllTests.py')
-rw-r--r--py/test/Ice/slicing/exceptions/AllTests.py52
1 files changed, 13 insertions, 39 deletions
diff --git a/py/test/Ice/slicing/exceptions/AllTests.py b/py/test/Ice/slicing/exceptions/AllTests.py
index 32a0648c6bc..71b1db3776f 100644
--- a/py/test/Ice/slicing/exceptions/AllTests.py
+++ b/py/test/Ice/slicing/exceptions/AllTests.py
@@ -240,16 +240,14 @@ def allTests(communicator):
t = Test.TestIntfPrx.checkedCast(obj)
print "base... ",
- gotException = False
try:
t.baseAsBase()
+ test(false)
except Test.Base, b:
test(b.b == "Base.b")
test(b.ice_name() == "Test::Base")
- gotException = True
except:
test(False)
- test(gotException)
print "ok"
print "base (AMI)... ",
@@ -259,16 +257,14 @@ def allTests(communicator):
print "ok"
print "slicing of unknown derived... ",
- gotException = False
try:
t.unknownDerivedAsBase()
+ test(false)
except Test.Base, b:
test(b.b == "UnknownDerived.b")
test(b.ice_name() == "Test::Base")
- gotException = True
except:
test(False)
- test(gotException)
print "ok"
print "slicing of unknown derived (AMI)... ",
@@ -278,17 +274,15 @@ def allTests(communicator):
print "ok"
print "non-slicing of known derived as base... ",
- gotException = False
try:
t.knownDerivedAsBase()
+ test(false)
except Test.KnownDerived, k:
test(k.b == "KnownDerived.b")
test(k.kd == "KnownDerived.kd")
test(k.ice_name() == "Test::KnownDerived")
- gotException = True
except:
test(False)
- test(gotException)
print "ok"
print "non-slicing of known derived as base (AMI)... ",
@@ -298,17 +292,15 @@ def allTests(communicator):
print "ok"
print "non-slicing of known derived as derived... ",
- gotException = False
try:
t.knownDerivedAsKnownDerived()
+ test(false)
except Test.KnownDerived, k:
test(k.b == "KnownDerived.b")
test(k.kd == "KnownDerived.kd")
test(k.ice_name() == "Test::KnownDerived")
- gotException = True
except:
test(False)
- test(gotException)
print "ok"
print "non-slicing of known derived as derived (AMI)... ",
@@ -318,16 +310,14 @@ def allTests(communicator):
print "ok"
print "slicing of unknown intermediate as base... ",
- gotException = False
try:
t.unknownIntermediateAsBase()
+ test(false)
except Test.Base, b:
test(b.b == "UnknownIntermediate.b")
test(b.ice_name() == "Test::Base")
- gotException = True
except:
test(False)
- test(gotException)
print "ok"
print "slicing of unknown intermediate as base (AMI)... ",
@@ -337,17 +327,15 @@ def allTests(communicator):
print "ok"
print "slicing of known intermediate as base... ",
- gotException = False
try:
t.knownIntermediateAsBase()
+ test(false)
except Test.KnownIntermediate, ki:
test(ki.b == "KnownIntermediate.b")
test(ki.ki == "KnownIntermediate.ki")
test(ki.ice_name() == "Test::KnownIntermediate")
- gotException = True
except:
test(False)
- test(gotException)
print "ok"
print "slicing of known intermediate as base (AMI)... ",
@@ -357,18 +345,16 @@ def allTests(communicator):
print "ok"
print "slicing of known most derived as base... ",
- gotException = False
try:
t.knownMostDerivedAsBase()
+ test(false)
except Test.KnownMostDerived, kmd:
test(kmd.b == "KnownMostDerived.b")
test(kmd.ki == "KnownMostDerived.ki")
test(kmd.kmd == "KnownMostDerived.kmd")
test(kmd.ice_name() == "Test::KnownMostDerived")
- gotException = True
except:
test(False)
- test(gotException)
print "ok"
print "slicing of known most derived as base (AMI)... ",
@@ -378,17 +364,15 @@ def allTests(communicator):
print "ok"
print "non-slicing of known intermediate as intermediate... ",
- gotException = False
try:
t.knownIntermediateAsKnownIntermediate()
+ test(false)
except Test.KnownIntermediate, ki:
test(ki.b == "KnownIntermediate.b")
test(ki.ki == "KnownIntermediate.ki")
test(ki.ice_name() == "Test::KnownIntermediate")
- gotException = True
except:
test(False)
- test(gotException)
print "ok"
print "non-slicing of known intermediate as intermediate (AMI)... ",
@@ -398,18 +382,16 @@ def allTests(communicator):
print "ok"
print "non-slicing of known most derived exception as intermediate... ",
- gotException = False
try:
t.knownMostDerivedAsKnownIntermediate()
+ test(false)
except Test.KnownMostDerived, kmd:
test(kmd.b == "KnownMostDerived.b")
test(kmd.ki == "KnownMostDerived.ki")
test(kmd.kmd == "KnownMostDerived.kmd")
test(kmd.ice_name() == "Test::KnownMostDerived")
- gotException = True
except:
test(False)
- test(gotException)
print "ok"
print "non-slicing of known most derived as intermediate (AMI)... ",
@@ -419,18 +401,16 @@ def allTests(communicator):
print "ok"
print "non-slicing of known most derived as most derived... ",
- gotException = False
try:
t.knownMostDerivedAsKnownMostDerived()
+ test(false)
except Test.KnownMostDerived, kmd:
test(kmd.b == "KnownMostDerived.b")
test(kmd.ki == "KnownMostDerived.ki")
test(kmd.kmd == "KnownMostDerived.kmd")
test(kmd.ice_name() == "Test::KnownMostDerived")
- gotException = True
except:
test(False)
- test(gotException)
print "ok"
print "non-slicing of known most derived as most derived (AMI)... ",
@@ -440,17 +420,15 @@ def allTests(communicator):
print "ok"
print "slicing of unknown most derived, known intermediate as base... ",
- gotException = False
try:
t.unknownMostDerived1AsBase()
+ test(false)
except Test.KnownIntermediate, ki:
test(ki.b == "UnknownMostDerived1.b")
test(ki.ki == "UnknownMostDerived1.ki")
test(ki.ice_name() == "Test::KnownIntermediate")
- gotException = True
except:
test(False)
- test(gotException)
print "ok"
print "slicing of unknown most derived, known intermediate as base (AMI)... ",
@@ -460,17 +438,15 @@ def allTests(communicator):
print "ok"
print "slicing of unknown most derived, known intermediate as intermediate... ",
- gotException = False
try:
t.unknownMostDerived1AsKnownIntermediate()
+ test(false)
except Test.KnownIntermediate, ki:
test(ki.b == "UnknownMostDerived1.b")
test(ki.ki == "UnknownMostDerived1.ki")
test(ki.ice_name() == "Test::KnownIntermediate")
- gotException = True
except:
test(False)
- test(gotException)
print "ok"
print "slicing of unknown most derived, known intermediate as intermediate (AMI)... ",
@@ -480,16 +456,14 @@ def allTests(communicator):
print "ok"
print "slicing of unknown most derived, unknown intermediate as base... ",
- gotException = False
try:
t.unknownMostDerived2AsBase()
+ test(false)
except Test.Base, b:
test(b.b == "UnknownMostDerived2.b")
test(b.ice_name() == "Test::Base")
- gotException = True
except:
test(False)
- test(gotException)
print "ok"
print "slicing of unknown most derived, unknown intermediate as base (AMI)... ",