[PHP-CVS] svn: /php/php-src/trunk/ext/gd/tests/ imageloadfont_error1.phpt imageloadfont_error2.phpt

2011-05-31 Thread Rafael Machado Dohms
rdohms   Tue, 31 May 2011 21:10:01 +

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

Log:
Adding testcases to validate imageloadfont input parameter validation, tests 
were developed at #tek11 testfest

Changed paths:
A   php/php-src/trunk/ext/gd/tests/imageloadfont_error1.phpt
A   php/php-src/trunk/ext/gd/tests/imageloadfont_error2.phpt

Added: php/php-src/trunk/ext/gd/tests/imageloadfont_error1.phpt
===
--- php/php-src/trunk/ext/gd/tests/imageloadfont_error1.phpt
(rev 0)
+++ php/php-src/trunk/ext/gd/tests/imageloadfont_error1.phpt2011-05-31 
21:10:01 UTC (rev 311677)
@@ -0,0 +1,15 @@
+--TEST--
+Testing that imageloadfont() breaks on non-string first parameter
+--CREDITS--
+Neveo Harrison neveoo [at] gmail [dot] com #testfest #tek11
+--SKIPIF--
+?php
+   if (!extension_loaded(gd)) die(skip GD not present);
+?
+--FILE--
+?php
+var_dump( imageloadfont(array()) );
+?
+--EXPECTF--
+Warning: imageloadfont() expects parameter 1 to be string, array given in %s 
on line %d
+NULL
\ No newline at end of file

Added: php/php-src/trunk/ext/gd/tests/imageloadfont_error2.phpt
===
--- php/php-src/trunk/ext/gd/tests/imageloadfont_error2.phpt
(rev 0)
+++ php/php-src/trunk/ext/gd/tests/imageloadfont_error2.phpt2011-05-31 
21:10:01 UTC (rev 311677)
@@ -0,0 +1,15 @@
+--TEST--
+Testing that imageloadfont() breaks on invalid file passed as first argument
+--CREDITS--
+Austin Drouare austin.drouare [at] gmail [dot] com #testfest #tek11
+--SKIPIF--
+?php
+   if (!extension_loaded(gd)) die(skip GD not present);
+?
+--FILE--
+?php
+var_dump( imageloadfont('\src\invalidfile.font') );
+?
+--EXPECTF--
+Warning: imageloadfont(\src\invalidfile.font): failed to open stream: No such 
file or directory in %s on line %d
+bool(false)

-- 
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/gd/tests/ imageloadfont_error1.phpt imageloadfont_error2.phpt

2011-05-31 Thread Rafael Machado Dohms
rdohms   Tue, 31 May 2011 21:24:10 +

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

Log:
Adding testcases to validate imageloadfont input parameter validation, tests 
were developed at #tek11 testfest

Changed paths:
A   php/php-src/branches/PHP_5_3/ext/gd/tests/imageloadfont_error1.phpt
A   php/php-src/branches/PHP_5_3/ext/gd/tests/imageloadfont_error2.phpt

Added: php/php-src/branches/PHP_5_3/ext/gd/tests/imageloadfont_error1.phpt
===
--- php/php-src/branches/PHP_5_3/ext/gd/tests/imageloadfont_error1.phpt 
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/gd/tests/imageloadfont_error1.phpt 
2011-05-31 21:24:10 UTC (rev 311678)
@@ -0,0 +1,15 @@
+--TEST--
+Testing that imageloadfont() breaks on non-string first parameter
+--CREDITS--
+Neveo Harrison neveoo [at] gmail [dot] com #testfest #tek11
+--SKIPIF--
+?php
+   if (!extension_loaded(gd)) die(skip GD not present);
+?
+--FILE--
+?php
+var_dump( imageloadfont(array()) );
+?
+--EXPECTF--
+Warning: imageloadfont() expects parameter 1 to be string, array given in %s 
on line %d
+NULL
\ No newline at end of file

Added: php/php-src/branches/PHP_5_3/ext/gd/tests/imageloadfont_error2.phpt
===
--- php/php-src/branches/PHP_5_3/ext/gd/tests/imageloadfont_error2.phpt 
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/gd/tests/imageloadfont_error2.phpt 
2011-05-31 21:24:10 UTC (rev 311678)
@@ -0,0 +1,15 @@
+--TEST--
+Testing that imageloadfont() breaks on invalid file passed as first argument
+--CREDITS--
+Austin Drouare austin.drouare [at] gmail [dot] com #testfest #tek11
+--SKIPIF--
+?php
+   if (!extension_loaded(gd)) die(skip GD not present);
+?
+--FILE--
+?php
+var_dump( imageloadfont('\src\invalidfile.font') );
+?
+--EXPECTF--
+Warning: imageloadfont(\src\invalidfile.font): failed to open stream: No such 
file or directory in %s on line %d
+bool(false)

-- 
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_4/ext/gd/tests/ imageloadfont_error1.phpt imageloadfont_error2.phpt

2011-05-31 Thread Rafael Machado Dohms
rdohms   Tue, 31 May 2011 21:38:23 +

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

Log:
Adding testcases to validate imageloadfont input parameter validation, tests 
were developed at #tek11 testfest

Changed paths:
A   php/php-src/branches/PHP_5_4/ext/gd/tests/imageloadfont_error1.phpt
A   php/php-src/branches/PHP_5_4/ext/gd/tests/imageloadfont_error2.phpt

