Mock/Win32/File.pm

filter: Statementstmt 100% 28 / 28 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 2 totaltotal 90.0% 36 / 40 CC 2 SCAR 2.3
CC
2
Cov
97%
GetAttributes
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Mock/Win32/Service.pm ↑ Summary Mock/Win32/Console.pm »
1 package # hide from PAUSE
2 Win32::File;
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Exporter ();
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 READONLY => 0x00000001, # FILE_ATTRIBUTE_READONLY
9 HIDDEN => 0x00000002, # FILE_ATTRIBUTE_HIDDEN
10 #LABEL => 0x00000008, # FILE_ATTRIBUTE_LABEL /* Not in Windows API */
11 SYSTEM => 0x00000004, # FILE_ATTRIBUTE_SYSTEM
12 DIRECTORY => 0x00000010, # FILE_ATTRIBUTE_DIRECTORY
13 ARCHIVE => 0x00000020, # FILE_ATTRIBUTE_ARCHIVE
14 NORMAL => 0x00000080, # FILE_ATTRIBUTE_NORMAL
15 TEMPORARY => 0x00000100, # FILE_ATTRIBUTE_TEMPORARY
16 COMPRESSED => 0x00000800, # FILE_ATTRIBUTE_COMPRESSED
17 #xxxxxxxxxx => 0x00000200, # FILE_ATTRIBUTE_ATOMIC_WRITE
18 #xxxxxxxxxx => 0x00000400, # FILE_ATTRIBUTE_XACTION_WRITE
19 OFFLINE => 0x00001000, # FILE_ATTRIBUTE_OFFLINE
20 2 };
21  
22 {
23 2 ▶ no strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 2 $VERSION = '0.01';
25 2 @ISA = qw(Exporter);
26 2 @EXPORT = qw(
27 ARCHIVE COMPRESSED DIRECTORY HIDDEN LABEL
28 NORMAL OFFLINE READONLY SYSTEM TEMPORARY
29 );
30 2 @EXPORT_OK = qw(
31 GetAttributes SetAttributes
32 );
33 }
34  
35 2 my %file_attrs = ();
36  
37 2 ▶sub GetAttributes {
Subroutine GetAttributes: called CC=2 SCAR=7.1
Pod undocumented
38 2 my ($file, $attr) = @_;
39 2 ▶ $_[1] = $file_attrs{$file} ||= NORMAL;
Condition50%1/2
$file_attrs{$file} ||= 128
l!l
20
MC/DC0%0/1
$file_attrs{$file} ||= 128
$file_attrs{$file}
Truth table50%1/2
A
A= $file_attrs{$file}
Aresult
11
00
40 2 return 1
41 }
42  
43 2 ▶sub SetAttributes {
Subroutine SetAttributes: called CC=1 SCAR=0.0
Pod undocumented
44 2 my ($file, $attr) = @_;
45 2 $file_attrs{$file} = $attr;
46 2 return 1
47 }
48  
49  
50 2 1
51  
52 __END__
« Mock/Win32/Service.pm ↑ Summary Mock/Win32/Console.pm »