CHANGES.current entry and regression test for previous commit

This commit is contained in:
Olly Betts 2017-10-09 11:09:58 +13:00
commit 0ca47dd7cc
4 changed files with 49 additions and 0 deletions

View file

@ -6,6 +6,11 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
Version 4.0.0 (in progress)
===========================
2017-10-09: olly
[PHP] Fix incorrect wrapper code generated when there's a
combination of overloading, parameters with a default value
and %newobject. Fixes https://sourceforge.net/p/swig/bugs/1350/
2017-10-09: olly
Remove GCJ support. It isn't in a good state and doesn't seem to
be used, and GCC7 dropped GCJ. Closes

View file

@ -316,6 +316,7 @@ CPP_TEST_CASES += \
nested_template_base \
nested_workaround \
newobject1 \
newobject3 \
null_pointer \
operator_overload \
operator_overload_break \

View file

@ -0,0 +1,25 @@
/**
* Regression test for PHP bug: https://sourceforge.net/p/swig/bugs/1350/
*/
%module newobject3
%newobject factory::create;
%inline %{
class product {};
class factory {
public:
product * create(short id, short type = 0);
product * create(const char * name, short type = 0);
};
%}
%{
product * factory::create(short id, short type) {
return (id && type >= 0) ? new product : NULL;
}
product * factory::create(const char * name, short type) {
return (name && type >= 0) ? new product : NULL;
}
%}

View file

@ -0,0 +1,18 @@
<?php
require "tests.php";
require "newobject3.php";
$factory = new factory();
check::classname("product", $factory->create(7));
check::classname("product", $factory->create(7, 6));
check::classname("product", $factory->create("test"));
check::classname("product", $factory->create("test", 2));
check::isnull($factory->create(0), "create(0) should be NULL");
check::isnull($factory->create(7, -1), "create(7, -1) should be NULL");
check::isnull($factory->create(0, -1), "create(0, -1) should be NULL");
check::isnull($factory->create("bad", -1), "create(\"bad\", -1) should be NULL");
?>