Branch Coverage

blib/lib/NL/File/Lock.pm
Criterion Covered Total %
branch 18 74 24.3


line true false branch
64 0 2 if ($$NL::File::Lock::DATA{'SETTINGS'}{'dir_for_locks'} ne '')
66 0 0 if ($fn ne '')
75 0 0 unless $in_SETTINGS
77 0 0 if ($^O eq 'MacOS') { }
0 0 elsif ($^O eq 'MSWin32') { }
82 0 0 if (defined $dir_for_locks and $dir_for_locks ne '')
84 0 0 if ($dir_for_locks ne '' and -d $dir_for_locks)
87 0 0 if (defined $$in_SETTINGS{'REMOVE_OLD'} and $$in_SETTINGS{'REMOVE_OLD'})
90 0 0 if (opendir DIR, $$NL::File::Lock::DATA{'SETTINGS'}{'dir_for_locks'})
96 0 0 $$NL::File::Lock::DATA{'SETTINGS'}{'dir_for_locks'} =~ /$splitter$/ ? :
100 0 0 if (-f $file)
102 0 0 if (defined $arr_stat[9])
103 0 0 if $time - $arr_stat[9] >= $$NL::File::Lock::DATA{'SETTINGS'}{'SECONDS_TO_REMOVE_OLD_LOCKS'}
115 1 0 defined $in_ref_hash_EXT ? :
116 1 0 defined $in_ref_hash_EXT ? :
119 0 2 if not defined $lock_type or $lock_type <= 0
120 0 2 if not defined $in_ref_hash_EXT or ref $in_ref_hash_EXT ne 'HASH'
124 2 0 if (defined $$in_ref_hash_EXT{'timeout'})
125 2 0 defined $$in_ref_hash_EXT{'time_sleep'} && $$in_ref_hash_EXT{'time_sleep'} > 0 ? :
128 0 2 if (defined $$NL::File::Lock::DATA{'LOCKED_FILES'}{$file_name}) { }
129 0 0 if ($$NL::File::Lock::DATA{'LOCKED_FILES'}{$file_name}{'IS_LOCKED'}) { }
131 0 0 if (&_lf_lock_MAKE_LOCK($$NL::File::Lock::DATA{'LOCKED_FILES'}{$file_name}{'lock_handle'}, $lock_type, $time_stop, $time_sleep)) { }
144 0 2 if ($$NL::File::Lock::OS_SETTINGS{'USE_FCNTL'}) { }
150 2 0 if ($FILE_OPENED) { }
151 2 0 if (&_lf_lock_MAKE_LOCK(\*LFH, $lock_type, $time_stop, $time_sleep)) { }
164 0 0 if ($time_sleep > 0)
173 0 0 if $$NL::File::Lock::OS_SETTINGS{'IS_SOLARIS'} and not $$NL::File::Lock::OS_SETTINGS{'USE_FCNTL'} and $lock_type == &LOCK_SH()
175 2 0 if (flock $lock_file_handle, $lock_type | &LOCK_NB()) { }
179 0 0 if ($time_sleep > 0)
187 1 1 unless defined $not_unlink
189 2 0 if (defined $$NL::File::Lock::DATA{'LOCKED_FILES'}{$file_name})
191 2 0 if ($$NL::File::Lock::DATA{'LOCKED_FILES'}{$file_name}{'IS_LOCKED'})
195 1 1 unless $not_unlink
211 0 0 if (defined $$NL::File::Lock::DATA{'LOCKED_FILES'}{$file_name})
213 0 0 if ($$NL::File::Lock::DATA{'LOCKED_FILES'}{$file_name}{'IS_LOCKED'})
214 0 0 if ($] < 5.004)
239 0 0 if not defined $lock_type or $lock_type <= 0