From b4085b7b9a6b51fd893dc7fc263f49ff570c90bb Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 12 Jun 2015 12:27:28 +0200 Subject: [PATCH] fix tests --- php_http_message.c | 2 +- php_http_message_body.c | 3 +-- tests/info001.phpt | 6 +++--- tests/info002.phpt | 4 ++-- tests/messagebody003.phpt | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/php_http_message.c b/php_http_message.c index 3d3822c..4f21a83 100644 --- a/php_http_message.c +++ b/php_http_message.c @@ -912,7 +912,7 @@ static HashTable *php_http_message_object_get_props(zval *object) zend_property_info *pi; \ if ((pi = zend_hash_str_find_ptr(&obj->zo.ce->properties_info, name_str, lenof(name_str)))) { \ action_with_tmp; \ - zend_hash_update(props, pi->name, &tmp); \ + zend_hash_update_ind(props, pi->name, &tmp); \ } \ } while(0) diff --git a/php_http_message_body.c b/php_http_message_body.c index 4a3174a..22179e4 100644 --- a/php_http_message_body.c +++ b/php_http_message_body.c @@ -93,8 +93,7 @@ void php_http_message_body_free(php_http_message_body_t **body_ptr) php_http_message_body_t *body = *body_ptr; if (!--body->refcount) { - /* NOFIXME: shows leakinfo in DEBUG mode */ - zend_list_delete(body->res); + //zend_list_close(body->res); PTR_FREE(body->boundary); efree(body); } diff --git a/tests/info001.phpt b/tests/info001.phpt index 8209669..6b829ef 100644 --- a/tests/info001.phpt +++ b/tests/info001.phpt @@ -24,15 +24,15 @@ var_dump(new http\Message("GET / HTTP/1.1")); ?> DONE --EXPECTF-- -exception 'http\Exception\BadMessageException' with message 'http\Message::__construct(): Failed to parse headers: unexpected character '\040' at pos 3 of 'GET HTTP/1.1'' in %s +http\Exception\BadMessageException: http\Message::__construct(): Failed to parse headers: unexpected character '\040' at pos 3 of 'GET HTTP/1.1' in %s Stack trace: #0 %s: http\Message->__construct('GET HTTP/1.1') #1 {main} -exception 'http\Exception\BadMessageException' with message 'http\Message::__construct(): Failed to parse headers: unexpected character '\040' at pos 3 of 'GET HTTP/1.123'' in %s +http\Exception\BadMessageException: http\Message::__construct(): Failed to parse headers: unexpected character '\040' at pos 3 of 'GET HTTP/1.123' in %s Stack trace: #0 %s: http\Message->__construct('GET HTTP/1.123') #1 {main} -exception 'http\Exception\BadMessageException' with message 'http\Message::__construct(): Failed to parse headers: unexpected character '\057' at pos 7 of 'GETHTTP/1.1'' %s +http\Exception\BadMessageException: http\Message::__construct(): Failed to parse headers: unexpected character '\057' at pos 7 of 'GETHTTP/1.1' %s Stack trace: #0 %s: http\Message->__construct('GETHTTP/1.1') #1 {main} diff --git a/tests/info002.phpt b/tests/info002.phpt index 093dcd1..3c71be5 100644 --- a/tests/info002.phpt +++ b/tests/info002.phpt @@ -32,13 +32,13 @@ echo new http\Message("CONNECT www.example.org:80 HTTP/1.1"); ===DONE=== --EXPECTF-- Test -exception 'http\Exception\BadMessageException' with message 'http\Message::__construct(): Failed to parse headers: unexpected character '\057' at pos 4 of 'HTTP/1.1 99 Apples in my Basket'' in %sinfo002.php:%d +http\Exception\BadMessageException: http\Message::__construct(): Failed to parse headers: unexpected character '\057' at pos 4 of 'HTTP/1.1 99 Apples in my Basket' in %sinfo002.php:%d Stack trace: #0 %sinfo002.php(%d): http\Message->__construct('HTTP/1.1 99 App...') #1 %sinfo002.php(%d): {closure}() #2 %sinfo002.php(%d): trap(Object(Closure)) #3 {main} -exception 'http\Exception\BadMessageException' with message 'http\Message::__construct(): Failed to parse headers: unexpected character '\040' at pos 7 of 'CONNECT HTTP/1.1'' in %sinfo002.php:%d +http\Exception\BadMessageException: http\Message::__construct(): Failed to parse headers: unexpected character '\040' at pos 7 of 'CONNECT HTTP/1.1' in %sinfo002.php:%d Stack trace: #0 %sinfo002.php(%d): http\Message->__construct('CONNECT HTTP/1....') #1 %sinfo002.php(%d): {closure}() diff --git a/tests/messagebody003.phpt b/tests/messagebody003.phpt index 7b79e6a..8444cbf 100644 --- a/tests/messagebody003.phpt +++ b/tests/messagebody003.phpt @@ -19,7 +19,7 @@ try { DONE --EXPECTF-- Test -exception 'http\Exception\RuntimeException' with message 'http\Message\Body::append(): Failed to append 4 bytes to body; wrote 0' in %s:%d +http\Exception\RuntimeException: http\Message\Body::append(): Failed to append 4 bytes to body; wrote 0 in %s:%d Stack trace: #0 %s(%d): http\Message\Body->append('nope') #1 {main} -- 2.30.2