Branch Coverage

blib/lib/Crypt/URandom.pm
Criterion Covered Total %
branch 30 30 100.0


line true false branch
25 6 8 unless (eval { do { require XSLoader; XSLoader::load(__PACKAGE__, $VERSION) } })
51 1 7 unless (eval { do { my $correct_length = 2; $result = &getrandom($correct_length) } })
67 16 9 unless (defined $_initialised and $_initialised == $Crypt::URandom::PROCESS_ID)
134 2 14 unless $_urandom_handle = "FileHandle"->new("/dev/urandom", 0)
158 45 1 if (defined $length)
159 44 1 if ($length =~ /^\d+$/msx)
163 2 44 unless ($length_ok)
203 4 24 if (defined $urandom) { }
206 3 1 if (defined $buffer)
212 14 10 if (defined $buffer)
216 14 14 if (defined $urandom and length $urandom == $original_length) { }
2 12 elsif (not defined $result) { }
1 11 elsif ($result == 0) { }
2 9 elsif ($result == -1 and $Crypt::URandom::OS_ERROR == POSIX::EINTR()) { }
3 6 elsif ($result != -1) { }