Added: php/php-src/branches/PHP_5_4/ext/gd/tests/imageloadfont_error1.phpt
===
--- php/php-src/branches/PHP_5_4/ext/gd/tests/imageloadfont_error1.phpt 
(rev 0)
+++ php/php-src/branches/PHP_5_4/ext/gd/tests/imageloadfont_error1.phpt 
2011-05-31 21:38:23 UTC (rev 311679)
@@ -0,0 +1,15 @@
+--TEST--
+Testing that imageloadfont() breaks on non-string first parameter
+--CREDITS--
+Neveo Harrison neveoo [at] gmail [dot] com #testfest #tek11
+--SKIPIF--
+?php
+   if (!extension_loaded(gd)) die(skip GD not present);
+?
+--FILE--
+?php
+var_dump( imageloadfont(array()) );
+?
+--EXPECTF--
+Warning: imageloadfont() expects parameter 1 to be string, array given in %s 
on line %d
+NULL
\ No newline at end of file

Added: php/php-src/branches/PHP_5_4/ext/gd/tests/imageloadfont_error2.phpt
===
--- php/php-src/branches/PHP_5_4/ext/gd/tests/imageloadfont_error2.phpt 
(rev 0)
+++ php/php-src/branches/PHP_5_4/ext/gd/tests/imageloadfont_error2.phpt 
2011-05-31 21:38:23 UTC (rev 311679)
@@ -0,0 +1,15 @@
+--TEST--
+Testing that imageloadfont() breaks on invalid file passed as first argument
+--CREDITS--
+Austin Drouare austin.drouare [at] gmail [dot] com #testfest #tek11
+--SKIPIF--
+?php
+   if (!extension_loaded(gd)) die(skip GD not present);
+?
+--FILE--
+?php
+var_dump( imageloadfont('\src\invalidfile.font') );
+?
+--EXPECTF--
+Warning: imageloadfont(\src\invalidfile.font): failed to open stream: No such 
file or directory in %s on line %d
+bool(false)

-- 
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_2/ext/standard/tests/general_functions/bug49692.phpt branches/PHP_5_3/ext/standard/tests/general_functions/bug49692.phpt trunk/ext/standard/tests/general_fu

2009-09-29 Thread Rafael Machado Dohms
rdohms   Tue, 29 Sep 2009 14:34:06 +

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

Log:
Fixing tests for head and wrong SKIPIF blocks

Changed paths:
U   
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49692.phpt
U   
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49692.phpt
U   php/php-src/trunk/ext/standard/tests/general_functions/bug49692.phpt

Modified: 
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49692.phpt
===
--- 
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49692.phpt 
2009-09-29 14:14:02 UTC (rev 288945)
+++ 
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49692.phpt 
2009-09-29 14:34:06 UTC (rev 288946)
@@ -2,10 +2,6 @@
 Bug #49692: parse_ini_file() throws errors when key contains '/' (forward 
slash)
 --CREDITS--
 Rafael Dohms rdohms [at] gmail [dot] com
---SKIPIF--
-?php
-   if (!extension_loaded(gd)) die(skip GD not present);
-?
 --FILE--
 ?php


Modified: 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49692.phpt
===
--- 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49692.phpt 
2009-09-29 14:14:02 UTC (rev 288945)
+++ 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49692.phpt 
2009-09-29 14:34:06 UTC (rev 288946)
@@ -2,10 +2,6 @@
 Bug #49692: parse_ini_file() throws errors when key contains '/' (forward 
slash)
 --CREDITS--
 Rafael Dohms rdohms [at] gmail [dot] com
---SKIPIF--
-?php
-   if (!extension_loaded(gd)) die(skip GD not present);
-?
 --FILE--
 ?php


Modified: php/php-src/trunk/ext/standard/tests/general_functions/bug49692.phpt
===
--- php/php-src/trunk/ext/standard/tests/general_functions/bug49692.phpt
2009-09-29 14:14:02 UTC (rev 288945)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug49692.phpt
2009-09-29 14:34:06 UTC (rev 288946)
@@ -2,10 +2,6 @@
 Bug #49692: parse_ini_file() throws errors when key contains '/' (forward 
slash)
 --CREDITS--
 Rafael Dohms rdohms [at] gmail [dot] com
---SKIPIF--
-?php
-   if (!extension_loaded(gd)) die(skip GD not present);
-?
 --FILE--
 ?php

@@ -14,11 +10,11 @@
 ?
 --EXPECTF--
 array(1) {
-  [sitemap]=
+  [usitemap]=
   array(2) {
-[/home]=
-string(13) default:index
-[/info]=
-string(12) default:info
+[u/home]=
+unicode(13) default:index
+[u/info]=
+unicode(12) default:info
   }
 }

-- 
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_2/ext/standard/tests/general_functions/bug49692.ini branches/PHP_5_2/ext/standard/tests/general_functions/bug49692.phpt branches/PHP_5_3/ext/standard/tests/

2009-09-28 Thread Rafael Machado Dohms
rdohms   Mon, 28 Sep 2009 22:57:41 +

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

Log:
Adding tests for bug #49692

Bug: http://bugs.php.net/49692 (Bogus) parse_ini_file() throws errors when key 
contains '/' (forward slash)
  
Changed paths:
A   
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49692.ini
A   
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49692.phpt
A   
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49692.ini
A   
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49692.phpt
A   php/php-src/trunk/ext/standard/tests/general_functions/bug49692.ini
A   php/php-src/trunk/ext/standard/tests/general_functions/bug49692.phpt

