diff options
| author | Jani Taskinen <jani@php.net> | 2008-12-17 14:05:52 +0000 |
|---|---|---|
| committer | Jani Taskinen <jani@php.net> | 2008-12-17 14:05:52 +0000 |
| commit | 1cd04d8739ffafe513c5e22dc76bc72f4ca8215f (patch) | |
| tree | a23b63bf1a3a229e39907bbba50d34399d51f349 | |
| parent | 3fff9483213f215c90d556e0862143f4fc5d66ef (diff) | |
| download | php-git-1cd04d8739ffafe513c5e22dc76bc72f4ca8215f.tar.gz | |
MFH: bug tests
| -rw-r--r-- | ext/curl/tests/bug45161.phpt | 36 | ||||
| -rw-r--r-- | ext/curl/tests/bug46739.phpt | 13 |
2 files changed, 49 insertions, 0 deletions
diff --git a/ext/curl/tests/bug45161.phpt b/ext/curl/tests/bug45161.phpt new file mode 100644 index 0000000000..eab1fd46e3 --- /dev/null +++ b/ext/curl/tests/bug45161.phpt @@ -0,0 +1,36 @@ +--TEST-- +Bug #45161 (Reusing a curl handle leaks memory) +--FILE-- +<?php + +// Fill memory for test +$ch = curl_init(); +$fp = fopen('/dev/null', 'w'); + +/* +$i = $start = $end = 100000.00; +for ($i = 0; $i < 100; $i++) { + curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:9/'); + curl_setopt($ch, CURLOPT_FILE, $fp); + curl_exec($ch); +} +*/ + +// Start actual test +$start = memory_get_usage() + 1024; +for($i = 0; $i < 1024; $i++) { + curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:9/'); + curl_setopt($ch, CURLOPT_FILE, $fp); + curl_exec($ch); +} +if ($start < memory_get_usage()) { + echo 'FAIL'; +} else { + echo 'PASS'; +} +echo "\n"; +fclose($fp); +unset($fp); +?> +--EXPECT-- +PASS diff --git a/ext/curl/tests/bug46739.phpt b/ext/curl/tests/bug46739.phpt new file mode 100644 index 0000000000..06a84ea8ed --- /dev/null +++ b/ext/curl/tests/bug46739.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #46739 (array returned by curl_getinfo should contain content_type key) +--FILE-- +<?php +$ch = curl_init('http://127.0.0.1:9/'); + +curl_exec($ch); +$info = curl_getinfo($ch); + +echo (array_key_exists('content_type', $info)) ? "set" : "not set"; +?> +--EXPECT-- +set |
