]> granicus.if.org Git - php/commitdiff
- Fixed tests
authorFelipe Pena <felipe@php.net>
Wed, 1 Jul 2009 02:32:55 +0000 (02:32 +0000)
committerFelipe Pena <felipe@php.net>
Wed, 1 Jul 2009 02:32:55 +0000 (02:32 +0000)
ext/gd/tests/jpeg2wbmp_error1.phpt
ext/gd/tests/jpeg2wbmp_error2.phpt
ext/gd/tests/jpeg2wbmp_error3.phpt
ext/gd/tests/png2wbmp_error1.phpt
ext/gd/tests/png2wbmp_error2.phpt
ext/gd/tests/png2wbmp_error3.phpt

index 6ab0b055b6339e05b2f84031025e4be8b5e71204..b6514de8ba9cb5d86ba93f1cafedab6d73e58cb0 100755 (executable)
@@ -19,14 +19,17 @@ $im = imagecreatetruecolor(120, 20);
 $text_color = imagecolorallocate($im, 255, 255, 255);
 imagestring($im, 1, 5, 5,  'A Simple Text String', $text_color);
 
+$file = dirname(__FILE__) .'/simpletext.jpg';
+$file2 = dirname(__FILE__) .'/simpletext.wbmp';
+
 // Save the image as 'simpletext.jpg'
-imagejpeg($im, 'simpletext.jpg');
+imagejpeg($im, $file);
 
 // Free up memory
 imagedestroy($im);
 