Added: 
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49692.ini
===
--- 
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49692.ini  
(rev 0)
+++ 
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49692.ini  
2009-09-28 22:57:41 UTC (rev 288922)
@@ -0,0 +1,4 @@
+//my.ini file
+[sitemap]
+/home= default:index
+/info= default:info

Added: 
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49692.phpt
===
--- 
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49692.phpt 
(rev 0)
+++ 
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/bug49692.phpt 
2009-09-28 22:57:41 UTC (rev 288922)
@@ -0,0 +1,24 @@
+--TEST--
+Bug #49692: parse_ini_file() throws errors when key contains '/' (forward 
slash)
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+   if (!extension_loaded(gd)) die(skip GD not present);
+?
+--FILE--
+?php
+
+var_dump(parse_ini_file('bug49692.ini', true));
+
+?
+--EXPECTF--
+array(1) {
+  [sitemap]=
+  array(2) {
+[/home]=
+string(13) default:index
+[/info]=
+string(12) default:info
+  }
+}

Added: 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49692.ini
===
--- 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49692.ini  
(rev 0)
+++ 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49692.ini  
2009-09-28 22:57:41 UTC (rev 288922)
@@ -0,0 +1,4 @@
+//my.ini file
+[sitemap]
+/home= default:index
+/info= default:info

Added: 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49692.phpt
===
--- 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49692.phpt 
(rev 0)
+++ 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug49692.phpt 
2009-09-28 22:57:41 UTC (rev 288922)
@@ -0,0 +1,24 @@
+--TEST--
+Bug #49692: parse_ini_file() throws errors when key contains '/' (forward 
slash)
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+   if (!extension_loaded(gd)) die(skip GD not present);
+?
+--FILE--
+?php
+
+var_dump(parse_ini_file('bug49692.ini', true));
+
+?
+--EXPECTF--
+array(1) {
+  [sitemap]=
+  array(2) {
+[/home]=
+string(13) default:index
+[/info]=
+string(12) default:info
+  }
+}

Added: php/php-src/trunk/ext/standard/tests/general_functions/bug49692.ini
===
--- php/php-src/trunk/ext/standard/tests/general_functions/bug49692.ini 
(rev 0)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug49692.ini 
2009-09-28 22:57:41 UTC (rev 288922)
@@ -0,0 +1,4 @@
+//my.ini file
+[sitemap]
+/home= default:index
+/info= default:info

Added: php/php-src/trunk/ext/standard/tests/general_functions/bug49692.phpt
===
--- php/php-src/trunk/ext/standard/tests/general_functions/bug49692.phpt
(rev 0)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug49692.phpt
2009-09-28 22:57:41 UTC (rev 288922)
@@ -0,0 +1,24 @@
+--TEST--
+Bug #49692: parse_ini_file() throws errors when key contains '/' (forward 
slash)
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+   if (!extension_loaded(gd)) die(skip GD not present);
+?
+--FILE--
+?php
+
+var_dump(parse_ini_file('bug49692.ini', true));
+
+?
+--EXPECTF--
+array(1) {
+  [sitemap]=
+  array(2) {
+[/home]=
+string(13) default:index
+[/info]=
+string(12) default:info
+  }
+}

-- 
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_2/ext/gd/tests/imagecolorallocatealpha_basic.phpt branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error1.phpt branches/PHP_5_2/ext/gd/tests/imagecolor

2009-08-23 Thread Rafael Machado Dohms
rdohms   Mon, 24 Aug 2009 02:50:19 +

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

Log:
Adding tests for imagecolorallocatealpha

Changed paths:
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_basic.phpt
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error1.phpt
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error2.phpt
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error3.phpt
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error4.phpt
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error5.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_basic.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error1.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error2.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error3.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error4.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imagecolorallocatealpha_error5.phpt
A   php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_basic.phpt
A   php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error1.phpt
A   php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error2.phpt
A   php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error3.phpt
A   php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error4.phpt
A   php/php-src/trunk/ext/gd/tests/imagecolorallocatealpha_error5.phpt

Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_basic.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_basic.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_basic.phpt	2009-08-24 02:50:19 UTC (rev 287624)
@@ -0,0 +1,30 @@
+--TEST--
+Testing imagecolorallocatealpha()
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+	if (!extension_loaded(gd)) die(skip GD not present);
+?
+--FILE--
+?php
+$img = imagecreatetruecolor(150, 150);
+
+$cor = imagecolorallocate($img, 50, 100, 255);
+$corA = imagecolorallocatealpha($img, 50, 100, 255, 50);
+//$whiteA = imagecolorallocatealpha($img, 255, 255, 255, 127);
+
+$half =  imagefilledarc ( $img, 75, 75, 70, 70, 0, 180, $cor, IMG_ARC_PIE );
+$half2 =  imagefilledarc ( $img, 75, 75, 70, 70, 180, 360, $corA, IMG_ARC_PIE );
+
+ob_start();
+imagepng($img, null, 9);
+$imgsrc = ob_get_contents();
+ob_end_clean();
+
+var_dump(md5(base64_encode($imgsrc)));
+var_dump($corA);
+?
+--EXPECT--
+string(32) b856a0b1a15efe0f79551ebbb5651fe8
+int(842163455)
\ No newline at end of file

Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error1.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error1.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error1.phpt	2009-08-24 02:50:19 UTC (rev 287624)
@@ -0,0 +1,25 @@
+--TEST--
+Testing imagecolorallocatealpha(): Wrong types for parameter 1
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+	if (!extension_loaded(gd)) die(skip GD not present);
+?
+--FILE--
+?php
+$resource = tmpfile();
+
+imagecolorallocatealpha($resource, 255, 255, 255, 50);
+imagecolorallocatealpha('string', 255, 255, 255, 50);
+imagecolorallocatealpha(array(), 255, 255, 255, 50);
+imagecolorallocatealpha(null, 255, 255, 255, 50);
+?
+--EXPECTF--
+Warning: imagecolorallocatealpha(): supplied resource is not a valid Image resource in %s on line %d
+
+Warning: imagecolorallocatealpha(): supplied argument is not a valid Image resource in %s on line %d
+
+Warning: imagecolorallocatealpha(): supplied argument is not a valid Image resource in %s on line %d
+
+Warning: imagecolorallocatealpha(): supplied argument is not a valid Image resource in %s on line %d
\ No newline at end of file

Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error2.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error2.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocatealpha_error2.phpt	2009-08-24 02:50:19 UTC (rev 287624)
@@ -0,0 +1,22 @@
+--TEST--
+Testing imagecolorallocatealpha(): Wrong types for parameter 2
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+	if (!extension_loaded(gd)) die(skip GD not present);
+?
+--FILE--
+?php
+$img = imagecreatetruecolor(200, 200);
+
+imagecolorallocatealpha($img, 'string-non-numeric', 255, 255, 50);

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/gd/tests/imagesetthickness_basic.phpt branches/PHP_5_2/ext/gd/tests/imagesetthickness_error1.phpt branches/PHP_5_2/ext/gd/tests/imagesetthickness_erro

