diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2020-02-25 15:07:51 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2020-02-25 15:07:51 (GMT) |
commit | 1eeefb073a3dec57e47e1b30b8df7467358857e7 (patch) | |
tree | 710b9ce60996830d6aa84c191bc5f7926a79f418 /tests/oo.test | |
parent | f0ead2e3090a454ed612a59517b46fb47c794600 (diff) | |
download | tcl-1eeefb073a3dec57e47e1b30b8df7467358857e7.zip tcl-1eeefb073a3dec57e47e1b30b8df7467358857e7.tar.gz tcl-1eeefb073a3dec57e47e1b30b8df7467358857e7.tar.bz2 |
Ensure that we release the correct references when an error occurs during setting a class's superclasses
Diffstat (limited to 'tests/oo.test')
-rw-r--r-- | tests/oo.test | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/oo.test b/tests/oo.test index 065c017..e917bc9 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -314,7 +314,41 @@ test oo-1.18.3 {Bug 21c144f0f5} -setup { } } -cleanup { interp delete slave -} +} +test oo-1.18.4 {correct handling of cleanup in superclass set error} -setup { + interp create slave +} -body { + slave eval { + oo::class create A + oo::class create B { + superclass oo::class + constructor {} { + next {superclass A} + next {superclass -append A} + } + } + [B create C] create d + } +} -returnCodes error -cleanup { + interp delete slave +} -result {class should only be a direct superclass once} +test oo-1.18.5 {correct handling of cleanup in superclass set error} -setup { + interp create slave +} -body { + slave eval { + oo::class create A + oo::class create B { + superclass oo::class + constructor {c} { + next {superclass A} + next [list superclass -append {*}$c] + } + } + [B create C {B C}] create d + } +} -returnCodes error -cleanup { + interp delete slave +} -result {attempt to form circular dependency graph} test oo-1.19 {basic test of OO functionality: teardown order} -body { oo::object create o namespace delete [info object namespace o] |