[php] Update exception_memory_leak_runme.php

Test the new "return by value" case too.
This commit is contained in:
Olly Betts 2022-10-14 13:09:01 +13:00 committed by Olly Betts
commit fefb231bd8

View file

@ -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");