2009-07-23 Thread Rafael Machado Dohms
rdohms   Fri, 24 Jul 2009 03:06:05 +

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

Log:
Adding tests for imagesetthickness, basic and errors for both params, and 
complementing imagetruecolortopalette with out of bound params

Changed paths:
A   php/php-src/branches/PHP_5_2/ext/gd/tests/imagesetthickness_basic.phpt
A   php/php-src/branches/PHP_5_2/ext/gd/tests/imagesetthickness_error1.phpt
A   php/php-src/branches/PHP_5_2/ext/gd/tests/imagesetthickness_error2.phpt
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagetruecolortopalette_error4.phpt
A   php/php-src/branches/PHP_5_3/ext/gd/tests/imagesetthickness_basic.phpt
A   php/php-src/branches/PHP_5_3/ext/gd/tests/imagesetthickness_error1.phpt
A   php/php-src/branches/PHP_5_3/ext/gd/tests/imagesetthickness_error2.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imagetruecolortopalette_error4.phpt
A   php/php-src/trunk/ext/gd/tests/imagesetthickness_basic.phpt
A   php/php-src/trunk/ext/gd/tests/imagesetthickness_error1.phpt
A   php/php-src/trunk/ext/gd/tests/imagesetthickness_error2.phpt
A   php/php-src/trunk/ext/gd/tests/imagetruecolortopalette_error4.phpt

Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagesetthickness_basic.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imagesetthickness_basic.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagesetthickness_basic.phpt	2009-07-24 03:06:05 UTC (rev 284678)
@@ -0,0 +1,34 @@
+--TEST--
+Testing imagetruecolortopalette() of GD library
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+	if (!extension_loaded(gd)) die(skip GD not present);
+	if (!function_exists(imagecreatetruecolor)) die(skip GD Version not compatible);
+?
+--FILE--
+?php
+// Create a 200x100 image
+$image = imagecreatetruecolor(200, 100);
+$white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
+$black = imagecolorallocate($image, 0x00, 0x00, 0x00);
+
+// Set the background to be white
+imagefilledrectangle($image, 0, 0, 299, 99, $white);
+
+// Set the line thickness to 5
+imagesetthickness($image, 5);
+
+// Draw the rectangle
+imagerectangle($image, 14, 14, 185, 85, $black);
+
+ob_start();
+imagepng($image, null, 9);
+$img = ob_get_contents();
+ob_end_clean();
+
+echo md5(base64_encode($img));
+?
+--EXPECT--
+93c3077f1bdc372cd0b0db96db282985
\ No newline at end of file

Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagesetthickness_error1.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imagesetthickness_error1.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagesetthickness_error1.phpt	2009-07-24 03:06:05 UTC (rev 284678)
@@ -0,0 +1,22 @@
+--TEST--
+Testing imagetruecolortopalette(): wrong types for first parameter
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+	if (!extension_loaded(gd)) die(skip GD not present);
+?
+--FILE--
+?php
+$resource = tmpfile();
+
+imagesetthickness('string', 5);
+imagesetthickness(array(), 5);
+imagesetthickness($resource, 5);
+?
+--EXPECTF--
+Warning: imagesetthickness(): supplied argument is not a valid Image resource in %s on line %d
+
+Warning: imagesetthickness(): supplied argument is not a valid Image resource in %s on line %d
+
+Warning: imagesetthickness(): supplied resource is not a valid Image resource in %s on line %d
\ No newline at end of file

Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagesetthickness_error2.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imagesetthickness_error2.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagesetthickness_error2.phpt	2009-07-24 03:06:05 UTC (rev 284678)
@@ -0,0 +1,24 @@
+--TEST--
+Testing imagetruecolortopalette(): wrong types for second parameter
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+	if (!extension_loaded(gd)) die(skip GD not present);
+	if (!function_exists(imagecreatetruecolor)) die(skip GD Version not compatible);
+?
+--FILE--
+?php
+$image = imagecreatetruecolor(200, 100);
+
+$a = imagesetthickness($image, 's');
+$b = imagesetthickness($image, array());
+$c = imagesetthickness($image, $image);
+
+var_dump($a, $b, $c);
+//All should be true because 5,2 does not check parameters
+?
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
\ No newline at end of file

Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagetruecolortopalette_error4.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imagetruecolortopalette_error4.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagetruecolortopalette_error4.phpt	2009-07-24 03:06:05 UTC (rev 284678)

