File: tr18561b.t

package info (click to toggle)
libimager-perl 0.75-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,532 kB
  • ctags: 3,278
  • sloc: ansic: 24,109; perl: 21,732; makefile: 13
file content (17 lines) | stat: -rw-r--r-- 471 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!perl -w
# variant on the code that produces 18561
# the old _color() code could return floating colors in some cases
# but in most cases the caller couldn't handle it
use strict;
use Test::More tests => 1;
eval {
  use Imager;
  use Imager::Color::Float; # prevent the actual 18561 crash
  my $i = Imager->new(
	  xsize => 50,
	  ysize => 50,
  );
  $i->line(x1 => 0, y1 => 0, x2 => 99, y2=>99, color => [ 0, 0, 0 ]);
};
ok(!$@, "shouldn't crash")
  or print "# $@\n";