-jpeg2wbmp('simpletext.jpg', 'simpletext.wbmp', 20, 120, 9);
-jpeg2wbmp('simpletext.jpg', 'simpletext.wbmp', 20, 120, -1);
+jpeg2wbmp($file, $file2, 20, 120, 9);
+jpeg2wbmp($file', $file2, 20, 120, -1);
 ?>
 --EXPECTF--
 Warning: jpeg2wbmp(): Invalid threshold value '9' in %s on line %d
@@ -34,5 +37,6 @@ Warning: jpeg2wbmp(): Invalid threshold value '9' in %s on line %d
 Warning: jpeg2wbmp(): Invalid threshold value '-1' in %s on line %d
 --CLEAN--
 <?php
-unlink('simpletext.jpg');
-?>
\ No newline at end of file
+unlink(dirname(__FILE__) .'/simpletext.jpg');
+unlink(dirname(__FILE__) .'/simpletext.wbmp');
+?>
index 23a4162ce52340db5ae4aa268a669836441dcca2..692dcb842d9c5b7eb2d26bb61b1a0069db75119d 100755 (executable)
@@ -14,9 +14,10 @@ if(!function_exists('jpeg2wbmp')) {
 ?>
 --FILE--
 <?php
-jpeg2wbmp('', 'simpletext.wbmp', 20, 120, 8);
-jpeg2wbmp(null, 'simpletext.wbmp', 20, 120, 8);
-jpeg2wbmp(false, 'simpletext.wbmp', 20, 120, 8);
+$file = dirname(__FILE__) .'/simpletext.wbmp';
+jpeg2wbmp('', $file, 20, 120, 8);
+jpeg2wbmp(null, $file, 20, 120, 8);
+jpeg2wbmp(false, $file, 20, 120, 8);
 ?>
 --EXPECTF--
 Warning: jpeg2wbmp(): Unable to open '' for reading in %s on line %d
@@ -26,5 +27,5 @@ Warning: jpeg2wbmp(): Unable to open '' for reading in %s on line %d
 Warning: jpeg2wbmp(): Unable to open '' for reading in %s on line %d
 --CLEAN--
 <?php
-unlink('simpletext.jpg');
-?>
\ No newline at end of file
+unlink(dirname(__FILE__) .'/simpletext.wbmp');
+?>
index 2cf0beceaa82b630f4ebf7cd6e3a4081a91e3b01..df436c8cc3d96d062b485afe982ea0cf2b64dc56 100755 (executable)
@@ -19,15 +19,17 @@ $im = imagecreatetruecolor(120, 20);
 $text_color = imagecolorallocate($im, 255, 255, 255);
 imagestring($im, 1, 5, 5,  'A Simple Text String', $text_color);
 
+$file = dirname(__FILE__) .'/simpletext.jpg';
+
 // Save the image as 'simpletext.jpg'
-imagejpeg($im, 'simpletext.jpg');
+imagejpeg($im, $file);
 
 // Free up memory
 imagedestroy($im);
 
-jpeg2wbmp('simpletext.jpg', '', 20, 120, 8);
-jpeg2wbmp('simpletext.jpg', null, 20, 120, 8);
-jpeg2wbmp('simpletext.jpg', false, 20, 120, 8);
+jpeg2wbmp($file, '', 20, 120, 8);
+jpeg2wbmp($file, null, 20, 120, 8);
+jpeg2wbmp($file, false, 20, 120, 8);
 ?>
 --EXPECTF--
 Warning: jpeg2wbmp(): Unable to open '' for writing in %s on line %d
@@ -37,5 +39,5 @@ Warning: jpeg2wbmp(): Unable to open '' for writing in %s on line %d
 Warning: jpeg2wbmp(): Unable to open '' for writing in %s on line %d
 --CLEAN--
 <?php
-unlink('simpletext.jpg');
-?>
\ No newline at end of file
+unlink(dirname(__FILE__) .'/simpletext.jpg');
+?>
index edb5b935c7fb9714fce0f4797c2fa569a629b85b..1e9d717d94e2be62cb54fa1a39617e62d37c604c 100755 (executable)
@@ -19,14 +19,17 @@ $im = imagecreatetruecolor(120, 20);
 $text_color = imagecolorallocate($im, 255, 255, 255);
 imagestring($im, 1, 5, 5,  'A Simple Text String', $text_color);
 
+$file = dirname(__FILE__) .'/simpletext.png';
+$file2 = dirname(__FILE__) .'/simpletext.wbmp';
+
 // Save the image as 'simpletext.png'
-imagepng($im, 'simpletext.png');
+imagepng($im, $file);
 
 // Free up memory
 imagedestroy($im);
 
-png2wbmp('simpletext.png', 'simpletext.wbmp', 20, 120, 9);
-png2wbmp('simpletext.png', 'simpletext.wbmp', 20, 120, -1);
+png2wbmp($file, $file2, 20, 120, 9);
+png2wbmp($file, $file2, 20, 120, -1);
 ?>
 --EXPECTF--
 Warning: png2wbmp(): Invalid threshold value '9' in %s on line %d
@@ -34,5 +37,6 @@ Warning: png2wbmp(): Invalid threshold value '9' in %s on line %d
 Warning: png2wbmp(): Invalid threshold value '-1' in %s on line %d
 --CLEAN--
 <?php
-unlink('simpletext.png');
-?>
\ No newline at end of file
+unlink(dirname(__FILE__) .'/simpletext.png');
+unlink(dirname(__FILE__) .'/simpletext.wbmp');
+?>
index 248ed6e13c5951f3e04bdaa5042077ecdd888978..ba8e43e7f0e28f8c1b551f5ef7930d46920ee9d7 100755 (executable)
@@ -14,9 +14,10 @@ if(!function_exists('png2wbmp')) {
 ?>
 --FILE--
 <?php
-png2wbmp('', 'simpletext.wbmp', 20, 120, 8);
-png2wbmp(null, 'simpletext.wbmp', 20, 120, 8);
-png2wbmp(false, 'simpletext.wbmp', 20, 120, 8);
+$file = dirname(__FILE__) .'/simpletext.wbmp';
+png2wbmp('', $file, 20, 120, 8);
+png2wbmp(null, $file, 20, 120, 8);
+png2wbmp(false, $file, 20, 120, 8);
 ?>
 --EXPECTF--
 Warning: png2wbmp(): Unable to open '' for reading in %s on line %d
@@ -26,5 +27,5 @@ Warning: png2wbmp(): Unable to open '' for reading in %s on line %d
 Warning: png2wbmp(): Unable to open '' for reading in %s on line %d
 --CLEAN--
 <?php
-unlink('simpletext.jpg');
-?>
\ No newline at end of file
+unlink(dirname(__FILE__) .'/simpletext.wbmp');
+?>
index 45eb05b041aabe970c23b3daedaad8ff21264c1d..1e33f59b184273bf16aca5487b180fed0f6382b7 100755 (executable)
@@ -19,15 +19,17 @@ $im = imagecreatetruecolor(120, 20);
 $text_color = imagecolorallocate($im, 255, 255, 255);
 imagestring($im, 1, 5, 5,  'A Simple Text String', $text_color);
 
+$file = dirname(__FILE__) .'/simpletext.png';
+
 // Save the image as 'simpletext.png'
-imagepng($im, 'simpletext.png');
+imagepng($im, $file);
 
 // Free up memory
 imagedestroy($im);
 
-png2wbmp('simpletext.png', '', 20, 120, 8);
-png2wbmp('simpletext.png', null, 20, 120, 8);
-png2wbmp('simpletext.png', false, 20, 120, 8);
+png2wbmp($file, '', 20, 120, 8);
+png2wbmp($file, null, 20, 120, 8);
+png2wbmp($file, false, 20, 120, 8);
 ?>
 --EXPECTF--
 Warning: png2wbmp(): Unable to open '' for writing in %s on line %d
@@ -37,5 +39,5 @@ Warning: png2wbmp(): Unable to open '' for writing in %s on line %d
 Warning: png2wbmp(): Unable to open '' for writing in %s on line %d
 --CLEAN--
 <?php
-unlink('simpletext.png');
-?>
\ No newline at end of file
+unlink(dirname(__FILE__) .'/simpletext.png');
+?>