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