14 plan(skip_all => "Your system has no SIGALRM") if !exists $SIG{ALRM};
21 These are like the 010_complex_merge_classless test,
22 but an infinite loop has been made in the heirarchy,
23 to test that we can fail cleanly instead of going
28 # initial setup, everything sane
65 # A series of 8 abberations that would cause infinite loops,
66 # each one undoing the work of the previous
68 sub { @E::ISA = qw/F/ },
69 sub { @E::ISA = qw/D/; @C::ISA = qw/F/ },
70 sub { @C::ISA = qw//; @A::ISA = qw/K/ },
71 sub { @A::ISA = qw//; @J::ISA = qw/F K/ },
72 sub { @J::ISA = qw/F/; @H::ISA = qw/K G/ },
73 sub { @H::ISA = qw/G/; @B::ISA = qw/B/ },
74 sub { @B::ISA = qw//; @K::ISA = qw/K J I/ },
75 sub { @K::ISA = qw/J I/; @D::ISA = qw/A H B C/ },
78 foreach my $loopy (@loopies) {
80 local $SIG{ALRM} = sub { die "ALRMTimeout" };
83 mro::get_linear_isa('K', 'c3');
87 if($err =~ /ALRMTimeout/) {
88 ok(0, "Loop terminated by SIGALRM");
90 elsif($err =~ /Recursive inheritance detected/) {
91 ok(1, "Graceful exception thrown");
94 ok(0, "Unrecognized exception: $err");
98 ok(0, "Infinite loop apparently succeeded???");