4 use Imager::Color::Float;
9 if ($Config{useithreads} && $] > 5.008007) {
21 or plan skip_all => "can't test Imager's lack of threads support with no threads";
23 or plan skip_all => "require a perl with CLONE_SKIP to test Imager's lack of threads support";
25 or plan skip_all => "couldn't load threads";
29 my $thread = threads->create(sub { 1; });
30 ok($thread->join, "join first thread");
32 # these are all, or contain, XS allocated objects, if we don't
33 # probably handle CLONE requests, or provide a CLONE_SKIP, we'll
34 # probably see a double-free, one from the thread, and the other from
35 # the main line of control.
38 my $im = Imager->new(xsize => 10, ysize => 10);
39 my $c = Imager::Color->new(0, 0, 0); # make some sort of color
40 ok($c, "made the color");
41 my $cf = Imager::Color::Float->new(0, 0, 0);
42 ok($cf, "made the float color");
46 Imager::Internal::Hlines::testing()
47 or skip "no hlines visible to test", 1;
48 $hl = Imager::Internal::Hlines::new(0, 100, 0, 100);
49 ok($hl, "made the hlines");
51 my $io = Imager::io_new_bufchain();
52 ok($io, "made the io");
57 or skip("No TT font support", 1);
58 $tt = Imager::Font->new(type => "tt", file => "fontfiles/dodge.ttf");
59 ok($tt, "made the font");
65 or skip "No FT2 support", 1;
66 $ft2 = Imager::Font->new(type => "ft2", file => "fontfiles/dodge.ttf");
67 ok($ft2, "made ft2 font");
69 my $fill = Imager::Fill->new(solid => $c);
70 ok($fill, "made the fill");
72 my $t2 = threads->create
75 ok(!UNIVERSAL::isa($im->{IMG}, "Imager::ImgRaw"),
76 "the low level image object should be undef");
80 ok($t2->join, "join second thread");
81 #print STDERR $im->{IMG}, "\n";
82 ok(UNIVERSAL::isa($im->{IMG}, "Imager::ImgRaw"),
83 "but the object should be fine in the main thread");