12 plan(skip_all => "Your system has no SIGALRM") if !exists $SIG{ALRM};
17 These are like the 010_complex_merge_classless test,
18 but an infinite loop has been made in the heirarchy,
19 to test that we can fail cleanly instead of going
24 # initial setup, everything sane
50 # A series of 8 aberations that would cause infinite loops,
51 # each one undoing the work of the previous
53 sub { @E::ISA = qw/F/ },
54 sub { @E::ISA = qw/D/; @C::ISA = qw/F/ },
55 sub { @C::ISA = qw//; @A::ISA = qw/K/ },
56 sub { @A::ISA = qw//; @J::ISA = qw/F K/ },
57 sub { @J::ISA = qw/F/; @H::ISA = qw/K G/ },
58 sub { @H::ISA = qw/G/; @B::ISA = qw/B/ },
59 sub { @B::ISA = qw//; @K::ISA = qw/K J I/ },
60 sub { @K::ISA = qw/J I/; @D::ISA = qw/A H B C/ },
63 foreach my $loopy (@loopies) {
65 local $SIG{ALRM} = sub { die "ALRMTimeout" };
68 mro::get_linear_isa('K', 'dfs');
72 if($err =~ /ALRMTimeout/) {
73 ok(0, "Loop terminated by SIGALRM");
75 elsif($err =~ /Recursive inheritance detected/) {
76 ok(1, "Graceful exception thrown");
79 ok(0, "Unrecognized exception: $err");
83 ok(0, "Infinite loop apparently succeeded???");