[PHP-CVS] svn: php/php-src/ branches/PHP_5_2/ext/gd/tests/imagecolorallocate_variation3.phpt branches/PHP_5_2/ext/gd/tests/imagecolorallocate_variation4.phpt trunk/ext/gd/tests/imagecolorallocate_vari

2009-07-19 Thread Rafael Machado Dohms
rdohms  Sun, 19 Jul 2009 22:16:35 +

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


Changed paths:
U   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocate_variation3.phpt
U   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocate_variation4.phpt
U   php/php-src/trunk/ext/gd/tests/imagecolorallocate_variation3.phpt

Log:
Adjusting tests to use EXPECTF (faster testing) and adjusting 5_2 version to 
lack of parameter validation

Modified: 
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocate_variation3.phpt
===
--- 
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocate_variation3.phpt
2009-07-19 22:16:35 UTC (rev 284389)
+++ 
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocate_variation3.phpt
2009-07-19 22:16:35 UTC (rev 284390)
@@ -55,8 +55,8 @@
   // float data
   'float 10.5' = 10.5,
   'float -10.5' = -10.5,
-  'float 10.1234567e10' = 10.1234567e10,
-  'float 10.7654321E-10' = 10.7654321E-10,
+  'float 10.1234567e5' = 10.1234567e5,
+  'float 10.7654321E-5' = 10.7654321E-5,
   'float .5' = .5,

   // array data
@@ -114,10 +114,10 @@
 --float -10.5--
 int(652810)

---float 10.1234567e10--
-int(217143306)
+--float 10.1234567e5--
+int(259815690)

---float 10.7654321E-10--
+--float 10.7654321E-5--
 int(655370)

 --float .5--

Modified: 
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocate_variation4.phpt
===
--- 
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocate_variation4.phpt
2009-07-19 22:16:35 UTC (rev 284389)
+++ 
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecolorallocate_variation4.phpt
2009-07-19 22:16:35 UTC (rev 284390)
@@ -114,7 +114,7 @@
 int(657910)

 --float 10.1234567e10--
-bool(false)
+int(657919)

 --float 10.7654321E-10--
 int(657920)

Modified: php/php-src/trunk/ext/gd/tests/imagecolorallocate_variation3.phpt
===
--- php/php-src/trunk/ext/gd/tests/imagecolorallocate_variation3.phpt   
2009-07-19 22:16:35 UTC (rev 284389)
+++ php/php-src/trunk/ext/gd/tests/imagecolorallocate_variation3.phpt   
2009-07-19 22:16:35 UTC (rev 284390)
@@ -55,8 +55,8 @@
   // float data
   'float 10.5' = 10.5,
   'float -10.5' = -10.5,
-  'float 10.1234567e10' = 10.1234567e10,
-  'float 10.7654321E-10' = 10.7654321E-10,
+  'float 10.1234567e5' = 10.1234567e5,
+  'float 10.7654321E-5' = 10.7654321E-5,
   'float .5' = .5,

   // array data
@@ -105,110 +105,110 @@
 };
 ?
 ===DONE===
---EXPECTREGEX--
-\*\*\* Testing imagecolorallocate\(\) : usage variations \*\*\*
+--EXPECTF--
+*** Testing imagecolorallocate() : usage variations ***

 --float 10.5--
-int\(657930\)
+int(657930)

 --float -10.5--
-int\(652810\)
+int(652810)

---float 10.1234567e10--
-int\(655114\)|int\(217143306\)
+--float 10.1234567e5--
+int(259815690)

---float 10.7654321E-10--
-int\(655370\)
+--float 10.7654321E-5--
+int(655370)

 --float .5--
-int\(655370\)
+int(655370)

 --empty array--

-Warning: imagecolorallocate\(\) expects parameter 3 to be long, array given in 
(\w*|\/|\.)* on line \d+
+Warning: imagecolorallocate() expects parameter 3 to be long, array given in 
%s on line %d
 NULL

 --int indexed array--

-Warning: imagecolorallocate\(\) expects parameter 3 to be long, array given in 
(\w*|\/|\.)* on line \d+
+Warning: imagecolorallocate() expects parameter 3 to be long, array given in 
%s on line %d
 NULL

 --associative array--

-Warning: imagecolorallocate\(\) expects parameter 3 to be long, array given in 
(\w*|\/|\.)* on line \d+
+Warning: imagecolorallocate() expects parameter 3 to be long, array given in 
%s on line %d
 NULL

 --nested arrays--

-Warning: imagecolorallocate\(\) expects parameter 3 to be long, array given in 
(\w*|\/|\.)* on line \d+
+Warning: imagecolorallocate() expects parameter 3 to be long, array given in 
%s on line %d
 NULL

 --uppercase NULL--
-int\(655370\)
+int(655370)

 --lowercase null--
-int\(655370\)
+int(655370)

 --lowercase true--
-int\(655626\)
+int(655626)

 --lowercase false--
-int\(655370\)
+int(655370)

 --uppercase TRUE--
-int\(655626\)
+int(655626)

 --uppercase FALSE--
-int\(655370\)
+int(655370)

 --empty string DQ--

