diff options
author | Olly Betts <olly@survex.com> | 2022-10-14 13:09:01 +1300 |
---|---|---|
committer | Olly Betts <ojwbetts@gmail.com> | 2022-10-14 14:44:19 +1300 |
commit | fefb231bd858885168d6af86a0bfb2af3e62961e (patch) | |
tree | 85dc63217cffc2a5a5709534c141150dbb380fb7 | |
parent | 9ab9c716239d2855bdd6c0771e2e980c0767fb57 (diff) | |
download | swig-fefb231bd858885168d6af86a0bfb2af3e62961e.tar.gz |
[php] Update exception_memory_leak_runme.php
Test the new "return by value" case too.
-rw-r--r-- | Examples/test-suite/php/exception_memory_leak_runme.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Examples/test-suite/php/exception_memory_leak_runme.php b/Examples/test-suite/php/exception_memory_leak_runme.php index 3972bb90f..116ab2f0e 100644 --- a/Examples/test-suite/php/exception_memory_leak_runme.php +++ b/Examples/test-suite/php/exception_memory_leak_runme.php @@ -17,7 +17,7 @@ trigger_internal_swig_exception("no problem", $a); check::equal(Foo::get_count(), 2, "Should have 2 Foo objects"); check::equal(Foo::get_freearg_count(), 1, "freearg should have been used once"); -// SWIG exception triggered and handled. +// SWIG exception triggered and handled (return new object case). try { trigger_internal_swig_exception("null", $b); check::fail("Expected exception not thrown"); @@ -25,3 +25,11 @@ try { } check::equal(Foo::get_count(), 2, "Should have 2 Foo objects"); check::equal(Foo::get_freearg_count(), 2, "freearg should have been used twice"); + +// SWIG exception triggered and handled (return by value case). +try { + trigger_internal_swig_exception("null"); + check::fail("Expected exception not thrown"); +} catch (Exception $e) { +} +check::equal(Foo::get_count(), 2, "Should have 2 Foo objects"); |