[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/curl/tests/bug54798.phpt branches/PHP_5_4/ext/curl/tests/bug54798.phpt trunk/ext/curl/tests/bug54798.phpt

2011-11-20 Thread Pierrick Charron
pierrick Mon, 21 Nov 2011 02:10:57 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=319592

Log:
Fix test to use PHP_CURL_HTTP_REMOTE_SERVER

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/curl/tests/bug54798.phpt
U   php/php-src/branches/PHP_5_4/ext/curl/tests/bug54798.phpt
U   php/php-src/trunk/ext/curl/tests/bug54798.phpt

Modified: php/php-src/branches/PHP_5_3/ext/curl/tests/bug54798.phpt
===
--- php/php-src/branches/PHP_5_3/ext/curl/tests/bug54798.phpt   2011-11-21 
02:03:20 UTC (rev 319591)
+++ php/php-src/branches/PHP_5_3/ext/curl/tests/bug54798.phpt   2011-11-21 
02:10:57 UTC (rev 319592)
@@ -12,7 +12,7 @@
 --FILE--
 ?php

-function checkForClosedFilePointer($curl_option, $description) {
+function checkForClosedFilePointer($host, $curl_option, $description) {
$fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+');

$ch = curl_init();
@@ -28,7 +28,7 @@

curl_setopt($ch, $curl_option, $fp);

-   curl_setopt($ch, CURLOPT_URL, 'localhost');
+   curl_setopt($ch, CURLOPT_URL, $host);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

fclose($fp); // -- premature close of $fp caused a crash!
@@ -47,8 +47,9 @@
 CURLOPT_INFILE
 );

+$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
 foreach($options_to_check as $option) {
-   checkForClosedFilePointer(constant($option), $option);
+   checkForClosedFilePointer($host, constant($option), $option);
 }

 ?

Modified: php/php-src/branches/PHP_5_4/ext/curl/tests/bug54798.phpt
===
--- php/php-src/branches/PHP_5_4/ext/curl/tests/bug54798.phpt   2011-11-21 
02:03:20 UTC (rev 319591)
+++ php/php-src/branches/PHP_5_4/ext/curl/tests/bug54798.phpt   2011-11-21 
02:10:57 UTC (rev 319592)
@@ -12,7 +12,7 @@
 --FILE--
 ?php

-function checkForClosedFilePointer($curl_option, $description) {
+function checkForClosedFilePointer($host, $curl_option, $description) {
$fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+');

$ch = curl_init();
@@ -28,7 +28,7 @@

curl_setopt($ch, $curl_option, $fp);

-   curl_setopt($ch, CURLOPT_URL, 'localhost');
+   curl_setopt($ch, CURLOPT_URL, $host);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

fclose($fp); // -- premature close of $fp caused a crash!
@@ -47,8 +47,9 @@
 CURLOPT_INFILE
 );

+$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
 foreach($options_to_check as $option) {
-   checkForClosedFilePointer(constant($option), $option);
+   checkForClosedFilePointer($host, constant($option), $option);
 }

 ?

Modified: php/php-src/trunk/ext/curl/tests/bug54798.phpt
===
--- php/php-src/trunk/ext/curl/tests/bug54798.phpt  2011-11-21 02:03:20 UTC 
(rev 319591)
+++ php/php-src/trunk/ext/curl/tests/bug54798.phpt  2011-11-21 02:10:57 UTC 
(rev 319592)
@@ -12,7 +12,7 @@
 --FILE--
 ?php

-function checkForClosedFilePointer($curl_option, $description) {
+function checkForClosedFilePointer($host, $curl_option, $description) {
$fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+');

$ch = curl_init();
@@ -28,7 +28,7 @@

curl_setopt($ch, $curl_option, $fp);

-   curl_setopt($ch, CURLOPT_URL, 'localhost');
+   curl_setopt($ch, CURLOPT_URL, $host);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

fclose($fp); // -- premature close of $fp caused a crash!
@@ -47,8 +47,9 @@
 CURLOPT_INFILE
 );

+$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
 foreach($options_to_check as $option) {
-   checkForClosedFilePointer(constant($option), $option);
+   checkForClosedFilePointer($host, constant($option), $option);
 }

 ?

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/curl/tests/bug54798.phpt branches/PHP_5_4/ext/curl/tests/bug54798.phpt trunk/ext/curl/tests/bug54798.phpt

2011-09-09 Thread Hannes Magnusson
bjoriFri, 09 Sep 2011 08:28:57 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=316449

Log:
Being smart and cleanup/rename/modify tests seconds before committing isn't 
very smart.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/curl/tests/bug54798.phpt
U   php/php-src/branches/PHP_5_4/ext/curl/tests/bug54798.phpt
U   php/php-src/trunk/ext/curl/tests/bug54798.phpt

Modified: php/php-src/branches/PHP_5_3/ext/curl/tests/bug54798.phpt
===
--- php/php-src/branches/PHP_5_3/ext/curl/tests/bug54798.phpt   2011-09-09 
08:14:04 UTC (rev 316448)
+++ php/php-src/branches/PHP_5_3/ext/curl/tests/bug54798.phpt   2011-09-09 
08:28:57 UTC (rev 316449)
@@ -1,5 +1,5 @@
 --TEST--
-Bug #48203 (Crash when file pointers passed to curl are closed before calling 
curl_exec)
+Bug #54798 (Segfault when CURLOPT_STDERR file pointer is closed before calling 
curl_exec)
 --SKIPIF--
 ?php
 if (!extension_loaded(curl)) {
@@ -13,7 +13,7 @@
 ?php

 function checkForClosedFilePointer($curl_option, $description) {
-   $fp = fopen(dirname(__FILE__) . '/bug48203.tmp', 'w+');
+   $fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+');

$ch = curl_init();

@@ -53,14 +53,14 @@

 ?
 --CLEAN--
-?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?
+?php @unlink(dirname(__FILE__) . '/bug54798.tmp'); ?
 --EXPECTF--
-Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to 
stderr in %sbug48203_2.php on line %d
+Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to 
stderr in %sbug54798.php on line %d
 * About to connect() %a
 * Closing connection #%d
 Ok for CURLOPT_STDERR
 Ok for CURLOPT_WRITEHEADER
 Ok for CURLOPT_FILE

-Warning: curl_exec(): CURLOPT_INFILE resource has gone away, resetting to 
default in %sbug48203_2.php on line %d
+Warning: curl_exec(): CURLOPT_INFILE resource has gone away, resetting to 
default in %sbug54798.php on line %d
 Ok for CURLOPT_INFILE

Modified: php/php-src/branches/PHP_5_4/ext/curl/tests/bug54798.phpt
===
--- php/php-src/branches/PHP_5_4/ext/curl/tests/bug54798.phpt   2011-09-09 
08:14:04 UTC (rev 316448)
+++ php/php-src/branches/PHP_5_4/ext/curl/tests/bug54798.phpt   2011-09-09 
08:28:57 UTC (rev 316449)
@@ -1,5 +1,5 @@
 --TEST--
-Bug #48203 (Crash when file pointers passed to curl are closed before calling 
curl_exec)
+Bug #54798 (Segfault when CURLOPT_STDERR file pointer is closed before calling 
curl_exec)
 --SKIPIF--
 ?php
 if (!extension_loaded(curl)) {
@@ -13,7 +13,7 @@
 ?php

 function checkForClosedFilePointer($curl_option, $description) {
-   $fp = fopen(dirname(__FILE__) . '/bug48203.tmp', 'w+');
+   $fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+');

$ch = curl_init();

@@ -53,14 +53,14 @@

 ?
 --CLEAN--
-?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?
+?php @unlink(dirname(__FILE__) . '/bug54798.tmp'); ?
 --EXPECTF--
-Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to 
stderr in %sbug48203_2.php on line %d
+Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to 
stderr in %sbug54798.php on line %d
 * About to connect() %a
 * Closing connection #%d
 Ok for CURLOPT_STDERR
 Ok for CURLOPT_WRITEHEADER
 Ok for CURLOPT_FILE

-Warning: curl_exec(): CURLOPT_INFILE resource has gone away, resetting to 
default in %sbug48203_2.php on line %d
+Warning: curl_exec(): CURLOPT_INFILE resource has gone away, resetting to 
default in %sbug54798.php on line %d
 Ok for CURLOPT_INFILE

Modified: php/php-src/trunk/ext/curl/tests/bug54798.phpt
===
--- php/php-src/trunk/ext/curl/tests/bug54798.phpt  2011-09-09 08:14:04 UTC 
(rev 316448)
+++ php/php-src/trunk/ext/curl/tests/bug54798.phpt  2011-09-09 08:28:57 UTC 
(rev 316449)
@@ -1,5 +1,5 @@
 --TEST--
-Bug #48203 (Crash when file pointers passed to curl are closed before calling 
curl_exec)
+Bug #54798 (Segfault when CURLOPT_STDERR file pointer is closed before calling 
curl_exec)
 --SKIPIF--
 ?php
 if (!extension_loaded(curl)) {
@@ -13,7 +13,7 @@
 ?php

 function checkForClosedFilePointer($curl_option, $description) {
-   $fp = fopen(dirname(__FILE__) . '/bug48203.tmp', 'w+');
+   $fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+');

$ch = curl_init();

@@ -53,14 +53,14 @@

 ?
 --CLEAN--
-?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?
+?php @unlink(dirname(__FILE__) . '/bug54798.tmp'); ?
 --EXPECTF--
-Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to 
stderr in %sbug48203_2.php on line %d
+Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to 
stderr in %sbug54798.php on line %d
 * About to connect() %a
 * Closing connection #%d
 Ok for CURLOPT_STDERR
 Ok for CURLOPT_WRITEHEADER
 Ok for CURLOPT_FILE

-Warning: curl_exec():