-Warning: imagecolorallocate\(\) expects parameter 3 to be long, Unicode string 
given in (\w*|\/|\.)* on line \d+
+Warning: imagecolorallocate() expects parameter 3 to be long, Unicode string 
given in %s on line %d
 NULL

 --empty string SQ--

-Warning: imagecolorallocate\(\) expects parameter 3 to be long, Unicode string 
given in (\w*|\/|\.)* on line \d+
+Warning: imagecolorallocate() expects parameter 3 to be long, Unicode string 
given in %s on line %d
 NULL

 --string DQ--

-Warning: imagecolorallocate\(\) expects parameter 3 to be long, Unicode string 
given in 

[PHP-CVS] svn: php/php-src/ branches/PHP_5_2/ext/gd/tests/imageistruecolor_basic.phpt branches/PHP_5_2/ext/gd/tests/imageistruecolor_error1.phpt branches/PHP_5_2/ext/gd/tests/imagetruecolortopalette_b

2009-07-19 Thread Rafael Machado Dohms
rdohms  Mon, 20 Jul 2009 03:47:29 +

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

Changed paths:
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imageistruecolor_basic.phpt
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imageistruecolor_error1.phpt
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagetruecolortopalette_basic.phpt
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagetruecolortopalette_error1.phpt
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagetruecolortopalette_error2.phpt
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagetruecolortopalette_error3.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imageistruecolor_basic.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imageistruecolor_error1.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imagetruecolortopalette_basic.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imagetruecolortopalette_error1.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imagetruecolortopalette_error2.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imagetruecolortopalette_error3.phpt
A   php/php-src/trunk/ext/gd/tests/imageistruecolor_basic.phpt
A   php/php-src/trunk/ext/gd/tests/imageistruecolor_error1.phpt
A   php/php-src/trunk/ext/gd/tests/imagetruecolortopalette_basic.phpt
A   php/php-src/trunk/ext/gd/tests/imagetruecolortopalette_error1.phpt
A   php/php-src/trunk/ext/gd/tests/imagetruecolortopalette_error2.phpt
A   php/php-src/trunk/ext/gd/tests/imagetruecolortopalette_error3.phpt

Log:
Separating and complementing imageistruecolor and imagetruecolortopalette tests

Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imageistruecolor_basic.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imageistruecolor_basic.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imageistruecolor_basic.phpt	2009-07-20 03:47:29 UTC (rev 284409)
@@ -0,0 +1,17 @@
+--TEST--
+Testing imageistruecolor() of GD library
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+	if (!extension_loaded(gd)) die(skip GD not present);
+	if (!function_exists(imagecreatetruecolor)) die(skip GD Version not compatible);
+?
+--FILE--
+?php
+$image = imagecreatetruecolor(180, 30);
+
+var_dump(imageistruecolor($image));
+?
+--EXPECT--
+bool(true)
\ No newline at end of file

Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imageistruecolor_error1.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imageistruecolor_error1.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imageistruecolor_error1.phpt	2009-07-20 03:47:29 UTC (rev 284409)
@@ -0,0 +1,24 @@
+--TEST--
+Testing imageistruecolor(): wrong parameters
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+	if (!extension_loaded(gd)) die(skip GD not present);
+	if (!function_exists(imagecreatetruecolor)) die(skip GD Version not compatible);
+?
+--FILE--
+?php
+$image = imagecreatetruecolor(180, 30);
+$resource = tmpfile();
+
+imageistruecolor('string');
+imageistruecolor($resource);
+imageistruecolor(array());
+?
+--EXPECTF--
+Warning: imageistruecolor(): supplied argument is not a valid Image resource in %s on line %d
+
+Warning: imageistruecolor(): supplied resource is not a valid Image resource in %s on line %d
+
+Warning: imageistruecolor(): supplied argument is not a valid Image resource in %s on line %d
\ No newline at end of file

Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagetruecolortopalette_basic.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imagetruecolortopalette_basic.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagetruecolortopalette_basic.phpt	2009-07-20 03:47:29 UTC (rev 284409)
@@ -0,0 +1,31 @@
+--TEST--
+Testing imagetruecolortopalette() of GD library
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+	if (!extension_loaded(gd)) die(skip GD not present);
+	if (!function_exists(imagecreatetruecolor)) die(skip GD Version not compatible);
+?
+--FILE--
+?php
+$image = imagecreatetruecolor(150, 150);
+
+$a = imagecolorallocate($image,255,0,255);
+$b = imagecolorallocate($image,0,255,255);
+
+$half =  imagefilledarc ( $image, 75, 75, 70, 70, 0, 180, $a, IMG_ARC_PIE );
+$half2 =  imagefilledarc ( $image, 75, 55, 80, 70, 0, -180, $b, IMG_ARC_PIE );
+
+var_dump(imagetruecolortopalette($image, true, 2));
+
+ob_start();
+imagepng($image, null, 9);
+$img = ob_get_contents();
+ob_end_clean();
+
+echo md5(base64_encode($img));
+?
+--EXPECT--
+bool(true)
+0843f63ab2f9fddedd69b0b421686bc5
\ No newline at end of file

Added: 

[PHP-CVS] svn: php/php-src/ branches/PHP_5_2/ext/gd/tests/truecolor.phpt branches/PHP_5_3/ext/gd/tests/truecolor.phpt trunk/ext/gd/tests/truecolor.phpt

2009-07-19 Thread Rafael Machado Dohms
rdohms  Mon, 20 Jul 2009 03:48:55 +

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

Changed paths:
D   php/php-src/branches/PHP_5_2/ext/gd/tests/truecolor.phpt
D   php/php-src/branches/PHP_5_3/ext/gd/tests/truecolor.phpt
D   php/php-src/trunk/ext/gd/tests/truecolor.phpt

