Skip to content

Commit

Permalink
Fix tests and get rid of memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Sep 8, 2020
1 parent 663d012 commit c544ffb
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 12 deletions.
6 changes: 2 additions & 4 deletions Zend/zend_execute_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,13 +511,11 @@ ZEND_API zend_string *get_active_function_or_method_name(void) /* {{{ */

ZEND_API zend_string *get_function_or_method_name(const zend_function *func) /* {{{ */
{
const char *name = get_function_name(func);

if (func->common.scope) {
return zend_create_member_string(func->common.scope->name, zend_string_init(name, strlen(name), 1));
return zend_create_member_string(func->common.scope->name, func->common.function_name);
}

return zend_string_init(name, strlen(name), 0);
return func->common.function_name ? zend_string_copy(func->common.function_name) : zend_string_init("main", sizeof("main") - 1, 0);
}
/* }}} */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ try {
ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 3 given
ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 0 given
ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 1 given
Class C does not have a property named
Class C does not have a property named
Class C does not have a property named 1.5
ReflectionClass::setStaticPropertyValue(): Argument #1 ($name) must be of type string, array given
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ try {


?>
--EXPECTF--
Ok - ReflectionExtension::__construct() expects exactly %d parameter, %d given
Ok - ReflectionExtension::__construct() expects exactly %d parameter, %d given
--EXPECT--
Ok - ReflectionExtension::__construct() expects exactly 1 argument, 0 given
Ok - ReflectionExtension::__construct() expects exactly 1 argument, 2 given
Ok - ReflectionExtension::__construct(): Argument #1 ($name) must be of type string, array given
2 changes: 1 addition & 1 deletion ext/session/tests/session_set_save_handler_class_012.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i
?>
--EXPECTF--
*** Testing session_set_save_handler() : incorrect arguments for existing handler open ***
Open
Open

Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line %d
SessionHandler::open() expects exactly 2 arguments, 0 given
Expand Down
2 changes: 1 addition & 1 deletion ext/session/tests/session_set_save_handler_class_013.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i
?>
--EXPECTF--
*** Testing session_set_save_handler() : incorrect arguments for existing handler close ***
Open
Open
Read %s
string(%d) "%s"
string(5) "files"
Expand Down
2 changes: 1 addition & 1 deletion ext/spl/tests/arrayObject_uksort_error1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ try {
}
?>
--EXPECT--
ArrayObject::uksort() expects exactly 1 arguments, 0 given
ArrayObject::uksort() expects exactly 1 argument, 0 given
ArrayObject::uksort() expects exactly 1 argument, 2 given
2 changes: 1 addition & 1 deletion ext/sqlite3/tests/sqlite3_02_open.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ try {

?>
--EXPECT--
string(60) "SQLite3::__construct() expects at least 1 argument, 0 given"
string(59) "SQLite3::__construct() expects at least 1 argument, 0 given"

0 comments on commit c544ffb

Please sign in to comment.