testcases/FS/config.pm

filter: Statementstmt 48.4% 16 / 33 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 62.5% 5 / 8 Podpod 0.0% 0 / 1 totaltotal 50.0% 21 / 42 SCAR 1.3
CC
1
Cov
48%
test_everything
2.0
__ANON__
2.0
__ANON__
2.0
CRAP 1.1
« sample.pl ↑ Summary FS.pm »
1 package XAO::testcases::FS::config;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use XAO::Utils;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use XAO::Objects;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Error qw(:try);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use base qw(XAO::testcases::FS::base);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 sub test_everything {
10 0 ▶ my $self=shift;
Subroutine test_everything: not called CC=1 SCAR=6.9
Pod undocumented
11  
12 0 my $config=XAO::Objects->new(objname => 'Config', baseobj => 1);
13 0 $self->assert(ref($config),
14 "Can't get base config object");
15  
16 my $fsconfig=XAO::Objects->new(objname => 'FS::Config',
17 odb_args => {
18 dsn => $self->{odb_args}->{dsn},
19 user => $self->{odb_args}->{user},
20 password => $self->{odb_args}->{password},
21 0 });
22 0 $self->assert(ref($fsconfig),
23 "Can't get FS config object");
24  
25 0 $config->embed(fs => $fsconfig);
26  
27 0 $self->assert(ref($config->odb),
28 "Can't get database handler from the config");
29  
30 0 my $ok=0;
31 try {
32 0 ▶ $config->odb($self->get_odb);
Subroutine __ANON__: not called CC=1 SCAR=6.9
33 }
34 otherwise {
35 0 ▶ $ok=1;
Subroutine __ANON__: not called CC=1 SCAR=6.9
36 0 };
37 0 $self->assert($ok,
38 "Setting odb succeeded without enabling special access");
39  
40 0 $config->embedded('fs')->enable_special_access();
41 0 $config->odb($self->get_odb);
42 0 $config->embedded('fs')->enable_special_access();
43 0 $self->assert(ref($config->odb),
44 "Updating odb did not work");
45 0 $self->assert($config->odb == $self->get_odb,
46 "ODB after update points to wrong location");
47 }
48  
49 1 1;
« sample.pl ↑ Summary FS.pm »