Log:
Removing deprecated test replaced by individual tests for imageistruecolor and 
imagetruecolortopalette

Deleted: php/php-src/branches/PHP_5_2/ext/gd/tests/truecolor.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/truecolor.phpt2009-07-20 
03:47:29 UTC (rev 284409)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/truecolor.phpt2009-07-20 
03:48:55 UTC (rev 284410)
@@ -1,19 +0,0 @@
---TEST--
-imageistruecolor, truecolortopalette
---SKIPIF--
-?php
-if (!function_exists('imagetruecolortopalette')) die(skip gd 
extension not available\n);
-?
---FILE--
-?php
-$im = imagecreatetruecolor(1,1);
-if (imageistruecolor($im)) echo ok\n;
-
-if (imagetruecolortopalette($im, 1,2)) echo ok\n;
-if (!imageistruecolor($im)) echo ok\n;
-
-?
---EXPECTF--
-ok
-ok
-ok

Deleted: php/php-src/branches/PHP_5_3/ext/gd/tests/truecolor.phpt
===
--- php/php-src/branches/PHP_5_3/ext/gd/tests/truecolor.phpt2009-07-20 
03:47:29 UTC (rev 284409)
+++ php/php-src/branches/PHP_5_3/ext/gd/tests/truecolor.phpt2009-07-20 
03:48:55 UTC (rev 284410)
@@ -1,19 +0,0 @@
---TEST--
-imageistruecolor, truecolortopalette
---SKIPIF--
-?php
-if (!function_exists('imagetruecolortopalette')) die(skip gd 
extension not available\n);
-?
---FILE--
-?php
-$im = imagecreatetruecolor(1,1);
-if (imageistruecolor($im)) echo ok\n;
-
-if (imagetruecolortopalette($im, 1,2)) echo ok\n;
-if (!imageistruecolor($im)) echo ok\n;
-
-?
---EXPECTF--
-ok
-ok
-ok

Deleted: php/php-src/trunk/ext/gd/tests/truecolor.phpt
===
--- php/php-src/trunk/ext/gd/tests/truecolor.phpt   2009-07-20 03:47:29 UTC 
(rev 284409)
+++ php/php-src/trunk/ext/gd/tests/truecolor.phpt   2009-07-20 03:48:55 UTC 
(rev 284410)
@@ -1,19 +0,0 @@
---TEST--
-imageistruecolor, truecolortopalette
---SKIPIF--
-?php
-if (!function_exists('imagetruecolortopalette')) die(skip gd 
extension not available\n);
-?
---FILE--
-?php
-$im = imagecreatetruecolor(1,1);
-if (imageistruecolor($im)) echo ok\n;
-
-if (imagetruecolortopalette($im, 1,2)) echo ok\n;
-if (!imageistruecolor($im)) echo ok\n;
-
-?
---EXPECTF--
-ok
-ok
-ok

-- 
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/gd/tests/ imagecreatetruecolor_basic.phpt imagecreatetruecolor_error1.phpt imagecreatetruecolor_error2.phpt imagecreatetruecolor_error3.phpt

2009-07-18 Thread Rafael Machado Dohms
rdohms  Sun, 19 Jul 2009 01:42:08 +

URL: http://svn.php.net/viewvc?view=revisionrevision=284342

Changed paths:
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_basic.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_error1.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_error2.phpt
A   
php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_error3.phpt

Log:
Commiting imagecreatetruecolor tests for PHP_5_3 branch

Added: php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_basic.phpt
===
--- php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_basic.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_basic.phpt   
2009-07-19 01:42:08 UTC (rev 284342)
@@ -0,0 +1,22 @@
+--TEST--
+Testing imagecreatetruecolor() of GD library
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+   if (!extension_loaded(gd)) die(skip GD not present);
+   if (!function_exists(imagecreatetruecolor)) die(skip GD Version not 
compatible);
+?
+--FILE--
+?php
+$image = imagecreatetruecolor(180, 30);
+
+ob_start();
+imagepng($image, null, 9);
+$img = ob_get_contents();
+ob_end_clean();
+
+echo md5(base64_encode($img));
+?
+--EXPECT--
+5a8fe9864cbd20e5dbe730c77f30db95

Added: 
php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_error1.phpt
===
--- php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_error1.phpt  
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_error1.phpt  
2009-07-19 01:42:08 UTC (rev 284342)
@@ -0,0 +1,18 @@
+--TEST--
+Testing imagecreatetruecolor(): error on non-long parameters
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+   if (!extension_loaded(gd)) die(skip GD not present);
+   if (!function_exists(imagecreatetruecolor)) die(skip GD Version not 
compatible);
+?
+--FILE--
+?php
+$image = imagecreatetruecolor('s', 30);
+$image = imagecreatetruecolor(30, 's');
+?
+--EXPECTF--
+Warning: imagecreatetruecolor() expects parameter 1 to be long, %s given in %s 
on line %d
+
+Warning: imagecreatetruecolor() expects parameter 2 to be long, %s given in %s 
on line %d

Added: 
php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_error2.phpt
===
--- php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_error2.phpt  
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_error2.phpt  
2009-07-19 01:42:08 UTC (rev 284342)
@@ -0,0 +1,24 @@
+--TEST--
+Testing imagecreatetruecolor(): error on out of bound parameters
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+   if (!extension_loaded(gd)) die(skip GD not present);
+   if (!function_exists(imagecreatetruecolor)) die(skip GD Version not 
compatible);
+?
+--FILE--
+?php
+$image = imagecreatetruecolor(-1, 30);
+$image = imagecreatetruecolor(30, -1);
+$image = imagecreatetruecolor(999, 30);
+$image = imagecreatetruecolor(30, 999);
+?
+--EXPECTF--
+Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d
+
+Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d
+
+Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d
+
+Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d
\ No newline at end of file

