diff options
Diffstat (limited to 'ext/gd/tests/imagecolordeallocate_error4.phpt')
-rw-r--r-- | ext/gd/tests/imagecolordeallocate_error4.phpt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/gd/tests/imagecolordeallocate_error4.phpt b/ext/gd/tests/imagecolordeallocate_error4.phpt new file mode 100644 index 0000000000..7aaeffebee --- /dev/null +++ b/ext/gd/tests/imagecolordeallocate_error4.phpt @@ -0,0 +1,22 @@ +--TEST-- +Testing imagecolordeallocate() of GD library with Out of range intergers (Below) +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +#testfest PHPSP on 2009-06-20 +--SKIPIF-- +<?php + if (!extension_loaded("gd")) die("skip GD not present"); +?> +--FILE-- +<?php +$image = imagecreate(180, 30); +$white = imagecolorallocate($image, 255, 255, 255); + +$totalColors = imagecolorstotal($image); + +$result = imagecolordeallocate($image, -1.0); +var_dump($result); +?> +--EXPECTF-- +Warning: imagecolordeallocate(): Color index -1 out of range in %s on line %d +bool(false) |