Added: 
php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_error3.phpt
===
--- php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_error3.phpt  
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/gd/tests/imagecreatetruecolor_error3.phpt  
2009-07-19 01:42:08 UTC (rev 284342)
@@ -0,0 +1,21 @@
+--TEST--
+Testing imagecreatetruecolor(): error on wrong parameter count
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+   if (!extension_loaded(gd)) die(skip GD not present);
+   if (!function_exists(imagecreatetruecolor)) die(skip GD Version not 
compatible);
+?
+--FILE--
+?php
+$image = imagecreatetruecolor();
+$image = imagecreatetruecolor(30);
+$image = imagecreatetruecolor(1,1,1);
+?
+--EXPECTF--
+Warning: imagecreatetruecolor() expects exactly 2 parameters, 0 given in %s on 
line %d
+
+Warning: imagecreatetruecolor() expects exactly 2 parameters, 1 given in %s on 
line %d
+
+Warning: imagecreatetruecolor() expects exactly 2 parameters, 3 given in %s on 
line %d
\ No newline at end of file

-- 
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_2/ext/gd/tests/imagecreatetruecolor_basic.phpt branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_error1.phpt branches/PHP_5_2/ext/gd/tests/imagecreatetrueco

2009-07-18 Thread Rafael Machado Dohms
rdohms  Sun, 19 Jul 2009 01:44:19 +

URL: http://svn.php.net/viewvc?view=revisionrevision=284343

Changed paths:
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_basic.phpt
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_error1.phpt
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_error2.phpt
A   
php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_error3.phpt
A   php/php-src/trunk/ext/gd/tests/imagecreatetruecolor_basic.phpt
A   php/php-src/trunk/ext/gd/tests/imagecreatetruecolor_error1.phpt
A   php/php-src/trunk/ext/gd/tests/imagecreatetruecolor_error2.phpt
A   php/php-src/trunk/ext/gd/tests/imagecreatetruecolor_error3.phpt

Log:
Adding tests for imagecreatetruecolor for PHP_5_2 and trunk
Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_basic.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_basic.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_basic.phpt	2009-07-19 01:44:19 UTC (rev 284343)
@@ -0,0 +1,22 @@
+--TEST--
+Testing imagecreatetruecolor() of GD library
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+	if (!extension_loaded(gd)) die(skip GD not present);
+	if (!function_exists(imagecreatetruecolor)) die(skip GD Version not compatible);
+?
+--FILE--
+?php
+$image = imagecreatetruecolor(180, 30);
+
+ob_start();
+imagepng($image, null, 9);
+$img = ob_get_contents();
+ob_end_clean();
+
+echo md5(base64_encode($img));
+?
+--EXPECT--
+5a8fe9864cbd20e5dbe730c77f30db95

Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_error1.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_error1.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_error1.phpt	2009-07-19 01:44:19 UTC (rev 284343)
@@ -0,0 +1,18 @@
+--TEST--
+Testing imagecreatetruecolor(): error on non-long parameters
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+	if (!extension_loaded(gd)) die(skip GD not present);
+	if (!function_exists(imagecreatetruecolor)) die(skip GD Version not compatible);
+?
+--FILE--
+?php
+$image = imagecreatetruecolor('s', 30);
+$image = imagecreatetruecolor(30, 's');
+?
+--EXPECTF--
+Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d
+
+Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d

Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_error2.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_error2.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_error2.phpt	2009-07-19 01:44:19 UTC (rev 284343)
@@ -0,0 +1,24 @@
+--TEST--
+Testing imagecreatetruecolor(): error on out of bound parameters
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+	if (!extension_loaded(gd)) die(skip GD not present);
+	if (!function_exists(imagecreatetruecolor)) die(skip GD Version not compatible);
+?
+--FILE--
+?php
+$image = imagecreatetruecolor(-1, 30);
+$image = imagecreatetruecolor(30, -1);
+$image = imagecreatetruecolor(999, 30);
+$image = imagecreatetruecolor(30, 999);
+?
+--EXPECTF--
+Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d
+
+Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d
+
+Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d
+
+Warning: imagecreatetruecolor(): Invalid image dimensions in %s on line %d
\ No newline at end of file

Added: php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_error3.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_error3.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagecreatetruecolor_error3.phpt	2009-07-19 01:44:19 UTC (rev 284343)
@@ -0,0 +1,21 @@
+--TEST--
+Testing imagecreatetruecolor(): error on wrong parameter count
+--CREDITS--
+Rafael Dohms rdohms [at] gmail [dot] com
+--SKIPIF--
+?php
+	if (!extension_loaded(gd)) die(skip GD not present);
+	if (!function_exists(imagecreatetruecolor)) die(skip GD Version not compatible);
+?
+--FILE--
+?php
+$image = imagecreatetruecolor();
+$image = imagecreatetruecolor(30);
+$image = imagecreatetruecolor(1,1,1);
+?
+--EXPECTF--
+Warning: Wrong parameter count for imagecreatetruecolor() in %s on line %d
+
+Warning: Wrong parameter count for imagecreatetruecolor() in %s on line %d
+
+Warning: Wrong parameter count for imagecreatetruecolor() in %s on