| 1 | # | ||||||||||||||
| 2 | # Autogenerated by Thrift Compiler (0.22.0) | ||||||||||||||
| 3 | # | ||||||||||||||
| 4 | # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING | ||||||||||||||
| 5 | # | ||||||||||||||
| 6 | 2 | ▶ | use 5.10.0; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 7 | 2 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 8 | 2 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 9 | 2 | ▶ | use Thrift::Exception; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 10 | 2 | ▶ | use Thrift::MessageType; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 11 | 2 | ▶ | use Thrift::Type; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 12 | |||||||||||||||
| 13 | package ThriftTest::Numberz; | ||||||||||||||
| 14 | 2 | ▶ | use constant ONE => 1; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 15 | 2 | ▶ | use constant TWO => 2; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 16 | 2 | ▶ | use constant THREE => 3; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 17 | 2 | ▶ | use constant FIVE => 5; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 18 | 2 | ▶ | use constant SIX => 6; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 19 | 2 | ▶ | use constant EIGHT => 8; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 20 | |||||||||||||||
| 21 | package ThriftTest::Bonk; | ||||||||||||||
| 22 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 23 | 2 | ThriftTest::Bonk->mk_accessors( qw( message type ) ); | |||||||||||||
| 24 | |||||||||||||||
| 25 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
| |||||||||||||||
| 26 | 0 | my $classname = shift; | |||||||||||||
| 27 | 0 | my $self = {}; | |||||||||||||
| 28 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 29 | 0 | $self->{message} = undef; | |||||||||||||
| 30 | 0 | $self->{type} = undef; | |||||||||||||
| 31 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 32 | 0 | ▶ | if (defined $vals->{message}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 33 | 0 | $self->{message} = $vals->{message}; | |||||||||||||
| 34 | } | ||||||||||||||
| 35 | 0 | ▶ | if (defined $vals->{type}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 36 | 0 | $self->{type} = $vals->{type}; | |||||||||||||
| 37 | } | ||||||||||||||
| 38 | } | ||||||||||||||
| 39 | 0 | return bless ($self, $classname); | |||||||||||||
| 40 | } | ||||||||||||||
| 41 | |||||||||||||||
| 42 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 43 | 0 | return 'Bonk'; | |||||||||||||
| 44 | } | ||||||||||||||
| 45 | |||||||||||||||
| 46 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=7 SCAR=40.3
| |||||||||||||||
| 47 | 0 | my ($self, $input) = @_; | |||||||||||||
| 48 | 0 | my $xfer = 0; | |||||||||||||
| 49 | 0 | my $fname; | |||||||||||||
| 50 | 0 | my $ftype = 0; | |||||||||||||
| 51 | 0 | my $fid = 0; | |||||||||||||
| 52 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 53 | 0 | while (1) | |||||||||||||
| 54 | { | ||||||||||||||
| 55 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 56 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 57 | 0 | last; | |||||||||||||
| 58 | } | ||||||||||||||
| 59 | 0 | SWITCH: for($fid) | |||||||||||||
| 60 | { | ||||||||||||||
| 61 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::STRING) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 62 | 0 | $xfer += $input->readString(\$self->{message}); | |||||||||||||
| 63 | } else { | ||||||||||||||
| 64 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 65 | } | ||||||||||||||
| 66 | 0 | last; }; | |||||||||||||
| 67 | 0 | ▶ | /^2$/ && do{ if ($ftype == Thrift::TType::I32) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 68 | 0 | $xfer += $input->readI32(\$self->{type}); | |||||||||||||
| 69 | } else { | ||||||||||||||
| 70 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 71 | } | ||||||||||||||
| 72 | 0 | last; }; | |||||||||||||
| 73 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 74 | } | ||||||||||||||
| 75 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 76 | } | ||||||||||||||
| 77 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 78 | 0 | return $xfer; | |||||||||||||
| 79 | } | ||||||||||||||
| 80 | |||||||||||||||
| 81 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=3 SCAR=24.8
| |||||||||||||||
| 82 | 0 | my ($self, $output) = @_; | |||||||||||||
| 83 | 0 | my $xfer = 0; | |||||||||||||
| 84 | 0 | $xfer += $output->writeStructBegin('Bonk'); | |||||||||||||
| 85 | 0 | ▶ | if (defined $self->{message}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 86 | 0 | $xfer += $output->writeFieldBegin('message', Thrift::TType::STRING, 1); | |||||||||||||
| 87 | 0 | $xfer += $output->writeString($self->{message}); | |||||||||||||
| 88 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 89 | } | ||||||||||||||
| 90 | 0 | ▶ | if (defined $self->{type}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 91 | 0 | $xfer += $output->writeFieldBegin('type', Thrift::TType::I32, 2); | |||||||||||||
| 92 | 0 | $xfer += $output->writeI32($self->{type}); | |||||||||||||
| 93 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 94 | } | ||||||||||||||
| 95 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 96 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 97 | 0 | return $xfer; | |||||||||||||
| 98 | } | ||||||||||||||
| 99 | |||||||||||||||
| 100 | package ThriftTest::Bools; | ||||||||||||||
| 101 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 102 | 2 | ThriftTest::Bools->mk_accessors( qw( im_true im_false ) ); | |||||||||||||
| 103 | |||||||||||||||
| 104 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
| |||||||||||||||
| 105 | 0 | my $classname = shift; | |||||||||||||
| 106 | 0 | my $self = {}; | |||||||||||||
| 107 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 108 | 0 | $self->{im_true} = undef; | |||||||||||||
| 109 | 0 | $self->{im_false} = undef; | |||||||||||||
| 110 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 111 | 0 | ▶ | if (defined $vals->{im_true}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 112 | 0 | $self->{im_true} = $vals->{im_true}; | |||||||||||||
| 113 | } | ||||||||||||||
| 114 | 0 | ▶ | if (defined $vals->{im_false}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 115 | 0 | $self->{im_false} = $vals->{im_false}; | |||||||||||||
| 116 | } | ||||||||||||||
| 117 | } | ||||||||||||||
| 118 | 0 | return bless ($self, $classname); | |||||||||||||
| 119 | } | ||||||||||||||
| 120 | |||||||||||||||
| 121 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 122 | 0 | return 'Bools'; | |||||||||||||
| 123 | } | ||||||||||||||
| 124 | |||||||||||||||
| 125 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=7 SCAR=40.3
| |||||||||||||||
| 126 | 0 | my ($self, $input) = @_; | |||||||||||||
| 127 | 0 | my $xfer = 0; | |||||||||||||
| 128 | 0 | my $fname; | |||||||||||||
| 129 | 0 | my $ftype = 0; | |||||||||||||
| 130 | 0 | my $fid = 0; | |||||||||||||
| 131 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 132 | 0 | while (1) | |||||||||||||
| 133 | { | ||||||||||||||
| 134 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 135 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 136 | 0 | last; | |||||||||||||
| 137 | } | ||||||||||||||
| 138 | 0 | SWITCH: for($fid) | |||||||||||||
| 139 | { | ||||||||||||||
| 140 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::BOOL) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 141 | 0 | $xfer += $input->readBool(\$self->{im_true}); | |||||||||||||
| 142 | } else { | ||||||||||||||
| 143 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 144 | } | ||||||||||||||
| 145 | 0 | last; }; | |||||||||||||
| 146 | 0 | ▶ | /^2$/ && do{ if ($ftype == Thrift::TType::BOOL) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 147 | 0 | $xfer += $input->readBool(\$self->{im_false}); | |||||||||||||
| 148 | } else { | ||||||||||||||
| 149 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 150 | } | ||||||||||||||
| 151 | 0 | last; }; | |||||||||||||
| 152 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 153 | } | ||||||||||||||
| 154 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 155 | } | ||||||||||||||
| 156 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 157 | 0 | return $xfer; | |||||||||||||
| 158 | } | ||||||||||||||
| 159 | |||||||||||||||
| 160 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=3 SCAR=24.8
| |||||||||||||||
| 161 | 0 | my ($self, $output) = @_; | |||||||||||||
| 162 | 0 | my $xfer = 0; | |||||||||||||
| 163 | 0 | $xfer += $output->writeStructBegin('Bools'); | |||||||||||||
| 164 | 0 | ▶ | if (defined $self->{im_true}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 165 | 0 | $xfer += $output->writeFieldBegin('im_true', Thrift::TType::BOOL, 1); | |||||||||||||
| 166 | 0 | $xfer += $output->writeBool($self->{im_true}); | |||||||||||||
| 167 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 168 | } | ||||||||||||||
| 169 | 0 | ▶ | if (defined $self->{im_false}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 170 | 0 | $xfer += $output->writeFieldBegin('im_false', Thrift::TType::BOOL, 2); | |||||||||||||
| 171 | 0 | $xfer += $output->writeBool($self->{im_false}); | |||||||||||||
| 172 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 173 | } | ||||||||||||||
| 174 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 175 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 176 | 0 | return $xfer; | |||||||||||||
| 177 | } | ||||||||||||||
| 178 | |||||||||||||||
| 179 | package ThriftTest::Xtruct; | ||||||||||||||
| 180 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 181 | 2 | ThriftTest::Xtruct->mk_accessors( qw( string_thing byte_thing i32_thing i64_thing ) ); | |||||||||||||
| 182 | |||||||||||||||
| 183 | 3 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: called CC=7 SCAR=22.0
| |||||||||||||||
| 184 | 3 | my $classname = shift; | |||||||||||||
| 185 | 3 | my $self = {}; | |||||||||||||
| 186 | 3 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition50%1/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||||
| 187 | 3 | $self->{string_thing} = undef; | |||||||||||||
| 188 | 3 | $self->{byte_thing} = undef; | |||||||||||||
| 189 | 3 | $self->{i32_thing} = undef; | |||||||||||||
| 190 | 3 | $self->{i64_thing} = undef; | |||||||||||||
| 191 | 3 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 192 | 3 | ▶ | if (defined $vals->{string_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 193 | 0 | $self->{string_thing} = $vals->{string_thing}; | |||||||||||||
| 194 | } | ||||||||||||||
| 195 | 3 | ▶ | if (defined $vals->{byte_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 196 | 0 | $self->{byte_thing} = $vals->{byte_thing}; | |||||||||||||
| 197 | } | ||||||||||||||
| 198 | 3 | ▶ | if (defined $vals->{i32_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 199 | 0 | $self->{i32_thing} = $vals->{i32_thing}; | |||||||||||||
| 200 | } | ||||||||||||||
| 201 | 3 | ▶ | if (defined $vals->{i64_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 202 | 0 | $self->{i64_thing} = $vals->{i64_thing}; | |||||||||||||
| 203 | } | ||||||||||||||
| 204 | } | ||||||||||||||
| 205 | 3 | return bless ($self, $classname); | |||||||||||||
| 206 | } | ||||||||||||||
| 207 | |||||||||||||||
| 208 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 209 | 0 | return 'Xtruct'; | |||||||||||||
| 210 | } | ||||||||||||||
| 211 | |||||||||||||||
| 212 | 2 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: called CC=11 SCAR=26.2
| |||||||||||||||
| 213 | 2 | my ($self, $input) = @_; | |||||||||||||
| 214 | 2 | my $xfer = 0; | |||||||||||||
| 215 | 2 | my $fname; | |||||||||||||
| 216 | 2 | my $ftype = 0; | |||||||||||||
| 217 | 2 | my $fid = 0; | |||||||||||||
| 218 | 2 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 219 | 2 | while (1) | |||||||||||||
| 220 | { | ||||||||||||||
| 221 | 8 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 222 | 8 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 223 | 2 | last; | |||||||||||||
| 224 | } | ||||||||||||||
| 225 | 6 | SWITCH: for($fid) | |||||||||||||
| 226 | { | ||||||||||||||
| 227 | 6 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::STRING) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 228 | 2 | $xfer += $input->readString(\$self->{string_thing}); | |||||||||||||
| 229 | } else { | ||||||||||||||
| 230 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 231 | } | ||||||||||||||
| 232 | 2 | last; }; | |||||||||||||
| 233 | 0 | ▶ | /^4$/ && do{ if ($ftype == Thrift::TType::BYTE) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 234 | 0 | $xfer += $input->readByte(\$self->{byte_thing}); | |||||||||||||
| 235 | } else { | ||||||||||||||
| 236 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 237 | } | ||||||||||||||
| 238 | 0 | last; }; | |||||||||||||
| 239 | 4 | ▶ | /^9$/ && do{ if ($ftype == Thrift::TType::I32) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 240 | 2 | $xfer += $input->readI32(\$self->{i32_thing}); | |||||||||||||
| 241 | } else { | ||||||||||||||
| 242 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 243 | } | ||||||||||||||
| 244 | 2 | last; }; | |||||||||||||
| 245 | 2 | ▶ | /^11$/ && do{ if ($ftype == Thrift::TType::I64) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 246 | 2 | $xfer += $input->readI64(\$self->{i64_thing}); | |||||||||||||
| 247 | } else { | ||||||||||||||
| 248 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 249 | } | ||||||||||||||
| 250 | 2 | last; }; | |||||||||||||
| 251 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 252 | } | ||||||||||||||
| 253 | 6 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 254 | } | ||||||||||||||
| 255 | 2 | $xfer += $input->readStructEnd(); | |||||||||||||
| 256 | 2 | return $xfer; | |||||||||||||
| 257 | } | ||||||||||||||
| 258 | |||||||||||||||
| 259 | 2 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: called CC=5 SCAR=16.7
| |||||||||||||||
| 260 | 2 | my ($self, $output) = @_; | |||||||||||||
| 261 | 2 | my $xfer = 0; | |||||||||||||
| 262 | 2 | $xfer += $output->writeStructBegin('Xtruct'); | |||||||||||||
| 263 | 2 | ▶ | if (defined $self->{string_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 264 | 2 | $xfer += $output->writeFieldBegin('string_thing', Thrift::TType::STRING, 1); | |||||||||||||
| 265 | 2 | $xfer += $output->writeString($self->{string_thing}); | |||||||||||||
| 266 | 2 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 267 | } | ||||||||||||||
| 268 | 2 | ▶ | if (defined $self->{byte_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 269 | 0 | $xfer += $output->writeFieldBegin('byte_thing', Thrift::TType::BYTE, 4); | |||||||||||||
| 270 | 0 | $xfer += $output->writeByte($self->{byte_thing}); | |||||||||||||
| 271 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 272 | } | ||||||||||||||
| 273 | 2 | ▶ | if (defined $self->{i32_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 274 | 2 | $xfer += $output->writeFieldBegin('i32_thing', Thrift::TType::I32, 9); | |||||||||||||
| 275 | 2 | $xfer += $output->writeI32($self->{i32_thing}); | |||||||||||||
| 276 | 2 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 277 | } | ||||||||||||||
| 278 | 2 | ▶ | if (defined $self->{i64_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 279 | 2 | $xfer += $output->writeFieldBegin('i64_thing', Thrift::TType::I64, 11); | |||||||||||||
| 280 | 2 | $xfer += $output->writeI64($self->{i64_thing}); | |||||||||||||
| 281 | 2 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 282 | } | ||||||||||||||
| 283 | 2 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 284 | 2 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 285 | 2 | return $xfer; | |||||||||||||
| 286 | } | ||||||||||||||
| 287 | |||||||||||||||
| 288 | package ThriftTest::Xtruct2; | ||||||||||||||
| 289 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 290 | 2 | ThriftTest::Xtruct2->mk_accessors( qw( byte_thing struct_thing i32_thing ) ); | |||||||||||||
| 291 | |||||||||||||||
| 292 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=6 SCAR=37.4
| |||||||||||||||
| 293 | 0 | my $classname = shift; | |||||||||||||
| 294 | 0 | my $self = {}; | |||||||||||||
| 295 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 296 | 0 | $self->{byte_thing} = undef; | |||||||||||||
| 297 | 0 | $self->{struct_thing} = undef; | |||||||||||||
| 298 | 0 | $self->{i32_thing} = undef; | |||||||||||||
| 299 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 300 | 0 | ▶ | if (defined $vals->{byte_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 301 | 0 | $self->{byte_thing} = $vals->{byte_thing}; | |||||||||||||
| 302 | } | ||||||||||||||
| 303 | 0 | ▶ | if (defined $vals->{struct_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 304 | 0 | $self->{struct_thing} = $vals->{struct_thing}; | |||||||||||||
| 305 | } | ||||||||||||||
| 306 | 0 | ▶ | if (defined $vals->{i32_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 307 | 0 | $self->{i32_thing} = $vals->{i32_thing}; | |||||||||||||
| 308 | } | ||||||||||||||
| 309 | } | ||||||||||||||
| 310 | 0 | return bless ($self, $classname); | |||||||||||||
| 311 | } | ||||||||||||||
| 312 | |||||||||||||||
| 313 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 314 | 0 | return 'Xtruct2'; | |||||||||||||
| 315 | } | ||||||||||||||
| 316 | |||||||||||||||
| 317 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=9 SCAR=45.0
| |||||||||||||||
| 318 | 0 | my ($self, $input) = @_; | |||||||||||||
| 319 | 0 | my $xfer = 0; | |||||||||||||
| 320 | 0 | my $fname; | |||||||||||||
| 321 | 0 | my $ftype = 0; | |||||||||||||
| 322 | 0 | my $fid = 0; | |||||||||||||
| 323 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 324 | 0 | while (1) | |||||||||||||
| 325 | { | ||||||||||||||
| 326 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 327 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 328 | 0 | last; | |||||||||||||
| 329 | } | ||||||||||||||
| 330 | 0 | SWITCH: for($fid) | |||||||||||||
| 331 | { | ||||||||||||||
| 332 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::BYTE) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 333 | 0 | $xfer += $input->readByte(\$self->{byte_thing}); | |||||||||||||
| 334 | } else { | ||||||||||||||
| 335 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 336 | } | ||||||||||||||
| 337 | 0 | last; }; | |||||||||||||
| 338 | 0 | ▶ | /^2$/ && do{ if ($ftype == Thrift::TType::STRUCT) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 339 | 0 | $self->{struct_thing} = ThriftTest::Xtruct->new(); | |||||||||||||
| 340 | 0 | $xfer += $self->{struct_thing}->read($input); | |||||||||||||
| 341 | } else { | ||||||||||||||
| 342 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 343 | } | ||||||||||||||
| 344 | 0 | last; }; | |||||||||||||
| 345 | 0 | ▶ | /^3$/ && do{ if ($ftype == Thrift::TType::I32) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 346 | 0 | $xfer += $input->readI32(\$self->{i32_thing}); | |||||||||||||
| 347 | } else { | ||||||||||||||
| 348 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 349 | } | ||||||||||||||
| 350 | 0 | last; }; | |||||||||||||
| 351 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 352 | } | ||||||||||||||
| 353 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 354 | } | ||||||||||||||
| 355 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 356 | 0 | return $xfer; | |||||||||||||
| 357 | } | ||||||||||||||
| 358 | |||||||||||||||
| 359 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=4 SCAR=30.0
| |||||||||||||||
| 360 | 0 | my ($self, $output) = @_; | |||||||||||||
| 361 | 0 | my $xfer = 0; | |||||||||||||
| 362 | 0 | $xfer += $output->writeStructBegin('Xtruct2'); | |||||||||||||
| 363 | 0 | ▶ | if (defined $self->{byte_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 364 | 0 | $xfer += $output->writeFieldBegin('byte_thing', Thrift::TType::BYTE, 1); | |||||||||||||
| 365 | 0 | $xfer += $output->writeByte($self->{byte_thing}); | |||||||||||||
| 366 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 367 | } | ||||||||||||||
| 368 | 0 | ▶ | if (defined $self->{struct_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 369 | 0 | $xfer += $output->writeFieldBegin('struct_thing', Thrift::TType::STRUCT, 2); | |||||||||||||
| 370 | 0 | $xfer += $self->{struct_thing}->write($output); | |||||||||||||
| 371 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 372 | } | ||||||||||||||
| 373 | 0 | ▶ | if (defined $self->{i32_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 374 | 0 | $xfer += $output->writeFieldBegin('i32_thing', Thrift::TType::I32, 3); | |||||||||||||
| 375 | 0 | $xfer += $output->writeI32($self->{i32_thing}); | |||||||||||||
| 376 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 377 | } | ||||||||||||||
| 378 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 379 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 380 | 0 | return $xfer; | |||||||||||||
| 381 | } | ||||||||||||||
| 382 | |||||||||||||||
| 383 | package ThriftTest::Xtruct3; | ||||||||||||||
| 384 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 385 | 2 | ThriftTest::Xtruct3->mk_accessors( qw( string_thing changed i32_thing i64_thing ) ); | |||||||||||||
| 386 | |||||||||||||||
| 387 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=7 SCAR=40.3
| |||||||||||||||
| 388 | 0 | my $classname = shift; | |||||||||||||
| 389 | 0 | my $self = {}; | |||||||||||||
| 390 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 391 | 0 | $self->{string_thing} = undef; | |||||||||||||
| 392 | 0 | $self->{changed} = undef; | |||||||||||||
| 393 | 0 | $self->{i32_thing} = undef; | |||||||||||||
| 394 | 0 | $self->{i64_thing} = undef; | |||||||||||||
| 395 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 396 | 0 | ▶ | if (defined $vals->{string_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 397 | 0 | $self->{string_thing} = $vals->{string_thing}; | |||||||||||||
| 398 | } | ||||||||||||||
| 399 | 0 | ▶ | if (defined $vals->{changed}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 400 | 0 | $self->{changed} = $vals->{changed}; | |||||||||||||
| 401 | } | ||||||||||||||
| 402 | 0 | ▶ | if (defined $vals->{i32_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 403 | 0 | $self->{i32_thing} = $vals->{i32_thing}; | |||||||||||||
| 404 | } | ||||||||||||||
| 405 | 0 | ▶ | if (defined $vals->{i64_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 406 | 0 | $self->{i64_thing} = $vals->{i64_thing}; | |||||||||||||
| 407 | } | ||||||||||||||
| 408 | } | ||||||||||||||
| 409 | 0 | return bless ($self, $classname); | |||||||||||||
| 410 | } | ||||||||||||||
| 411 | |||||||||||||||
| 412 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 413 | 0 | return 'Xtruct3'; | |||||||||||||
| 414 | } | ||||||||||||||
| 415 | |||||||||||||||
| 416 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=11 SCAR=48.8
| |||||||||||||||
| 417 | 0 | my ($self, $input) = @_; | |||||||||||||
| 418 | 0 | my $xfer = 0; | |||||||||||||
| 419 | 0 | my $fname; | |||||||||||||
| 420 | 0 | my $ftype = 0; | |||||||||||||
| 421 | 0 | my $fid = 0; | |||||||||||||
| 422 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 423 | 0 | while (1) | |||||||||||||
| 424 | { | ||||||||||||||
| 425 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 426 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 427 | 0 | last; | |||||||||||||
| 428 | } | ||||||||||||||
| 429 | 0 | SWITCH: for($fid) | |||||||||||||
| 430 | { | ||||||||||||||
| 431 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::STRING) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 432 | 0 | $xfer += $input->readString(\$self->{string_thing}); | |||||||||||||
| 433 | } else { | ||||||||||||||
| 434 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 435 | } | ||||||||||||||
| 436 | 0 | last; }; | |||||||||||||
| 437 | 0 | ▶ | /^4$/ && do{ if ($ftype == Thrift::TType::I32) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 438 | 0 | $xfer += $input->readI32(\$self->{changed}); | |||||||||||||
| 439 | } else { | ||||||||||||||
| 440 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 441 | } | ||||||||||||||
| 442 | 0 | last; }; | |||||||||||||
| 443 | 0 | ▶ | /^9$/ && do{ if ($ftype == Thrift::TType::I32) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 444 | 0 | $xfer += $input->readI32(\$self->{i32_thing}); | |||||||||||||
| 445 | } else { | ||||||||||||||
| 446 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 447 | } | ||||||||||||||
| 448 | 0 | last; }; | |||||||||||||
| 449 | 0 | ▶ | /^11$/ && do{ if ($ftype == Thrift::TType::I64) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 450 | 0 | $xfer += $input->readI64(\$self->{i64_thing}); | |||||||||||||
| 451 | } else { | ||||||||||||||
| 452 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 453 | } | ||||||||||||||
| 454 | 0 | last; }; | |||||||||||||
| 455 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 456 | } | ||||||||||||||
| 457 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 458 | } | ||||||||||||||
| 459 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 460 | 0 | return $xfer; | |||||||||||||
| 461 | } | ||||||||||||||
| 462 | |||||||||||||||
| 463 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=5 SCAR=34.0
| |||||||||||||||
| 464 | 0 | my ($self, $output) = @_; | |||||||||||||
| 465 | 0 | my $xfer = 0; | |||||||||||||
| 466 | 0 | $xfer += $output->writeStructBegin('Xtruct3'); | |||||||||||||
| 467 | 0 | ▶ | if (defined $self->{string_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 468 | 0 | $xfer += $output->writeFieldBegin('string_thing', Thrift::TType::STRING, 1); | |||||||||||||
| 469 | 0 | $xfer += $output->writeString($self->{string_thing}); | |||||||||||||
| 470 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 471 | } | ||||||||||||||
| 472 | 0 | ▶ | if (defined $self->{changed}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 473 | 0 | $xfer += $output->writeFieldBegin('changed', Thrift::TType::I32, 4); | |||||||||||||
| 474 | 0 | $xfer += $output->writeI32($self->{changed}); | |||||||||||||
| 475 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 476 | } | ||||||||||||||
| 477 | 0 | ▶ | if (defined $self->{i32_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 478 | 0 | $xfer += $output->writeFieldBegin('i32_thing', Thrift::TType::I32, 9); | |||||||||||||
| 479 | 0 | $xfer += $output->writeI32($self->{i32_thing}); | |||||||||||||
| 480 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 481 | } | ||||||||||||||
| 482 | 0 | ▶ | if (defined $self->{i64_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 483 | 0 | $xfer += $output->writeFieldBegin('i64_thing', Thrift::TType::I64, 11); | |||||||||||||
| 484 | 0 | $xfer += $output->writeI64($self->{i64_thing}); | |||||||||||||
| 485 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 486 | } | ||||||||||||||
| 487 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 488 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 489 | 0 | return $xfer; | |||||||||||||
| 490 | } | ||||||||||||||
| 491 | |||||||||||||||
| 492 | package ThriftTest::Insanity; | ||||||||||||||
| 493 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 494 | 2 | ThriftTest::Insanity->mk_accessors( qw( userMap xtructs ) ); | |||||||||||||
| 495 | |||||||||||||||
| 496 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
| |||||||||||||||
| 497 | 0 | my $classname = shift; | |||||||||||||
| 498 | 0 | my $self = {}; | |||||||||||||
| 499 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 500 | 0 | $self->{userMap} = undef; | |||||||||||||
| 501 | 0 | $self->{xtructs} = undef; | |||||||||||||
| 502 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 503 | 0 | ▶ | if (defined $vals->{userMap}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 504 | 0 | $self->{userMap} = $vals->{userMap}; | |||||||||||||
| 505 | } | ||||||||||||||
| 506 | 0 | ▶ | if (defined $vals->{xtructs}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 507 | 0 | $self->{xtructs} = $vals->{xtructs}; | |||||||||||||
| 508 | } | ||||||||||||||
| 509 | } | ||||||||||||||
| 510 | 0 | return bless ($self, $classname); | |||||||||||||
| 511 | } | ||||||||||||||
| 512 | |||||||||||||||
| 513 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 514 | 0 | return 'Insanity'; | |||||||||||||
| 515 | } | ||||||||||||||
| 516 | |||||||||||||||
| 517 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=9 SCAR=45.0
| |||||||||||||||
| 518 | 0 | my ($self, $input) = @_; | |||||||||||||
| 519 | 0 | my $xfer = 0; | |||||||||||||
| 520 | 0 | my $fname; | |||||||||||||
| 521 | 0 | my $ftype = 0; | |||||||||||||
| 522 | 0 | my $fid = 0; | |||||||||||||
| 523 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 524 | 0 | while (1) | |||||||||||||
| 525 | { | ||||||||||||||
| 526 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 527 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 528 | 0 | last; | |||||||||||||
| 529 | } | ||||||||||||||
| 530 | 0 | SWITCH: for($fid) | |||||||||||||
| 531 | { | ||||||||||||||
| 532 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::MAP) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 533 | { | ||||||||||||||
| 534 | 0 | my $_size0 = 0; | |||||||||||||
| 535 | 0 | $self->{userMap} = {}; | |||||||||||||
| 536 | 0 | my $_ktype1 = 0; | |||||||||||||
| 537 | 0 | my $_vtype2 = 0; | |||||||||||||
| 538 | 0 | $xfer += $input->readMapBegin(\$_ktype1, \$_vtype2, \$_size0); | |||||||||||||
| 539 | 0 | ▶ | for (my $_i4 = 0; $_i4 < $_size0; ++$_i4) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 540 | { | ||||||||||||||
| 541 | 0 | my $key5 = 0; | |||||||||||||
| 542 | 0 | my $val6 = 0; | |||||||||||||
| 543 | 0 | $xfer += $input->readI32(\$key5); | |||||||||||||
| 544 | 0 | $xfer += $input->readI64(\$val6); | |||||||||||||
| 545 | 0 | $self->{userMap}->{$key5} = $val6; | |||||||||||||
| 546 | } | ||||||||||||||
| 547 | 0 | $xfer += $input->readMapEnd(); | |||||||||||||
| 548 | } | ||||||||||||||
| 549 | } else { | ||||||||||||||
| 550 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 551 | } | ||||||||||||||
| 552 | 0 | last; }; | |||||||||||||
| 553 | 0 | ▶ | /^2$/ && do{ if ($ftype == Thrift::TType::LIST) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 554 | { | ||||||||||||||
| 555 | 0 | my $_size7 = 0; | |||||||||||||
| 556 | 0 | $self->{xtructs} = []; | |||||||||||||
| 557 | 0 | my $_etype10 = 0; | |||||||||||||
| 558 | 0 | $xfer += $input->readListBegin(\$_etype10, \$_size7); | |||||||||||||
| 559 | 0 | ▶ | for (my $_i11 = 0; $_i11 < $_size7; ++$_i11) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 560 | { | ||||||||||||||
| 561 | 0 | my $elem12 = undef; | |||||||||||||
| 562 | 0 | $elem12 = ThriftTest::Xtruct->new(); | |||||||||||||
| 563 | 0 | $xfer += $elem12->read($input); | |||||||||||||
| 564 | 0 | push(@{$self->{xtructs}},$elem12); | |||||||||||||
| 565 | } | ||||||||||||||
| 566 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 567 | } | ||||||||||||||
| 568 | } else { | ||||||||||||||
| 569 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 570 | } | ||||||||||||||
| 571 | 0 | last; }; | |||||||||||||
| 572 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 573 | } | ||||||||||||||
| 574 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 575 | } | ||||||||||||||
| 576 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 577 | 0 | return $xfer; | |||||||||||||
| 578 | } | ||||||||||||||
| 579 | |||||||||||||||
| 580 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=5 SCAR=34.0
| |||||||||||||||
| 581 | 0 | my ($self, $output) = @_; | |||||||||||||
| 582 | 0 | my $xfer = 0; | |||||||||||||
| 583 | 0 | $xfer += $output->writeStructBegin('Insanity'); | |||||||||||||
| 584 | 0 | ▶ | if (defined $self->{userMap}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 585 | 0 | $xfer += $output->writeFieldBegin('userMap', Thrift::TType::MAP, 1); | |||||||||||||
| 586 | { | ||||||||||||||
| 587 | 0 | $xfer += $output->writeMapBegin(Thrift::TType::I32, Thrift::TType::I64, scalar(keys %{$self->{userMap}})); | |||||||||||||
| 588 | { | ||||||||||||||
| 589 | 0 | ▶ | while( my ($kiter13,$viter14) = each %{$self->{userMap}}) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 590 | { | ||||||||||||||
| 591 | 0 | $xfer += $output->writeI32($kiter13); | |||||||||||||
| 592 | 0 | $xfer += $output->writeI64($viter14); | |||||||||||||
| 593 | } | ||||||||||||||
| 594 | } | ||||||||||||||
| 595 | 0 | $xfer += $output->writeMapEnd(); | |||||||||||||
| 596 | } | ||||||||||||||
| 597 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 598 | } | ||||||||||||||
| 599 | 0 | ▶ | if (defined $self->{xtructs}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 600 | 0 | $xfer += $output->writeFieldBegin('xtructs', Thrift::TType::LIST, 2); | |||||||||||||
| 601 | { | ||||||||||||||
| 602 | 0 | $xfer += $output->writeListBegin(Thrift::TType::STRUCT, scalar(@{$self->{xtructs}})); | |||||||||||||
| 603 | { | ||||||||||||||
| 604 | 0 | foreach my $iter15 (@{$self->{xtructs}}) | |||||||||||||
| 605 | { | ||||||||||||||
| 606 | 0 | $xfer += ${iter15}->write($output); | |||||||||||||
| 607 | } | ||||||||||||||
| 608 | } | ||||||||||||||
| 609 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 610 | } | ||||||||||||||
| 611 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 612 | } | ||||||||||||||
| 613 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 614 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 615 | 0 | return $xfer; | |||||||||||||
| 616 | } | ||||||||||||||
| 617 | |||||||||||||||
| 618 | package ThriftTest::CrazyNesting; | ||||||||||||||
| 619 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 620 | 2 | ThriftTest::CrazyNesting->mk_accessors( qw( string_field set_field list_field binary_field ) ); | |||||||||||||
| 621 | |||||||||||||||
| 622 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=7 SCAR=40.3
| |||||||||||||||
| 623 | 0 | my $classname = shift; | |||||||||||||
| 624 | 0 | my $self = {}; | |||||||||||||
| 625 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 626 | 0 | $self->{string_field} = undef; | |||||||||||||
| 627 | 0 | $self->{set_field} = undef; | |||||||||||||
| 628 | 0 | $self->{list_field} = undef; | |||||||||||||
| 629 | 0 | $self->{binary_field} = undef; | |||||||||||||
| 630 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 631 | 0 | ▶ | if (defined $vals->{string_field}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 632 | 0 | $self->{string_field} = $vals->{string_field}; | |||||||||||||
| 633 | } | ||||||||||||||
| 634 | 0 | ▶ | if (defined $vals->{set_field}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 635 | 0 | $self->{set_field} = $vals->{set_field}; | |||||||||||||
| 636 | } | ||||||||||||||
| 637 | 0 | ▶ | if (defined $vals->{list_field}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 638 | 0 | $self->{list_field} = $vals->{list_field}; | |||||||||||||
| 639 | } | ||||||||||||||
| 640 | 0 | ▶ | if (defined $vals->{binary_field}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 641 | 0 | $self->{binary_field} = $vals->{binary_field}; | |||||||||||||
| 642 | } | ||||||||||||||
| 643 | } | ||||||||||||||
| 644 | 0 | return bless ($self, $classname); | |||||||||||||
| 645 | } | ||||||||||||||
| 646 | |||||||||||||||
| 647 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 648 | 0 | return 'CrazyNesting'; | |||||||||||||
| 649 | } | ||||||||||||||
| 650 | |||||||||||||||
| 651 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=19 SCAR=59.4
| |||||||||||||||
| 652 | 0 | my ($self, $input) = @_; | |||||||||||||
| 653 | 0 | my $xfer = 0; | |||||||||||||
| 654 | 0 | my $fname; | |||||||||||||
| 655 | 0 | my $ftype = 0; | |||||||||||||
| 656 | 0 | my $fid = 0; | |||||||||||||
| 657 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 658 | 0 | while (1) | |||||||||||||
| 659 | { | ||||||||||||||
| 660 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 661 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 662 | 0 | last; | |||||||||||||
| 663 | } | ||||||||||||||
| 664 | 0 | SWITCH: for($fid) | |||||||||||||
| 665 | { | ||||||||||||||
| 666 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::STRING) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 667 | 0 | $xfer += $input->readString(\$self->{string_field}); | |||||||||||||
| 668 | } else { | ||||||||||||||
| 669 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 670 | } | ||||||||||||||
| 671 | 0 | last; }; | |||||||||||||
| 672 | 0 | ▶ | /^2$/ && do{ if ($ftype == Thrift::TType::SET) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 673 | { | ||||||||||||||
| 674 | 0 | my $_size16 = 0; | |||||||||||||
| 675 | 0 | $self->{set_field} = {}; | |||||||||||||
| 676 | 0 | my $_etype19 = 0; | |||||||||||||
| 677 | 0 | $xfer += $input->readSetBegin(\$_etype19, \$_size16); | |||||||||||||
| 678 | 0 | ▶ | for (my $_i20 = 0; $_i20 < $_size16; ++$_i20) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 679 | { | ||||||||||||||
| 680 | 0 | my $elem21 = undef; | |||||||||||||
| 681 | 0 | $elem21 = ThriftTest::Insanity->new(); | |||||||||||||
| 682 | 0 | $xfer += $elem21->read($input); | |||||||||||||
| 683 | 0 | $self->{set_field}->{$elem21} = 1; | |||||||||||||
| 684 | } | ||||||||||||||
| 685 | 0 | $xfer += $input->readSetEnd(); | |||||||||||||
| 686 | } | ||||||||||||||
| 687 | } else { | ||||||||||||||
| 688 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 689 | } | ||||||||||||||
| 690 | 0 | last; }; | |||||||||||||
| 691 | 0 | ▶ | /^3$/ && do{ if ($ftype == Thrift::TType::LIST) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 692 | { | ||||||||||||||
| 693 | 0 | my $_size22 = 0; | |||||||||||||
| 694 | 0 | $self->{list_field} = []; | |||||||||||||
| 695 | 0 | my $_etype25 = 0; | |||||||||||||
| 696 | 0 | $xfer += $input->readListBegin(\$_etype25, \$_size22); | |||||||||||||
| 697 | 0 | ▶ | for (my $_i26 = 0; $_i26 < $_size22; ++$_i26) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 698 | { | ||||||||||||||
| 699 | 0 | my $elem27 = undef; | |||||||||||||
| 700 | { | ||||||||||||||
| 701 | 0 | my $_size28 = 0; | |||||||||||||
| 702 | 0 | $elem27 = {}; | |||||||||||||
| 703 | 0 | my $_ktype29 = 0; | |||||||||||||
| 704 | 0 | my $_vtype30 = 0; | |||||||||||||
| 705 | 0 | $xfer += $input->readMapBegin(\$_ktype29, \$_vtype30, \$_size28); | |||||||||||||
| 706 | 0 | ▶ | for (my $_i32 = 0; $_i32 < $_size28; ++$_i32) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 707 | { | ||||||||||||||
| 708 | 0 | my $key33 = []; | |||||||||||||
| 709 | 0 | my $val34 = []; | |||||||||||||
| 710 | { | ||||||||||||||
| 711 | 0 | my $_size35 = 0; | |||||||||||||
| 712 | 0 | $key33 = {}; | |||||||||||||
| 713 | 0 | my $_etype38 = 0; | |||||||||||||
| 714 | 0 | $xfer += $input->readSetBegin(\$_etype38, \$_size35); | |||||||||||||
| 715 | 0 | ▶ | for (my $_i39 = 0; $_i39 < $_size35; ++$_i39) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 716 | { | ||||||||||||||
| 717 | 0 | my $elem40 = undef; | |||||||||||||
| 718 | 0 | $xfer += $input->readI32(\$elem40); | |||||||||||||
| 719 | 0 | $key33->{$elem40} = 1; | |||||||||||||
| 720 | } | ||||||||||||||
| 721 | 0 | $xfer += $input->readSetEnd(); | |||||||||||||
| 722 | } | ||||||||||||||
| 723 | { | ||||||||||||||
| 724 | 0 | my $_size41 = 0; | |||||||||||||
| 725 | 0 | $val34 = {}; | |||||||||||||
| 726 | 0 | my $_ktype42 = 0; | |||||||||||||
| 727 | 0 | my $_vtype43 = 0; | |||||||||||||
| 728 | 0 | $xfer += $input->readMapBegin(\$_ktype42, \$_vtype43, \$_size41); | |||||||||||||
| 729 | 0 | ▶ | for (my $_i45 = 0; $_i45 < $_size41; ++$_i45) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 730 | { | ||||||||||||||
| 731 | 0 | my $key46 = 0; | |||||||||||||
| 732 | 0 | my $val47 = []; | |||||||||||||
| 733 | 0 | $xfer += $input->readI32(\$key46); | |||||||||||||
| 734 | { | ||||||||||||||
| 735 | 0 | my $_size48 = 0; | |||||||||||||
| 736 | 0 | $val47 = {}; | |||||||||||||
| 737 | 0 | my $_etype51 = 0; | |||||||||||||
| 738 | 0 | $xfer += $input->readSetBegin(\$_etype51, \$_size48); | |||||||||||||
| 739 | 0 | ▶ | for (my $_i52 = 0; $_i52 < $_size48; ++$_i52) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 740 | { | ||||||||||||||
| 741 | 0 | my $elem53 = undef; | |||||||||||||
| 742 | { | ||||||||||||||
| 743 | 0 | my $_size54 = 0; | |||||||||||||
| 744 | 0 | $elem53 = []; | |||||||||||||
| 745 | 0 | my $_etype57 = 0; | |||||||||||||
| 746 | 0 | $xfer += $input->readListBegin(\$_etype57, \$_size54); | |||||||||||||
| 747 | 0 | ▶ | for (my $_i58 = 0; $_i58 < $_size54; ++$_i58) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 748 | { | ||||||||||||||
| 749 | 0 | my $elem59 = undef; | |||||||||||||
| 750 | { | ||||||||||||||
| 751 | 0 | my $_size60 = 0; | |||||||||||||
| 752 | 0 | $elem59 = {}; | |||||||||||||
| 753 | 0 | my $_ktype61 = 0; | |||||||||||||
| 754 | 0 | my $_vtype62 = 0; | |||||||||||||
| 755 | 0 | $xfer += $input->readMapBegin(\$_ktype61, \$_vtype62, \$_size60); | |||||||||||||
| 756 | 0 | ▶ | for (my $_i64 = 0; $_i64 < $_size60; ++$_i64) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 757 | { | ||||||||||||||
| 758 | 0 | my $key65 = ThriftTest::Insanity->new(); | |||||||||||||
| 759 | 0 | my $val66 = ''; | |||||||||||||
| 760 | 0 | $key65 = ThriftTest::Insanity->new(); | |||||||||||||
| 761 | 0 | $xfer += $key65->read($input); | |||||||||||||
| 762 | 0 | $xfer += $input->readString(\$val66); | |||||||||||||
| 763 | 0 | $elem59->{$key65} = $val66; | |||||||||||||
| 764 | } | ||||||||||||||
| 765 | 0 | $xfer += $input->readMapEnd(); | |||||||||||||
| 766 | } | ||||||||||||||
| 767 | 0 | push(@{$elem53},$elem59); | |||||||||||||
| 768 | } | ||||||||||||||
| 769 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 770 | } | ||||||||||||||
| 771 | 0 | $val47->{$elem53} = 1; | |||||||||||||
| 772 | } | ||||||||||||||
| 773 | 0 | $xfer += $input->readSetEnd(); | |||||||||||||
| 774 | } | ||||||||||||||
| 775 | 0 | $val34->{$key46} = $val47; | |||||||||||||
| 776 | } | ||||||||||||||
| 777 | 0 | $xfer += $input->readMapEnd(); | |||||||||||||
| 778 | } | ||||||||||||||
| 779 | 0 | $elem27->{$key33} = $val34; | |||||||||||||
| 780 | } | ||||||||||||||
| 781 | 0 | $xfer += $input->readMapEnd(); | |||||||||||||
| 782 | } | ||||||||||||||
| 783 | 0 | push(@{$self->{list_field}},$elem27); | |||||||||||||
| 784 | } | ||||||||||||||
| 785 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 786 | } | ||||||||||||||
| 787 | } else { | ||||||||||||||
| 788 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 789 | } | ||||||||||||||
| 790 | 0 | last; }; | |||||||||||||
| 791 | 0 | ▶ | /^4$/ && do{ if ($ftype == Thrift::TType::STRING) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 792 | 0 | $xfer += $input->readString(\$self->{binary_field}); | |||||||||||||
| 793 | } else { | ||||||||||||||
| 794 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 795 | } | ||||||||||||||
| 796 | 0 | last; }; | |||||||||||||
| 797 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 798 | } | ||||||||||||||
| 799 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 800 | } | ||||||||||||||
| 801 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 802 | 0 | return $xfer; | |||||||||||||
| 803 | } | ||||||||||||||
| 804 | |||||||||||||||
| 805 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=13 SCAR=52.0
| |||||||||||||||
| 806 | 0 | my ($self, $output) = @_; | |||||||||||||
| 807 | 0 | my $xfer = 0; | |||||||||||||
| 808 | 0 | $xfer += $output->writeStructBegin('CrazyNesting'); | |||||||||||||
| 809 | 0 | ▶ | if (defined $self->{string_field}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 810 | 0 | $xfer += $output->writeFieldBegin('string_field', Thrift::TType::STRING, 1); | |||||||||||||
| 811 | 0 | $xfer += $output->writeString($self->{string_field}); | |||||||||||||
| 812 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 813 | } | ||||||||||||||
| 814 | 0 | ▶ | if (defined $self->{set_field}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 815 | 0 | $xfer += $output->writeFieldBegin('set_field', Thrift::TType::SET, 2); | |||||||||||||
| 816 | { | ||||||||||||||
| 817 | 0 | $xfer += $output->writeSetBegin(Thrift::TType::STRUCT, scalar(@{$self->{set_field}})); | |||||||||||||
| 818 | { | ||||||||||||||
| 819 | 0 | foreach my $iter67 (@{$self->{set_field}}) | |||||||||||||
| 820 | { | ||||||||||||||
| 821 | 0 | $xfer += ${iter67}->write($output); | |||||||||||||
| 822 | } | ||||||||||||||
| 823 | } | ||||||||||||||
| 824 | 0 | $xfer += $output->writeSetEnd(); | |||||||||||||
| 825 | } | ||||||||||||||
| 826 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 827 | } | ||||||||||||||
| 828 | 0 | ▶ | if (defined $self->{list_field}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 829 | 0 | $xfer += $output->writeFieldBegin('list_field', Thrift::TType::LIST, 3); | |||||||||||||
| 830 | { | ||||||||||||||
| 831 | 0 | $xfer += $output->writeListBegin(Thrift::TType::MAP, scalar(@{$self->{list_field}})); | |||||||||||||
| 832 | { | ||||||||||||||
| 833 | 0 | foreach my $iter68 (@{$self->{list_field}}) | |||||||||||||
| 834 | { | ||||||||||||||
| 835 | { | ||||||||||||||
| 836 | 0 | $xfer += $output->writeMapBegin(Thrift::TType::SET, Thrift::TType::MAP, scalar(keys %{${iter68}})); | |||||||||||||
| 837 | { | ||||||||||||||
| 838 | 0 | ▶ | while( my ($kiter69,$viter70) = each %{${iter68}}) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 839 | { | ||||||||||||||
| 840 | { | ||||||||||||||
| 841 | 0 | $xfer += $output->writeSetBegin(Thrift::TType::I32, scalar(@{${kiter69}})); | |||||||||||||
| 842 | { | ||||||||||||||
| 843 | 0 | foreach my $iter71 (@{${kiter69}}) | |||||||||||||
| 844 | { | ||||||||||||||
| 845 | 0 | $xfer += $output->writeI32($iter71); | |||||||||||||
| 846 | } | ||||||||||||||
| 847 | } | ||||||||||||||
| 848 | 0 | $xfer += $output->writeSetEnd(); | |||||||||||||
| 849 | } | ||||||||||||||
| 850 | { | ||||||||||||||
| 851 | 0 | $xfer += $output->writeMapBegin(Thrift::TType::I32, Thrift::TType::SET, scalar(keys %{${viter70}})); | |||||||||||||
| 852 | { | ||||||||||||||
| 853 | 0 | ▶ | while( my ($kiter72,$viter73) = each %{${viter70}}) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 854 | { | ||||||||||||||
| 855 | 0 | $xfer += $output->writeI32($kiter72); | |||||||||||||
| 856 | { | ||||||||||||||
| 857 | 0 | $xfer += $output->writeSetBegin(Thrift::TType::LIST, scalar(@{${viter73}})); | |||||||||||||
| 858 | { | ||||||||||||||
| 859 | 0 | foreach my $iter74 (@{${viter73}}) | |||||||||||||
| 860 | { | ||||||||||||||
| 861 | { | ||||||||||||||
| 862 | 0 | $xfer += $output->writeListBegin(Thrift::TType::MAP, scalar(@{${iter74}})); | |||||||||||||
| 863 | { | ||||||||||||||
| 864 | 0 | foreach my $iter75 (@{${iter74}}) | |||||||||||||
| 865 | { | ||||||||||||||
| 866 | { | ||||||||||||||
| 867 | 0 | $xfer += $output->writeMapBegin(Thrift::TType::STRUCT, Thrift::TType::STRING, scalar(keys %{${iter75}})); | |||||||||||||
| 868 | { | ||||||||||||||
| 869 | 0 | ▶ | while( my ($kiter76,$viter77) = each %{${iter75}}) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 870 | { | ||||||||||||||
| 871 | 0 | $xfer += ${kiter76}->write($output); | |||||||||||||
| 872 | 0 | $xfer += $output->writeString($viter77); | |||||||||||||
| 873 | } | ||||||||||||||
| 874 | } | ||||||||||||||
| 875 | 0 | $xfer += $output->writeMapEnd(); | |||||||||||||
| 876 | } | ||||||||||||||
| 877 | } | ||||||||||||||
| 878 | } | ||||||||||||||
| 879 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 880 | } | ||||||||||||||
| 881 | } | ||||||||||||||
| 882 | } | ||||||||||||||
| 883 | 0 | $xfer += $output->writeSetEnd(); | |||||||||||||
| 884 | } | ||||||||||||||
| 885 | } | ||||||||||||||
| 886 | } | ||||||||||||||
| 887 | 0 | $xfer += $output->writeMapEnd(); | |||||||||||||
| 888 | } | ||||||||||||||
| 889 | } | ||||||||||||||
| 890 | } | ||||||||||||||
| 891 | 0 | $xfer += $output->writeMapEnd(); | |||||||||||||
| 892 | } | ||||||||||||||
| 893 | } | ||||||||||||||
| 894 | } | ||||||||||||||
| 895 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 896 | } | ||||||||||||||
| 897 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 898 | } | ||||||||||||||
| 899 | 0 | ▶ | if (defined $self->{binary_field}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 900 | 0 | $xfer += $output->writeFieldBegin('binary_field', Thrift::TType::STRING, 4); | |||||||||||||
| 901 | 0 | $xfer += $output->writeString($self->{binary_field}); | |||||||||||||
| 902 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 903 | } | ||||||||||||||
| 904 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 905 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 906 | 0 | return $xfer; | |||||||||||||
| 907 | } | ||||||||||||||
| 908 | |||||||||||||||
| 909 | package ThriftTest::SomeUnion; | ||||||||||||||
| 910 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 911 | 2 | ThriftTest::SomeUnion->mk_accessors( qw( map_thing string_thing i32_thing xtruct_thing insanity_thing ) ); | |||||||||||||
| 912 | |||||||||||||||
| 913 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=8 SCAR=42.8
| |||||||||||||||
| 914 | 0 | my $classname = shift; | |||||||||||||
| 915 | 0 | my $self = {}; | |||||||||||||
| 916 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 917 | 0 | $self->{map_thing} = undef; | |||||||||||||
| 918 | 0 | $self->{string_thing} = undef; | |||||||||||||
| 919 | 0 | $self->{i32_thing} = undef; | |||||||||||||
| 920 | 0 | $self->{xtruct_thing} = undef; | |||||||||||||
| 921 | 0 | $self->{insanity_thing} = undef; | |||||||||||||
| 922 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 923 | 0 | ▶ | if (defined $vals->{map_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 924 | 0 | $self->{map_thing} = $vals->{map_thing}; | |||||||||||||
| 925 | } | ||||||||||||||
| 926 | 0 | ▶ | if (defined $vals->{string_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 927 | 0 | $self->{string_thing} = $vals->{string_thing}; | |||||||||||||
| 928 | } | ||||||||||||||
| 929 | 0 | ▶ | if (defined $vals->{i32_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 930 | 0 | $self->{i32_thing} = $vals->{i32_thing}; | |||||||||||||
| 931 | } | ||||||||||||||
| 932 | 0 | ▶ | if (defined $vals->{xtruct_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 933 | 0 | $self->{xtruct_thing} = $vals->{xtruct_thing}; | |||||||||||||
| 934 | } | ||||||||||||||
| 935 | 0 | ▶ | if (defined $vals->{insanity_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 936 | 0 | $self->{insanity_thing} = $vals->{insanity_thing}; | |||||||||||||
| 937 | } | ||||||||||||||
| 938 | } | ||||||||||||||
| 939 | 0 | return bless ($self, $classname); | |||||||||||||
| 940 | } | ||||||||||||||
| 941 | |||||||||||||||
| 942 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 943 | 0 | return 'SomeUnion'; | |||||||||||||
| 944 | } | ||||||||||||||
| 945 | |||||||||||||||
| 946 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=14 SCAR=53.5
| |||||||||||||||
| 947 | 0 | my ($self, $input) = @_; | |||||||||||||
| 948 | 0 | my $xfer = 0; | |||||||||||||
| 949 | 0 | my $fname; | |||||||||||||
| 950 | 0 | my $ftype = 0; | |||||||||||||
| 951 | 0 | my $fid = 0; | |||||||||||||
| 952 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 953 | 0 | while (1) | |||||||||||||
| 954 | { | ||||||||||||||
| 955 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 956 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 957 | 0 | last; | |||||||||||||
| 958 | } | ||||||||||||||
| 959 | 0 | SWITCH: for($fid) | |||||||||||||
| 960 | { | ||||||||||||||
| 961 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::MAP) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 962 | { | ||||||||||||||
| 963 | 0 | my $_size78 = 0; | |||||||||||||
| 964 | 0 | $self->{map_thing} = {}; | |||||||||||||
| 965 | 0 | my $_ktype79 = 0; | |||||||||||||
| 966 | 0 | my $_vtype80 = 0; | |||||||||||||
| 967 | 0 | $xfer += $input->readMapBegin(\$_ktype79, \$_vtype80, \$_size78); | |||||||||||||
| 968 | 0 | ▶ | for (my $_i82 = 0; $_i82 < $_size78; ++$_i82) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 969 | { | ||||||||||||||
| 970 | 0 | my $key83 = 0; | |||||||||||||
| 971 | 0 | my $val84 = 0; | |||||||||||||
| 972 | 0 | $xfer += $input->readI32(\$key83); | |||||||||||||
| 973 | 0 | $xfer += $input->readI64(\$val84); | |||||||||||||
| 974 | 0 | $self->{map_thing}->{$key83} = $val84; | |||||||||||||
| 975 | } | ||||||||||||||
| 976 | 0 | $xfer += $input->readMapEnd(); | |||||||||||||
| 977 | } | ||||||||||||||
| 978 | } else { | ||||||||||||||
| 979 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 980 | } | ||||||||||||||
| 981 | 0 | last; }; | |||||||||||||
| 982 | 0 | ▶ | /^2$/ && do{ if ($ftype == Thrift::TType::STRING) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 983 | 0 | $xfer += $input->readString(\$self->{string_thing}); | |||||||||||||
| 984 | } else { | ||||||||||||||
| 985 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 986 | } | ||||||||||||||
| 987 | 0 | last; }; | |||||||||||||
| 988 | 0 | ▶ | /^3$/ && do{ if ($ftype == Thrift::TType::I32) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 989 | 0 | $xfer += $input->readI32(\$self->{i32_thing}); | |||||||||||||
| 990 | } else { | ||||||||||||||
| 991 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 992 | } | ||||||||||||||
| 993 | 0 | last; }; | |||||||||||||
| 994 | 0 | ▶ | /^4$/ && do{ if ($ftype == Thrift::TType::STRUCT) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 995 | 0 | $self->{xtruct_thing} = ThriftTest::Xtruct3->new(); | |||||||||||||
| 996 | 0 | $xfer += $self->{xtruct_thing}->read($input); | |||||||||||||
| 997 | } else { | ||||||||||||||
| 998 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 999 | } | ||||||||||||||
| 1000 | 0 | last; }; | |||||||||||||
| 1001 | 0 | ▶ | /^5$/ && do{ if ($ftype == Thrift::TType::STRUCT) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1002 | 0 | $self->{insanity_thing} = ThriftTest::Insanity->new(); | |||||||||||||
| 1003 | 0 | $xfer += $self->{insanity_thing}->read($input); | |||||||||||||
| 1004 | } else { | ||||||||||||||
| 1005 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1006 | } | ||||||||||||||
| 1007 | 0 | last; }; | |||||||||||||
| 1008 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1009 | } | ||||||||||||||
| 1010 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 1011 | } | ||||||||||||||
| 1012 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 1013 | 0 | return $xfer; | |||||||||||||
| 1014 | } | ||||||||||||||
| 1015 | |||||||||||||||
| 1016 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=7 SCAR=40.3
| |||||||||||||||
| 1017 | 0 | my ($self, $output) = @_; | |||||||||||||
| 1018 | 0 | my $xfer = 0; | |||||||||||||
| 1019 | 0 | $xfer += $output->writeStructBegin('SomeUnion'); | |||||||||||||
| 1020 | 0 | ▶ | if (defined $self->{map_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1021 | 0 | $xfer += $output->writeFieldBegin('map_thing', Thrift::TType::MAP, 1); | |||||||||||||
| 1022 | { | ||||||||||||||
| 1023 | 0 | $xfer += $output->writeMapBegin(Thrift::TType::I32, Thrift::TType::I64, scalar(keys %{$self->{map_thing}})); | |||||||||||||
| 1024 | { | ||||||||||||||
| 1025 | 0 | ▶ | while( my ($kiter85,$viter86) = each %{$self->{map_thing}}) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1026 | { | ||||||||||||||
| 1027 | 0 | $xfer += $output->writeI32($kiter85); | |||||||||||||
| 1028 | 0 | $xfer += $output->writeI64($viter86); | |||||||||||||
| 1029 | } | ||||||||||||||
| 1030 | } | ||||||||||||||
| 1031 | 0 | $xfer += $output->writeMapEnd(); | |||||||||||||
| 1032 | } | ||||||||||||||
| 1033 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1034 | } | ||||||||||||||
| 1035 | 0 | ▶ | if (defined $self->{string_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1036 | 0 | $xfer += $output->writeFieldBegin('string_thing', Thrift::TType::STRING, 2); | |||||||||||||
| 1037 | 0 | $xfer += $output->writeString($self->{string_thing}); | |||||||||||||
| 1038 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1039 | } | ||||||||||||||
| 1040 | 0 | ▶ | if (defined $self->{i32_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1041 | 0 | $xfer += $output->writeFieldBegin('i32_thing', Thrift::TType::I32, 3); | |||||||||||||
| 1042 | 0 | $xfer += $output->writeI32($self->{i32_thing}); | |||||||||||||
| 1043 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1044 | } | ||||||||||||||
| 1045 | 0 | ▶ | if (defined $self->{xtruct_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1046 | 0 | $xfer += $output->writeFieldBegin('xtruct_thing', Thrift::TType::STRUCT, 4); | |||||||||||||
| 1047 | 0 | $xfer += $self->{xtruct_thing}->write($output); | |||||||||||||
| 1048 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1049 | } | ||||||||||||||
| 1050 | 0 | ▶ | if (defined $self->{insanity_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1051 | 0 | $xfer += $output->writeFieldBegin('insanity_thing', Thrift::TType::STRUCT, 5); | |||||||||||||
| 1052 | 0 | $xfer += $self->{insanity_thing}->write($output); | |||||||||||||
| 1053 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1054 | } | ||||||||||||||
| 1055 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 1056 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 1057 | 0 | return $xfer; | |||||||||||||
| 1058 | } | ||||||||||||||
| 1059 | |||||||||||||||
| 1060 | package ThriftTest::Xception; | ||||||||||||||
| 1061 | 2 | ▶ | use base qw(Thrift::TException); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 1062 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 1063 | 2 | ThriftTest::Xception->mk_accessors( qw( errorCode message ) ); | |||||||||||||
| 1064 | |||||||||||||||
| 1065 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
| |||||||||||||||
| 1066 | 0 | my $classname = shift; | |||||||||||||
| 1067 | 0 | my $self = {}; | |||||||||||||
| 1068 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 1069 | 0 | $self->{errorCode} = undef; | |||||||||||||
| 1070 | 0 | $self->{message} = undef; | |||||||||||||
| 1071 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1072 | 0 | ▶ | if (defined $vals->{errorCode}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1073 | 0 | $self->{errorCode} = $vals->{errorCode}; | |||||||||||||
| 1074 | } | ||||||||||||||
| 1075 | 0 | ▶ | if (defined $vals->{message}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1076 | 0 | $self->{message} = $vals->{message}; | |||||||||||||
| 1077 | } | ||||||||||||||
| 1078 | } | ||||||||||||||
| 1079 | 0 | return bless ($self, $classname); | |||||||||||||
| 1080 | } | ||||||||||||||
| 1081 | |||||||||||||||
| 1082 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 1083 | 0 | return 'Xception'; | |||||||||||||
| 1084 | } | ||||||||||||||
| 1085 | |||||||||||||||
| 1086 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=7 SCAR=40.3
| |||||||||||||||
| 1087 | 0 | my ($self, $input) = @_; | |||||||||||||
| 1088 | 0 | my $xfer = 0; | |||||||||||||
| 1089 | 0 | my $fname; | |||||||||||||
| 1090 | 0 | my $ftype = 0; | |||||||||||||
| 1091 | 0 | my $fid = 0; | |||||||||||||
| 1092 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 1093 | 0 | while (1) | |||||||||||||
| 1094 | { | ||||||||||||||
| 1095 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 1096 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1097 | 0 | last; | |||||||||||||
| 1098 | } | ||||||||||||||
| 1099 | 0 | SWITCH: for($fid) | |||||||||||||
| 1100 | { | ||||||||||||||
| 1101 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::I32) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1102 | 0 | $xfer += $input->readI32(\$self->{errorCode}); | |||||||||||||
| 1103 | } else { | ||||||||||||||
| 1104 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1105 | } | ||||||||||||||
| 1106 | 0 | last; }; | |||||||||||||
| 1107 | 0 | ▶ | /^2$/ && do{ if ($ftype == Thrift::TType::STRING) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1108 | 0 | $xfer += $input->readString(\$self->{message}); | |||||||||||||
| 1109 | } else { | ||||||||||||||
| 1110 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1111 | } | ||||||||||||||
| 1112 | 0 | last; }; | |||||||||||||
| 1113 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1114 | } | ||||||||||||||
| 1115 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 1116 | } | ||||||||||||||
| 1117 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 1118 | 0 | return $xfer; | |||||||||||||
| 1119 | } | ||||||||||||||
| 1120 | |||||||||||||||
| 1121 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=3 SCAR=24.8
| |||||||||||||||
| 1122 | 0 | my ($self, $output) = @_; | |||||||||||||
| 1123 | 0 | my $xfer = 0; | |||||||||||||
| 1124 | 0 | $xfer += $output->writeStructBegin('Xception'); | |||||||||||||
| 1125 | 0 | ▶ | if (defined $self->{errorCode}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1126 | 0 | $xfer += $output->writeFieldBegin('errorCode', Thrift::TType::I32, 1); | |||||||||||||
| 1127 | 0 | $xfer += $output->writeI32($self->{errorCode}); | |||||||||||||
| 1128 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1129 | } | ||||||||||||||
| 1130 | 0 | ▶ | if (defined $self->{message}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1131 | 0 | $xfer += $output->writeFieldBegin('message', Thrift::TType::STRING, 2); | |||||||||||||
| 1132 | 0 | $xfer += $output->writeString($self->{message}); | |||||||||||||
| 1133 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1134 | } | ||||||||||||||
| 1135 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 1136 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 1137 | 0 | return $xfer; | |||||||||||||
| 1138 | } | ||||||||||||||
| 1139 | |||||||||||||||
| 1140 | package ThriftTest::Xception2; | ||||||||||||||
| 1141 | 2 | ▶ | use base qw(Thrift::TException); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 1142 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 1143 | 2 | ThriftTest::Xception2->mk_accessors( qw( errorCode struct_thing ) ); | |||||||||||||
| 1144 | |||||||||||||||
| 1145 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
| |||||||||||||||
| 1146 | 0 | my $classname = shift; | |||||||||||||
| 1147 | 0 | my $self = {}; | |||||||||||||
| 1148 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 1149 | 0 | $self->{errorCode} = undef; | |||||||||||||
| 1150 | 0 | $self->{struct_thing} = undef; | |||||||||||||
| 1151 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1152 | 0 | ▶ | if (defined $vals->{errorCode}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1153 | 0 | $self->{errorCode} = $vals->{errorCode}; | |||||||||||||
| 1154 | } | ||||||||||||||
| 1155 | 0 | ▶ | if (defined $vals->{struct_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1156 | 0 | $self->{struct_thing} = $vals->{struct_thing}; | |||||||||||||
| 1157 | } | ||||||||||||||
| 1158 | } | ||||||||||||||
| 1159 | 0 | return bless ($self, $classname); | |||||||||||||
| 1160 | } | ||||||||||||||
| 1161 | |||||||||||||||
| 1162 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 1163 | 0 | return 'Xception2'; | |||||||||||||
| 1164 | } | ||||||||||||||
| 1165 | |||||||||||||||
| 1166 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=7 SCAR=40.3
| |||||||||||||||
| 1167 | 0 | my ($self, $input) = @_; | |||||||||||||
| 1168 | 0 | my $xfer = 0; | |||||||||||||
| 1169 | 0 | my $fname; | |||||||||||||
| 1170 | 0 | my $ftype = 0; | |||||||||||||
| 1171 | 0 | my $fid = 0; | |||||||||||||
| 1172 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 1173 | 0 | while (1) | |||||||||||||
| 1174 | { | ||||||||||||||
| 1175 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 1176 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1177 | 0 | last; | |||||||||||||
| 1178 | } | ||||||||||||||
| 1179 | 0 | SWITCH: for($fid) | |||||||||||||
| 1180 | { | ||||||||||||||
| 1181 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::I32) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1182 | 0 | $xfer += $input->readI32(\$self->{errorCode}); | |||||||||||||
| 1183 | } else { | ||||||||||||||
| 1184 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1185 | } | ||||||||||||||
| 1186 | 0 | last; }; | |||||||||||||
| 1187 | 0 | ▶ | /^2$/ && do{ if ($ftype == Thrift::TType::STRUCT) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1188 | 0 | $self->{struct_thing} = ThriftTest::Xtruct->new(); | |||||||||||||
| 1189 | 0 | $xfer += $self->{struct_thing}->read($input); | |||||||||||||
| 1190 | } else { | ||||||||||||||
| 1191 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1192 | } | ||||||||||||||
| 1193 | 0 | last; }; | |||||||||||||
| 1194 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1195 | } | ||||||||||||||
| 1196 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 1197 | } | ||||||||||||||
| 1198 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 1199 | 0 | return $xfer; | |||||||||||||
| 1200 | } | ||||||||||||||
| 1201 | |||||||||||||||
| 1202 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=3 SCAR=24.8
| |||||||||||||||
| 1203 | 0 | my ($self, $output) = @_; | |||||||||||||
| 1204 | 0 | my $xfer = 0; | |||||||||||||
| 1205 | 0 | $xfer += $output->writeStructBegin('Xception2'); | |||||||||||||
| 1206 | 0 | ▶ | if (defined $self->{errorCode}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1207 | 0 | $xfer += $output->writeFieldBegin('errorCode', Thrift::TType::I32, 1); | |||||||||||||
| 1208 | 0 | $xfer += $output->writeI32($self->{errorCode}); | |||||||||||||
| 1209 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1210 | } | ||||||||||||||
| 1211 | 0 | ▶ | if (defined $self->{struct_thing}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1212 | 0 | $xfer += $output->writeFieldBegin('struct_thing', Thrift::TType::STRUCT, 2); | |||||||||||||
| 1213 | 0 | $xfer += $self->{struct_thing}->write($output); | |||||||||||||
| 1214 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1215 | } | ||||||||||||||
| 1216 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 1217 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 1218 | 0 | return $xfer; | |||||||||||||
| 1219 | } | ||||||||||||||
| 1220 | |||||||||||||||
| 1221 | package ThriftTest::EmptyStruct; | ||||||||||||||
| 1222 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 1223 | |||||||||||||||
| 1224 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
| |||||||||||||||
| 1225 | 0 | my $classname = shift; | |||||||||||||
| 1226 | 0 | my $self = {}; | |||||||||||||
| 1227 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 1228 | 0 | return bless ($self, $classname); | |||||||||||||
| 1229 | } | ||||||||||||||
| 1230 | |||||||||||||||
| 1231 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 1232 | 0 | return 'EmptyStruct'; | |||||||||||||
| 1233 | } | ||||||||||||||
| 1234 | |||||||||||||||
| 1235 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=3 SCAR=24.8
| |||||||||||||||
| 1236 | 0 | my ($self, $input) = @_; | |||||||||||||
| 1237 | 0 | my $xfer = 0; | |||||||||||||
| 1238 | 0 | my $fname; | |||||||||||||
| 1239 | 0 | my $ftype = 0; | |||||||||||||
| 1240 | 0 | my $fid = 0; | |||||||||||||
| 1241 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 1242 | 0 | while (1) | |||||||||||||
| 1243 | { | ||||||||||||||
| 1244 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 1245 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1246 | 0 | last; | |||||||||||||
| 1247 | } | ||||||||||||||
| 1248 | 0 | SWITCH: for($fid) | |||||||||||||
| 1249 | { | ||||||||||||||
| 1250 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1251 | } | ||||||||||||||
| 1252 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 1253 | } | ||||||||||||||
| 1254 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 1255 | 0 | return $xfer; | |||||||||||||
| 1256 | } | ||||||||||||||
| 1257 | |||||||||||||||
| 1258 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=1 SCAR=6.9
| |||||||||||||||
| 1259 | 0 | my ($self, $output) = @_; | |||||||||||||
| 1260 | 0 | my $xfer = 0; | |||||||||||||
| 1261 | 0 | $xfer += $output->writeStructBegin('EmptyStruct'); | |||||||||||||
| 1262 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 1263 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 1264 | 0 | return $xfer; | |||||||||||||
| 1265 | } | ||||||||||||||
| 1266 | |||||||||||||||
| 1267 | package ThriftTest::OneField; | ||||||||||||||
| 1268 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 1269 | 2 | ThriftTest::OneField->mk_accessors( qw( field ) ); | |||||||||||||
| 1270 | |||||||||||||||
| 1271 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=4 SCAR=30.0
| |||||||||||||||
| 1272 | 0 | my $classname = shift; | |||||||||||||
| 1273 | 0 | my $self = {}; | |||||||||||||
| 1274 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 1275 | 0 | $self->{field} = undef; | |||||||||||||
| 1276 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1277 | 0 | ▶ | if (defined $vals->{field}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1278 | 0 | $self->{field} = $vals->{field}; | |||||||||||||
| 1279 | } | ||||||||||||||
| 1280 | } | ||||||||||||||
| 1281 | 0 | return bless ($self, $classname); | |||||||||||||
| 1282 | } | ||||||||||||||
| 1283 | |||||||||||||||
| 1284 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 1285 | 0 | return 'OneField'; | |||||||||||||
| 1286 | } | ||||||||||||||
| 1287 | |||||||||||||||
| 1288 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=5 SCAR=34.0
| |||||||||||||||
| 1289 | 0 | my ($self, $input) = @_; | |||||||||||||
| 1290 | 0 | my $xfer = 0; | |||||||||||||
| 1291 | 0 | my $fname; | |||||||||||||
| 1292 | 0 | my $ftype = 0; | |||||||||||||
| 1293 | 0 | my $fid = 0; | |||||||||||||
| 1294 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 1295 | 0 | while (1) | |||||||||||||
| 1296 | { | ||||||||||||||
| 1297 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 1298 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1299 | 0 | last; | |||||||||||||
| 1300 | } | ||||||||||||||
| 1301 | 0 | SWITCH: for($fid) | |||||||||||||
| 1302 | { | ||||||||||||||
| 1303 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::STRUCT) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1304 | 0 | $self->{field} = ThriftTest::EmptyStruct->new(); | |||||||||||||
| 1305 | 0 | $xfer += $self->{field}->read($input); | |||||||||||||
| 1306 | } else { | ||||||||||||||
| 1307 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1308 | } | ||||||||||||||
| 1309 | 0 | last; }; | |||||||||||||
| 1310 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1311 | } | ||||||||||||||
| 1312 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 1313 | } | ||||||||||||||
| 1314 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 1315 | 0 | return $xfer; | |||||||||||||
| 1316 | } | ||||||||||||||
| 1317 | |||||||||||||||
| 1318 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=2 SCAR=17.9
| |||||||||||||||
| 1319 | 0 | my ($self, $output) = @_; | |||||||||||||
| 1320 | 0 | my $xfer = 0; | |||||||||||||
| 1321 | 0 | $xfer += $output->writeStructBegin('OneField'); | |||||||||||||
| 1322 | 0 | ▶ | if (defined $self->{field}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1323 | 0 | $xfer += $output->writeFieldBegin('field', Thrift::TType::STRUCT, 1); | |||||||||||||
| 1324 | 0 | $xfer += $self->{field}->write($output); | |||||||||||||
| 1325 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1326 | } | ||||||||||||||
| 1327 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 1328 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 1329 | 0 | return $xfer; | |||||||||||||
| 1330 | } | ||||||||||||||
| 1331 | |||||||||||||||
| 1332 | package ThriftTest::VersioningTestV1; | ||||||||||||||
| 1333 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 1334 | 2 | ThriftTest::VersioningTestV1->mk_accessors( qw( begin_in_both old_string end_in_both ) ); | |||||||||||||
| 1335 | |||||||||||||||
| 1336 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=6 SCAR=37.4
| |||||||||||||||
| 1337 | 0 | my $classname = shift; | |||||||||||||
| 1338 | 0 | my $self = {}; | |||||||||||||
| 1339 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 1340 | 0 | $self->{begin_in_both} = undef; | |||||||||||||
| 1341 | 0 | $self->{old_string} = undef; | |||||||||||||
| 1342 | 0 | $self->{end_in_both} = undef; | |||||||||||||
| 1343 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1344 | 0 | ▶ | if (defined $vals->{begin_in_both}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1345 | 0 | $self->{begin_in_both} = $vals->{begin_in_both}; | |||||||||||||
| 1346 | } | ||||||||||||||
| 1347 | 0 | ▶ | if (defined $vals->{old_string}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1348 | 0 | $self->{old_string} = $vals->{old_string}; | |||||||||||||
| 1349 | } | ||||||||||||||
| 1350 | 0 | ▶ | if (defined $vals->{end_in_both}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1351 | 0 | $self->{end_in_both} = $vals->{end_in_both}; | |||||||||||||
| 1352 | } | ||||||||||||||
| 1353 | } | ||||||||||||||
| 1354 | 0 | return bless ($self, $classname); | |||||||||||||
| 1355 | } | ||||||||||||||
| 1356 | |||||||||||||||
| 1357 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 1358 | 0 | return 'VersioningTestV1'; | |||||||||||||
| 1359 | } | ||||||||||||||
| 1360 | |||||||||||||||
| 1361 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=9 SCAR=45.0
| |||||||||||||||
| 1362 | 0 | my ($self, $input) = @_; | |||||||||||||
| 1363 | 0 | my $xfer = 0; | |||||||||||||
| 1364 | 0 | my $fname; | |||||||||||||
| 1365 | 0 | my $ftype = 0; | |||||||||||||
| 1366 | 0 | my $fid = 0; | |||||||||||||
| 1367 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 1368 | 0 | while (1) | |||||||||||||
| 1369 | { | ||||||||||||||
| 1370 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 1371 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1372 | 0 | last; | |||||||||||||
| 1373 | } | ||||||||||||||
| 1374 | 0 | SWITCH: for($fid) | |||||||||||||
| 1375 | { | ||||||||||||||
| 1376 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::I32) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1377 | 0 | $xfer += $input->readI32(\$self->{begin_in_both}); | |||||||||||||
| 1378 | } else { | ||||||||||||||
| 1379 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1380 | } | ||||||||||||||
| 1381 | 0 | last; }; | |||||||||||||
| 1382 | 0 | ▶ | /^3$/ && do{ if ($ftype == Thrift::TType::STRING) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1383 | 0 | $xfer += $input->readString(\$self->{old_string}); | |||||||||||||
| 1384 | } else { | ||||||||||||||
| 1385 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1386 | } | ||||||||||||||
| 1387 | 0 | last; }; | |||||||||||||
| 1388 | 0 | ▶ | /^12$/ && do{ if ($ftype == Thrift::TType::I32) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1389 | 0 | $xfer += $input->readI32(\$self->{end_in_both}); | |||||||||||||
| 1390 | } else { | ||||||||||||||
| 1391 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1392 | } | ||||||||||||||
| 1393 | 0 | last; }; | |||||||||||||
| 1394 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1395 | } | ||||||||||||||
| 1396 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 1397 | } | ||||||||||||||
| 1398 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 1399 | 0 | return $xfer; | |||||||||||||
| 1400 | } | ||||||||||||||
| 1401 | |||||||||||||||
| 1402 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=4 SCAR=30.0
| |||||||||||||||
| 1403 | 0 | my ($self, $output) = @_; | |||||||||||||
| 1404 | 0 | my $xfer = 0; | |||||||||||||
| 1405 | 0 | $xfer += $output->writeStructBegin('VersioningTestV1'); | |||||||||||||
| 1406 | 0 | ▶ | if (defined $self->{begin_in_both}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1407 | 0 | $xfer += $output->writeFieldBegin('begin_in_both', Thrift::TType::I32, 1); | |||||||||||||
| 1408 | 0 | $xfer += $output->writeI32($self->{begin_in_both}); | |||||||||||||
| 1409 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1410 | } | ||||||||||||||
| 1411 | 0 | ▶ | if (defined $self->{old_string}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1412 | 0 | $xfer += $output->writeFieldBegin('old_string', Thrift::TType::STRING, 3); | |||||||||||||
| 1413 | 0 | $xfer += $output->writeString($self->{old_string}); | |||||||||||||
| 1414 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1415 | } | ||||||||||||||
| 1416 | 0 | ▶ | if (defined $self->{end_in_both}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1417 | 0 | $xfer += $output->writeFieldBegin('end_in_both', Thrift::TType::I32, 12); | |||||||||||||
| 1418 | 0 | $xfer += $output->writeI32($self->{end_in_both}); | |||||||||||||
| 1419 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1420 | } | ||||||||||||||
| 1421 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 1422 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 1423 | 0 | return $xfer; | |||||||||||||
| 1424 | } | ||||||||||||||
| 1425 | |||||||||||||||
| 1426 | package ThriftTest::VersioningTestV2; | ||||||||||||||
| 1427 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 1428 | 2 | ThriftTest::VersioningTestV2->mk_accessors( qw( begin_in_both newint newbyte newshort newlong newdouble newstruct newlist newset newmap newstring end_in_both ) ); | |||||||||||||
| 1429 | |||||||||||||||
| 1430 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=15 SCAR=54.8
| |||||||||||||||
| 1431 | 0 | my $classname = shift; | |||||||||||||
| 1432 | 0 | my $self = {}; | |||||||||||||
| 1433 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 1434 | 0 | $self->{begin_in_both} = undef; | |||||||||||||
| 1435 | 0 | $self->{newint} = undef; | |||||||||||||
| 1436 | 0 | $self->{newbyte} = undef; | |||||||||||||
| 1437 | 0 | $self->{newshort} = undef; | |||||||||||||
| 1438 | 0 | $self->{newlong} = undef; | |||||||||||||
| 1439 | 0 | $self->{newdouble} = undef; | |||||||||||||
| 1440 | 0 | $self->{newstruct} = undef; | |||||||||||||
| 1441 | 0 | $self->{newlist} = undef; | |||||||||||||
| 1442 | 0 | $self->{newset} = undef; | |||||||||||||
| 1443 | 0 | $self->{newmap} = undef; | |||||||||||||
| 1444 | 0 | $self->{newstring} = undef; | |||||||||||||
| 1445 | 0 | $self->{end_in_both} = undef; | |||||||||||||
| 1446 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1447 | 0 | ▶ | if (defined $vals->{begin_in_both}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1448 | 0 | $self->{begin_in_both} = $vals->{begin_in_both}; | |||||||||||||
| 1449 | } | ||||||||||||||
| 1450 | 0 | ▶ | if (defined $vals->{newint}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1451 | 0 | $self->{newint} = $vals->{newint}; | |||||||||||||
| 1452 | } | ||||||||||||||
| 1453 | 0 | ▶ | if (defined $vals->{newbyte}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1454 | 0 | $self->{newbyte} = $vals->{newbyte}; | |||||||||||||
| 1455 | } | ||||||||||||||
| 1456 | 0 | ▶ | if (defined $vals->{newshort}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1457 | 0 | $self->{newshort} = $vals->{newshort}; | |||||||||||||
| 1458 | } | ||||||||||||||
| 1459 | 0 | ▶ | if (defined $vals->{newlong}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1460 | 0 | $self->{newlong} = $vals->{newlong}; | |||||||||||||
| 1461 | } | ||||||||||||||
| 1462 | 0 | ▶ | if (defined $vals->{newdouble}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1463 | 0 | $self->{newdouble} = $vals->{newdouble}; | |||||||||||||
| 1464 | } | ||||||||||||||
| 1465 | 0 | ▶ | if (defined $vals->{newstruct}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1466 | 0 | $self->{newstruct} = $vals->{newstruct}; | |||||||||||||
| 1467 | } | ||||||||||||||
| 1468 | 0 | ▶ | if (defined $vals->{newlist}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1469 | 0 | $self->{newlist} = $vals->{newlist}; | |||||||||||||
| 1470 | } | ||||||||||||||
| 1471 | 0 | ▶ | if (defined $vals->{newset}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1472 | 0 | $self->{newset} = $vals->{newset}; | |||||||||||||
| 1473 | } | ||||||||||||||
| 1474 | 0 | ▶ | if (defined $vals->{newmap}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1475 | 0 | $self->{newmap} = $vals->{newmap}; | |||||||||||||
| 1476 | } | ||||||||||||||
| 1477 | 0 | ▶ | if (defined $vals->{newstring}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1478 | 0 | $self->{newstring} = $vals->{newstring}; | |||||||||||||
| 1479 | } | ||||||||||||||
| 1480 | 0 | ▶ | if (defined $vals->{end_in_both}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1481 | 0 | $self->{end_in_both} = $vals->{end_in_both}; | |||||||||||||
| 1482 | } | ||||||||||||||
| 1483 | } | ||||||||||||||
| 1484 | 0 | return bless ($self, $classname); | |||||||||||||
| 1485 | } | ||||||||||||||
| 1486 | |||||||||||||||
| 1487 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 1488 | 0 | return 'VersioningTestV2'; | |||||||||||||
| 1489 | } | ||||||||||||||
| 1490 | |||||||||||||||
| 1491 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=30 SCAR=68.4
| |||||||||||||||
| 1492 | 0 | my ($self, $input) = @_; | |||||||||||||
| 1493 | 0 | my $xfer = 0; | |||||||||||||
| 1494 | 0 | my $fname; | |||||||||||||
| 1495 | 0 | my $ftype = 0; | |||||||||||||
| 1496 | 0 | my $fid = 0; | |||||||||||||
| 1497 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 1498 | 0 | while (1) | |||||||||||||
| 1499 | { | ||||||||||||||
| 1500 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 1501 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1502 | 0 | last; | |||||||||||||
| 1503 | } | ||||||||||||||
| 1504 | 0 | SWITCH: for($fid) | |||||||||||||
| 1505 | { | ||||||||||||||
| 1506 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::I32) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1507 | 0 | $xfer += $input->readI32(\$self->{begin_in_both}); | |||||||||||||
| 1508 | } else { | ||||||||||||||
| 1509 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1510 | } | ||||||||||||||
| 1511 | 0 | last; }; | |||||||||||||
| 1512 | 0 | ▶ | /^2$/ && do{ if ($ftype == Thrift::TType::I32) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1513 | 0 | $xfer += $input->readI32(\$self->{newint}); | |||||||||||||
| 1514 | } else { | ||||||||||||||
| 1515 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1516 | } | ||||||||||||||
| 1517 | 0 | last; }; | |||||||||||||
| 1518 | 0 | ▶ | /^3$/ && do{ if ($ftype == Thrift::TType::BYTE) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1519 | 0 | $xfer += $input->readByte(\$self->{newbyte}); | |||||||||||||
| 1520 | } else { | ||||||||||||||
| 1521 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1522 | } | ||||||||||||||
| 1523 | 0 | last; }; | |||||||||||||
| 1524 | 0 | ▶ | /^4$/ && do{ if ($ftype == Thrift::TType::I16) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1525 | 0 | $xfer += $input->readI16(\$self->{newshort}); | |||||||||||||
| 1526 | } else { | ||||||||||||||
| 1527 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1528 | } | ||||||||||||||
| 1529 | 0 | last; }; | |||||||||||||
| 1530 | 0 | ▶ | /^5$/ && do{ if ($ftype == Thrift::TType::I64) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1531 | 0 | $xfer += $input->readI64(\$self->{newlong}); | |||||||||||||
| 1532 | } else { | ||||||||||||||
| 1533 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1534 | } | ||||||||||||||
| 1535 | 0 | last; }; | |||||||||||||
| 1536 | 0 | ▶ | /^6$/ && do{ if ($ftype == Thrift::TType::DOUBLE) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1537 | 0 | $xfer += $input->readDouble(\$self->{newdouble}); | |||||||||||||
| 1538 | } else { | ||||||||||||||
| 1539 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1540 | } | ||||||||||||||
| 1541 | 0 | last; }; | |||||||||||||
| 1542 | 0 | ▶ | /^7$/ && do{ if ($ftype == Thrift::TType::STRUCT) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1543 | 0 | $self->{newstruct} = ThriftTest::Bonk->new(); | |||||||||||||
| 1544 | 0 | $xfer += $self->{newstruct}->read($input); | |||||||||||||
| 1545 | } else { | ||||||||||||||
| 1546 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1547 | } | ||||||||||||||
| 1548 | 0 | last; }; | |||||||||||||
| 1549 | 0 | ▶ | /^8$/ && do{ if ($ftype == Thrift::TType::LIST) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1550 | { | ||||||||||||||
| 1551 | 0 | my $_size87 = 0; | |||||||||||||
| 1552 | 0 | $self->{newlist} = []; | |||||||||||||
| 1553 | 0 | my $_etype90 = 0; | |||||||||||||
| 1554 | 0 | $xfer += $input->readListBegin(\$_etype90, \$_size87); | |||||||||||||
| 1555 | 0 | ▶ | for (my $_i91 = 0; $_i91 < $_size87; ++$_i91) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1556 | { | ||||||||||||||
| 1557 | 0 | my $elem92 = undef; | |||||||||||||
| 1558 | 0 | $xfer += $input->readI32(\$elem92); | |||||||||||||
| 1559 | 0 | push(@{$self->{newlist}},$elem92); | |||||||||||||
| 1560 | } | ||||||||||||||
| 1561 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 1562 | } | ||||||||||||||
| 1563 | } else { | ||||||||||||||
| 1564 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1565 | } | ||||||||||||||
| 1566 | 0 | last; }; | |||||||||||||
| 1567 | 0 | ▶ | /^9$/ && do{ if ($ftype == Thrift::TType::SET) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1568 | { | ||||||||||||||
| 1569 | 0 | my $_size93 = 0; | |||||||||||||
| 1570 | 0 | $self->{newset} = {}; | |||||||||||||
| 1571 | 0 | my $_etype96 = 0; | |||||||||||||
| 1572 | 0 | $xfer += $input->readSetBegin(\$_etype96, \$_size93); | |||||||||||||
| 1573 | 0 | ▶ | for (my $_i97 = 0; $_i97 < $_size93; ++$_i97) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1574 | { | ||||||||||||||
| 1575 | 0 | my $elem98 = undef; | |||||||||||||
| 1576 | 0 | $xfer += $input->readI32(\$elem98); | |||||||||||||
| 1577 | 0 | $self->{newset}->{$elem98} = 1; | |||||||||||||
| 1578 | } | ||||||||||||||
| 1579 | 0 | $xfer += $input->readSetEnd(); | |||||||||||||
| 1580 | } | ||||||||||||||
| 1581 | } else { | ||||||||||||||
| 1582 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1583 | } | ||||||||||||||
| 1584 | 0 | last; }; | |||||||||||||
| 1585 | 0 | ▶ | /^10$/ && do{ if ($ftype == Thrift::TType::MAP) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1586 | { | ||||||||||||||
| 1587 | 0 | my $_size99 = 0; | |||||||||||||
| 1588 | 0 | $self->{newmap} = {}; | |||||||||||||
| 1589 | 0 | my $_ktype100 = 0; | |||||||||||||
| 1590 | 0 | my $_vtype101 = 0; | |||||||||||||
| 1591 | 0 | $xfer += $input->readMapBegin(\$_ktype100, \$_vtype101, \$_size99); | |||||||||||||
| 1592 | 0 | ▶ | for (my $_i103 = 0; $_i103 < $_size99; ++$_i103) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1593 | { | ||||||||||||||
| 1594 | 0 | my $key104 = 0; | |||||||||||||
| 1595 | 0 | my $val105 = 0; | |||||||||||||
| 1596 | 0 | $xfer += $input->readI32(\$key104); | |||||||||||||
| 1597 | 0 | $xfer += $input->readI32(\$val105); | |||||||||||||
| 1598 | 0 | $self->{newmap}->{$key104} = $val105; | |||||||||||||
| 1599 | } | ||||||||||||||
| 1600 | 0 | $xfer += $input->readMapEnd(); | |||||||||||||
| 1601 | } | ||||||||||||||
| 1602 | } else { | ||||||||||||||
| 1603 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1604 | } | ||||||||||||||
| 1605 | 0 | last; }; | |||||||||||||
| 1606 | 0 | ▶ | /^11$/ && do{ if ($ftype == Thrift::TType::STRING) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1607 | 0 | $xfer += $input->readString(\$self->{newstring}); | |||||||||||||
| 1608 | } else { | ||||||||||||||
| 1609 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1610 | } | ||||||||||||||
| 1611 | 0 | last; }; | |||||||||||||
| 1612 | 0 | ▶ | /^12$/ && do{ if ($ftype == Thrift::TType::I32) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1613 | 0 | $xfer += $input->readI32(\$self->{end_in_both}); | |||||||||||||
| 1614 | } else { | ||||||||||||||
| 1615 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1616 | } | ||||||||||||||
| 1617 | 0 | last; }; | |||||||||||||
| 1618 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1619 | } | ||||||||||||||
| 1620 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 1621 | } | ||||||||||||||
| 1622 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 1623 | 0 | return $xfer; | |||||||||||||
| 1624 | } | ||||||||||||||
| 1625 | |||||||||||||||
| 1626 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=16 SCAR=56.1
| |||||||||||||||
| 1627 | 0 | my ($self, $output) = @_; | |||||||||||||
| 1628 | 0 | my $xfer = 0; | |||||||||||||
| 1629 | 0 | $xfer += $output->writeStructBegin('VersioningTestV2'); | |||||||||||||
| 1630 | 0 | ▶ | if (defined $self->{begin_in_both}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1631 | 0 | $xfer += $output->writeFieldBegin('begin_in_both', Thrift::TType::I32, 1); | |||||||||||||
| 1632 | 0 | $xfer += $output->writeI32($self->{begin_in_both}); | |||||||||||||
| 1633 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1634 | } | ||||||||||||||
| 1635 | 0 | ▶ | if (defined $self->{newint}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1636 | 0 | $xfer += $output->writeFieldBegin('newint', Thrift::TType::I32, 2); | |||||||||||||
| 1637 | 0 | $xfer += $output->writeI32($self->{newint}); | |||||||||||||
| 1638 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1639 | } | ||||||||||||||
| 1640 | 0 | ▶ | if (defined $self->{newbyte}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1641 | 0 | $xfer += $output->writeFieldBegin('newbyte', Thrift::TType::BYTE, 3); | |||||||||||||
| 1642 | 0 | $xfer += $output->writeByte($self->{newbyte}); | |||||||||||||
| 1643 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1644 | } | ||||||||||||||
| 1645 | 0 | ▶ | if (defined $self->{newshort}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1646 | 0 | $xfer += $output->writeFieldBegin('newshort', Thrift::TType::I16, 4); | |||||||||||||
| 1647 | 0 | $xfer += $output->writeI16($self->{newshort}); | |||||||||||||
| 1648 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1649 | } | ||||||||||||||
| 1650 | 0 | ▶ | if (defined $self->{newlong}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1651 | 0 | $xfer += $output->writeFieldBegin('newlong', Thrift::TType::I64, 5); | |||||||||||||
| 1652 | 0 | $xfer += $output->writeI64($self->{newlong}); | |||||||||||||
| 1653 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1654 | } | ||||||||||||||
| 1655 | 0 | ▶ | if (defined $self->{newdouble}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1656 | 0 | $xfer += $output->writeFieldBegin('newdouble', Thrift::TType::DOUBLE, 6); | |||||||||||||
| 1657 | 0 | $xfer += $output->writeDouble($self->{newdouble}); | |||||||||||||
| 1658 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1659 | } | ||||||||||||||
| 1660 | 0 | ▶ | if (defined $self->{newstruct}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1661 | 0 | $xfer += $output->writeFieldBegin('newstruct', Thrift::TType::STRUCT, 7); | |||||||||||||
| 1662 | 0 | $xfer += $self->{newstruct}->write($output); | |||||||||||||
| 1663 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1664 | } | ||||||||||||||
| 1665 | 0 | ▶ | if (defined $self->{newlist}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1666 | 0 | $xfer += $output->writeFieldBegin('newlist', Thrift::TType::LIST, 8); | |||||||||||||
| 1667 | { | ||||||||||||||
| 1668 | 0 | $xfer += $output->writeListBegin(Thrift::TType::I32, scalar(@{$self->{newlist}})); | |||||||||||||
| 1669 | { | ||||||||||||||
| 1670 | 0 | foreach my $iter106 (@{$self->{newlist}}) | |||||||||||||
| 1671 | { | ||||||||||||||
| 1672 | 0 | $xfer += $output->writeI32($iter106); | |||||||||||||
| 1673 | } | ||||||||||||||
| 1674 | } | ||||||||||||||
| 1675 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 1676 | } | ||||||||||||||
| 1677 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1678 | } | ||||||||||||||
| 1679 | 0 | ▶ | if (defined $self->{newset}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1680 | 0 | $xfer += $output->writeFieldBegin('newset', Thrift::TType::SET, 9); | |||||||||||||
| 1681 | { | ||||||||||||||
| 1682 | 0 | $xfer += $output->writeSetBegin(Thrift::TType::I32, scalar(@{$self->{newset}})); | |||||||||||||
| 1683 | { | ||||||||||||||
| 1684 | 0 | foreach my $iter107 (@{$self->{newset}}) | |||||||||||||
| 1685 | { | ||||||||||||||
| 1686 | 0 | $xfer += $output->writeI32($iter107); | |||||||||||||
| 1687 | } | ||||||||||||||
| 1688 | } | ||||||||||||||
| 1689 | 0 | $xfer += $output->writeSetEnd(); | |||||||||||||
| 1690 | } | ||||||||||||||
| 1691 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1692 | } | ||||||||||||||
| 1693 | 0 | ▶ | if (defined $self->{newmap}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1694 | 0 | $xfer += $output->writeFieldBegin('newmap', Thrift::TType::MAP, 10); | |||||||||||||
| 1695 | { | ||||||||||||||
| 1696 | 0 | $xfer += $output->writeMapBegin(Thrift::TType::I32, Thrift::TType::I32, scalar(keys %{$self->{newmap}})); | |||||||||||||
| 1697 | { | ||||||||||||||
| 1698 | 0 | ▶ | while( my ($kiter108,$viter109) = each %{$self->{newmap}}) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1699 | { | ||||||||||||||
| 1700 | 0 | $xfer += $output->writeI32($kiter108); | |||||||||||||
| 1701 | 0 | $xfer += $output->writeI32($viter109); | |||||||||||||
| 1702 | } | ||||||||||||||
| 1703 | } | ||||||||||||||
| 1704 | 0 | $xfer += $output->writeMapEnd(); | |||||||||||||
| 1705 | } | ||||||||||||||
| 1706 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1707 | } | ||||||||||||||
| 1708 | 0 | ▶ | if (defined $self->{newstring}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1709 | 0 | $xfer += $output->writeFieldBegin('newstring', Thrift::TType::STRING, 11); | |||||||||||||
| 1710 | 0 | $xfer += $output->writeString($self->{newstring}); | |||||||||||||
| 1711 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1712 | } | ||||||||||||||
| 1713 | 0 | ▶ | if (defined $self->{end_in_both}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1714 | 0 | $xfer += $output->writeFieldBegin('end_in_both', Thrift::TType::I32, 12); | |||||||||||||
| 1715 | 0 | $xfer += $output->writeI32($self->{end_in_both}); | |||||||||||||
| 1716 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1717 | } | ||||||||||||||
| 1718 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 1719 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 1720 | 0 | return $xfer; | |||||||||||||
| 1721 | } | ||||||||||||||
| 1722 | |||||||||||||||
| 1723 | package ThriftTest::ListTypeVersioningV1; | ||||||||||||||
| 1724 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 1725 | 2 | ThriftTest::ListTypeVersioningV1->mk_accessors( qw( myints hello ) ); | |||||||||||||
| 1726 | |||||||||||||||
| 1727 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
| |||||||||||||||
| 1728 | 0 | my $classname = shift; | |||||||||||||
| 1729 | 0 | my $self = {}; | |||||||||||||
| 1730 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 1731 | 0 | $self->{myints} = undef; | |||||||||||||
| 1732 | 0 | $self->{hello} = undef; | |||||||||||||
| 1733 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1734 | 0 | ▶ | if (defined $vals->{myints}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1735 | 0 | $self->{myints} = $vals->{myints}; | |||||||||||||
| 1736 | } | ||||||||||||||
| 1737 | 0 | ▶ | if (defined $vals->{hello}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1738 | 0 | $self->{hello} = $vals->{hello}; | |||||||||||||
| 1739 | } | ||||||||||||||
| 1740 | } | ||||||||||||||
| 1741 | 0 | return bless ($self, $classname); | |||||||||||||
| 1742 | } | ||||||||||||||
| 1743 | |||||||||||||||
| 1744 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 1745 | 0 | return 'ListTypeVersioningV1'; | |||||||||||||
| 1746 | } | ||||||||||||||
| 1747 | |||||||||||||||
| 1748 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=8 SCAR=42.8
| |||||||||||||||
| 1749 | 0 | my ($self, $input) = @_; | |||||||||||||
| 1750 | 0 | my $xfer = 0; | |||||||||||||
| 1751 | 0 | my $fname; | |||||||||||||
| 1752 | 0 | my $ftype = 0; | |||||||||||||
| 1753 | 0 | my $fid = 0; | |||||||||||||
| 1754 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 1755 | 0 | while (1) | |||||||||||||
| 1756 | { | ||||||||||||||
| 1757 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 1758 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1759 | 0 | last; | |||||||||||||
| 1760 | } | ||||||||||||||
| 1761 | 0 | SWITCH: for($fid) | |||||||||||||
| 1762 | { | ||||||||||||||
| 1763 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::LIST) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1764 | { | ||||||||||||||
| 1765 | 0 | my $_size110 = 0; | |||||||||||||
| 1766 | 0 | $self->{myints} = []; | |||||||||||||
| 1767 | 0 | my $_etype113 = 0; | |||||||||||||
| 1768 | 0 | $xfer += $input->readListBegin(\$_etype113, \$_size110); | |||||||||||||
| 1769 | 0 | ▶ | for (my $_i114 = 0; $_i114 < $_size110; ++$_i114) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1770 | { | ||||||||||||||
| 1771 | 0 | my $elem115 = undef; | |||||||||||||
| 1772 | 0 | $xfer += $input->readI32(\$elem115); | |||||||||||||
| 1773 | 0 | push(@{$self->{myints}},$elem115); | |||||||||||||
| 1774 | } | ||||||||||||||
| 1775 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 1776 | } | ||||||||||||||
| 1777 | } else { | ||||||||||||||
| 1778 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1779 | } | ||||||||||||||
| 1780 | 0 | last; }; | |||||||||||||
| 1781 | 0 | ▶ | /^2$/ && do{ if ($ftype == Thrift::TType::STRING) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1782 | 0 | $xfer += $input->readString(\$self->{hello}); | |||||||||||||
| 1783 | } else { | ||||||||||||||
| 1784 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1785 | } | ||||||||||||||
| 1786 | 0 | last; }; | |||||||||||||
| 1787 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1788 | } | ||||||||||||||
| 1789 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 1790 | } | ||||||||||||||
| 1791 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 1792 | 0 | return $xfer; | |||||||||||||
| 1793 | } | ||||||||||||||
| 1794 | |||||||||||||||
| 1795 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=4 SCAR=30.0
| |||||||||||||||
| 1796 | 0 | my ($self, $output) = @_; | |||||||||||||
| 1797 | 0 | my $xfer = 0; | |||||||||||||
| 1798 | 0 | $xfer += $output->writeStructBegin('ListTypeVersioningV1'); | |||||||||||||
| 1799 | 0 | ▶ | if (defined $self->{myints}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1800 | 0 | $xfer += $output->writeFieldBegin('myints', Thrift::TType::LIST, 1); | |||||||||||||
| 1801 | { | ||||||||||||||
| 1802 | 0 | $xfer += $output->writeListBegin(Thrift::TType::I32, scalar(@{$self->{myints}})); | |||||||||||||
| 1803 | { | ||||||||||||||
| 1804 | 0 | foreach my $iter116 (@{$self->{myints}}) | |||||||||||||
| 1805 | { | ||||||||||||||
| 1806 | 0 | $xfer += $output->writeI32($iter116); | |||||||||||||
| 1807 | } | ||||||||||||||
| 1808 | } | ||||||||||||||
| 1809 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 1810 | } | ||||||||||||||
| 1811 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1812 | } | ||||||||||||||
| 1813 | 0 | ▶ | if (defined $self->{hello}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1814 | 0 | $xfer += $output->writeFieldBegin('hello', Thrift::TType::STRING, 2); | |||||||||||||
| 1815 | 0 | $xfer += $output->writeString($self->{hello}); | |||||||||||||
| 1816 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1817 | } | ||||||||||||||
| 1818 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 1819 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 1820 | 0 | return $xfer; | |||||||||||||
| 1821 | } | ||||||||||||||
| 1822 | |||||||||||||||
| 1823 | package ThriftTest::ListTypeVersioningV2; | ||||||||||||||
| 1824 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 1825 | 2 | ThriftTest::ListTypeVersioningV2->mk_accessors( qw( strings hello ) ); | |||||||||||||
| 1826 | |||||||||||||||
| 1827 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
| |||||||||||||||
| 1828 | 0 | my $classname = shift; | |||||||||||||
| 1829 | 0 | my $self = {}; | |||||||||||||
| 1830 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 1831 | 0 | $self->{strings} = undef; | |||||||||||||
| 1832 | 0 | $self->{hello} = undef; | |||||||||||||
| 1833 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1834 | 0 | ▶ | if (defined $vals->{strings}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1835 | 0 | $self->{strings} = $vals->{strings}; | |||||||||||||
| 1836 | } | ||||||||||||||
| 1837 | 0 | ▶ | if (defined $vals->{hello}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1838 | 0 | $self->{hello} = $vals->{hello}; | |||||||||||||
| 1839 | } | ||||||||||||||
| 1840 | } | ||||||||||||||
| 1841 | 0 | return bless ($self, $classname); | |||||||||||||
| 1842 | } | ||||||||||||||
| 1843 | |||||||||||||||
| 1844 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 1845 | 0 | return 'ListTypeVersioningV2'; | |||||||||||||
| 1846 | } | ||||||||||||||
| 1847 | |||||||||||||||
| 1848 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=8 SCAR=42.8
| |||||||||||||||
| 1849 | 0 | my ($self, $input) = @_; | |||||||||||||
| 1850 | 0 | my $xfer = 0; | |||||||||||||
| 1851 | 0 | my $fname; | |||||||||||||
| 1852 | 0 | my $ftype = 0; | |||||||||||||
| 1853 | 0 | my $fid = 0; | |||||||||||||
| 1854 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 1855 | 0 | while (1) | |||||||||||||
| 1856 | { | ||||||||||||||
| 1857 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 1858 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1859 | 0 | last; | |||||||||||||
| 1860 | } | ||||||||||||||
| 1861 | 0 | SWITCH: for($fid) | |||||||||||||
| 1862 | { | ||||||||||||||
| 1863 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::LIST) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1864 | { | ||||||||||||||
| 1865 | 0 | my $_size117 = 0; | |||||||||||||
| 1866 | 0 | $self->{strings} = []; | |||||||||||||
| 1867 | 0 | my $_etype120 = 0; | |||||||||||||
| 1868 | 0 | $xfer += $input->readListBegin(\$_etype120, \$_size117); | |||||||||||||
| 1869 | 0 | ▶ | for (my $_i121 = 0; $_i121 < $_size117; ++$_i121) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1870 | { | ||||||||||||||
| 1871 | 0 | my $elem122 = undef; | |||||||||||||
| 1872 | 0 | $xfer += $input->readString(\$elem122); | |||||||||||||
| 1873 | 0 | push(@{$self->{strings}},$elem122); | |||||||||||||
| 1874 | } | ||||||||||||||
| 1875 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 1876 | } | ||||||||||||||
| 1877 | } else { | ||||||||||||||
| 1878 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1879 | } | ||||||||||||||
| 1880 | 0 | last; }; | |||||||||||||
| 1881 | 0 | ▶ | /^2$/ && do{ if ($ftype == Thrift::TType::STRING) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1882 | 0 | $xfer += $input->readString(\$self->{hello}); | |||||||||||||
| 1883 | } else { | ||||||||||||||
| 1884 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1885 | } | ||||||||||||||
| 1886 | 0 | last; }; | |||||||||||||
| 1887 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1888 | } | ||||||||||||||
| 1889 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 1890 | } | ||||||||||||||
| 1891 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 1892 | 0 | return $xfer; | |||||||||||||
| 1893 | } | ||||||||||||||
| 1894 | |||||||||||||||
| 1895 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=4 SCAR=30.0
| |||||||||||||||
| 1896 | 0 | my ($self, $output) = @_; | |||||||||||||
| 1897 | 0 | my $xfer = 0; | |||||||||||||
| 1898 | 0 | $xfer += $output->writeStructBegin('ListTypeVersioningV2'); | |||||||||||||
| 1899 | 0 | ▶ | if (defined $self->{strings}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1900 | 0 | $xfer += $output->writeFieldBegin('strings', Thrift::TType::LIST, 1); | |||||||||||||
| 1901 | { | ||||||||||||||
| 1902 | 0 | $xfer += $output->writeListBegin(Thrift::TType::STRING, scalar(@{$self->{strings}})); | |||||||||||||
| 1903 | { | ||||||||||||||
| 1904 | 0 | foreach my $iter123 (@{$self->{strings}}) | |||||||||||||
| 1905 | { | ||||||||||||||
| 1906 | 0 | $xfer += $output->writeString($iter123); | |||||||||||||
| 1907 | } | ||||||||||||||
| 1908 | } | ||||||||||||||
| 1909 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 1910 | } | ||||||||||||||
| 1911 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1912 | } | ||||||||||||||
| 1913 | 0 | ▶ | if (defined $self->{hello}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1914 | 0 | $xfer += $output->writeFieldBegin('hello', Thrift::TType::STRING, 2); | |||||||||||||
| 1915 | 0 | $xfer += $output->writeString($self->{hello}); | |||||||||||||
| 1916 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 1917 | } | ||||||||||||||
| 1918 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 1919 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 1920 | 0 | return $xfer; | |||||||||||||
| 1921 | } | ||||||||||||||
| 1922 | |||||||||||||||
| 1923 | package ThriftTest::GuessProtocolStruct; | ||||||||||||||
| 1924 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 1925 | 2 | ThriftTest::GuessProtocolStruct->mk_accessors( qw( map_field ) ); | |||||||||||||
| 1926 | |||||||||||||||
| 1927 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=4 SCAR=30.0
| |||||||||||||||
| 1928 | 0 | my $classname = shift; | |||||||||||||
| 1929 | 0 | my $self = {}; | |||||||||||||
| 1930 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 1931 | 0 | $self->{map_field} = undef; | |||||||||||||
| 1932 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1933 | 0 | ▶ | if (defined $vals->{map_field}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1934 | 0 | $self->{map_field} = $vals->{map_field}; | |||||||||||||
| 1935 | } | ||||||||||||||
| 1936 | } | ||||||||||||||
| 1937 | 0 | return bless ($self, $classname); | |||||||||||||
| 1938 | } | ||||||||||||||
| 1939 | |||||||||||||||
| 1940 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 1941 | 0 | return 'GuessProtocolStruct'; | |||||||||||||
| 1942 | } | ||||||||||||||
| 1943 | |||||||||||||||
| 1944 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=6 SCAR=37.4
| |||||||||||||||
| 1945 | 0 | my ($self, $input) = @_; | |||||||||||||
| 1946 | 0 | my $xfer = 0; | |||||||||||||
| 1947 | 0 | my $fname; | |||||||||||||
| 1948 | 0 | my $ftype = 0; | |||||||||||||
| 1949 | 0 | my $fid = 0; | |||||||||||||
| 1950 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 1951 | 0 | while (1) | |||||||||||||
| 1952 | { | ||||||||||||||
| 1953 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 1954 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1955 | 0 | last; | |||||||||||||
| 1956 | } | ||||||||||||||
| 1957 | 0 | SWITCH: for($fid) | |||||||||||||
| 1958 | { | ||||||||||||||
| 1959 | 0 | ▶ | /^7$/ && do{ if ($ftype == Thrift::TType::MAP) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 1960 | { | ||||||||||||||
| 1961 | 0 | my $_size124 = 0; | |||||||||||||
| 1962 | 0 | $self->{map_field} = {}; | |||||||||||||
| 1963 | 0 | my $_ktype125 = 0; | |||||||||||||
| 1964 | 0 | my $_vtype126 = 0; | |||||||||||||
| 1965 | 0 | $xfer += $input->readMapBegin(\$_ktype125, \$_vtype126, \$_size124); | |||||||||||||
| 1966 | 0 | ▶ | for (my $_i128 = 0; $_i128 < $_size124; ++$_i128) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1967 | { | ||||||||||||||
| 1968 | 0 | my $key129 = ''; | |||||||||||||
| 1969 | 0 | my $val130 = ''; | |||||||||||||
| 1970 | 0 | $xfer += $input->readString(\$key129); | |||||||||||||
| 1971 | 0 | $xfer += $input->readString(\$val130); | |||||||||||||
| 1972 | 0 | $self->{map_field}->{$key129} = $val130; | |||||||||||||
| 1973 | } | ||||||||||||||
| 1974 | 0 | $xfer += $input->readMapEnd(); | |||||||||||||
| 1975 | } | ||||||||||||||
| 1976 | } else { | ||||||||||||||
| 1977 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1978 | } | ||||||||||||||
| 1979 | 0 | last; }; | |||||||||||||
| 1980 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 1981 | } | ||||||||||||||
| 1982 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 1983 | } | ||||||||||||||
| 1984 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 1985 | 0 | return $xfer; | |||||||||||||
| 1986 | } | ||||||||||||||
| 1987 | |||||||||||||||
| 1988 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=3 SCAR=24.8
| |||||||||||||||
| 1989 | 0 | my ($self, $output) = @_; | |||||||||||||
| 1990 | 0 | my $xfer = 0; | |||||||||||||
| 1991 | 0 | $xfer += $output->writeStructBegin('GuessProtocolStruct'); | |||||||||||||
| 1992 | 0 | ▶ | if (defined $self->{map_field}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1993 | 0 | $xfer += $output->writeFieldBegin('map_field', Thrift::TType::MAP, 7); | |||||||||||||
| 1994 | { | ||||||||||||||
| 1995 | 0 | $xfer += $output->writeMapBegin(Thrift::TType::STRING, Thrift::TType::STRING, scalar(keys %{$self->{map_field}})); | |||||||||||||
| 1996 | { | ||||||||||||||
| 1997 | 0 | ▶ | while( my ($kiter131,$viter132) = each %{$self->{map_field}}) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 1998 | { | ||||||||||||||
| 1999 | 0 | $xfer += $output->writeString($kiter131); | |||||||||||||
| 2000 | 0 | $xfer += $output->writeString($viter132); | |||||||||||||
| 2001 | } | ||||||||||||||
| 2002 | } | ||||||||||||||
| 2003 | 0 | $xfer += $output->writeMapEnd(); | |||||||||||||
| 2004 | } | ||||||||||||||
| 2005 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2006 | } | ||||||||||||||
| 2007 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 2008 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 2009 | 0 | return $xfer; | |||||||||||||
| 2010 | } | ||||||||||||||
| 2011 | |||||||||||||||
| 2012 | package ThriftTest::LargeDeltas; | ||||||||||||||
| 2013 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 2014 | 2 | ThriftTest::LargeDeltas->mk_accessors( qw( b1 b10 b100 check_true b1000 check_false vertwo2000 a_set2500 vertwo3000 big_numbers ) ); | |||||||||||||
| 2015 | |||||||||||||||
| 2016 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=13 SCAR=52.0
| |||||||||||||||
| 2017 | 0 | my $classname = shift; | |||||||||||||
| 2018 | 0 | my $self = {}; | |||||||||||||
| 2019 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 2020 | 0 | $self->{b1} = undef; | |||||||||||||
| 2021 | 0 | $self->{b10} = undef; | |||||||||||||
| 2022 | 0 | $self->{b100} = undef; | |||||||||||||
| 2023 | 0 | $self->{check_true} = undef; | |||||||||||||
| 2024 | 0 | $self->{b1000} = undef; | |||||||||||||
| 2025 | 0 | $self->{check_false} = undef; | |||||||||||||
| 2026 | 0 | $self->{vertwo2000} = undef; | |||||||||||||
| 2027 | 0 | $self->{a_set2500} = undef; | |||||||||||||
| 2028 | 0 | $self->{vertwo3000} = undef; | |||||||||||||
| 2029 | 0 | $self->{big_numbers} = undef; | |||||||||||||
| 2030 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2031 | 0 | ▶ | if (defined $vals->{b1}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2032 | 0 | $self->{b1} = $vals->{b1}; | |||||||||||||
| 2033 | } | ||||||||||||||
| 2034 | 0 | ▶ | if (defined $vals->{b10}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2035 | 0 | $self->{b10} = $vals->{b10}; | |||||||||||||
| 2036 | } | ||||||||||||||
| 2037 | 0 | ▶ | if (defined $vals->{b100}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2038 | 0 | $self->{b100} = $vals->{b100}; | |||||||||||||
| 2039 | } | ||||||||||||||
| 2040 | 0 | ▶ | if (defined $vals->{check_true}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2041 | 0 | $self->{check_true} = $vals->{check_true}; | |||||||||||||
| 2042 | } | ||||||||||||||
| 2043 | 0 | ▶ | if (defined $vals->{b1000}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2044 | 0 | $self->{b1000} = $vals->{b1000}; | |||||||||||||
| 2045 | } | ||||||||||||||
| 2046 | 0 | ▶ | if (defined $vals->{check_false}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2047 | 0 | $self->{check_false} = $vals->{check_false}; | |||||||||||||
| 2048 | } | ||||||||||||||
| 2049 | 0 | ▶ | if (defined $vals->{vertwo2000}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2050 | 0 | $self->{vertwo2000} = $vals->{vertwo2000}; | |||||||||||||
| 2051 | } | ||||||||||||||
| 2052 | 0 | ▶ | if (defined $vals->{a_set2500}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2053 | 0 | $self->{a_set2500} = $vals->{a_set2500}; | |||||||||||||
| 2054 | } | ||||||||||||||
| 2055 | 0 | ▶ | if (defined $vals->{vertwo3000}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2056 | 0 | $self->{vertwo3000} = $vals->{vertwo3000}; | |||||||||||||
| 2057 | } | ||||||||||||||
| 2058 | 0 | ▶ | if (defined $vals->{big_numbers}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2059 | 0 | $self->{big_numbers} = $vals->{big_numbers}; | |||||||||||||
| 2060 | } | ||||||||||||||
| 2061 | } | ||||||||||||||
| 2062 | 0 | return bless ($self, $classname); | |||||||||||||
| 2063 | } | ||||||||||||||
| 2064 | |||||||||||||||
| 2065 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 2066 | 0 | return 'LargeDeltas'; | |||||||||||||
| 2067 | } | ||||||||||||||
| 2068 | |||||||||||||||
| 2069 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=25 SCAR=64.8
| |||||||||||||||
| 2070 | 0 | my ($self, $input) = @_; | |||||||||||||
| 2071 | 0 | my $xfer = 0; | |||||||||||||
| 2072 | 0 | my $fname; | |||||||||||||
| 2073 | 0 | my $ftype = 0; | |||||||||||||
| 2074 | 0 | my $fid = 0; | |||||||||||||
| 2075 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 2076 | 0 | while (1) | |||||||||||||
| 2077 | { | ||||||||||||||
| 2078 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 2079 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2080 | 0 | last; | |||||||||||||
| 2081 | } | ||||||||||||||
| 2082 | 0 | SWITCH: for($fid) | |||||||||||||
| 2083 | { | ||||||||||||||
| 2084 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::STRUCT) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2085 | 0 | $self->{b1} = ThriftTest::Bools->new(); | |||||||||||||
| 2086 | 0 | $xfer += $self->{b1}->read($input); | |||||||||||||
| 2087 | } else { | ||||||||||||||
| 2088 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2089 | } | ||||||||||||||
| 2090 | 0 | last; }; | |||||||||||||
| 2091 | 0 | ▶ | /^10$/ && do{ if ($ftype == Thrift::TType::STRUCT) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2092 | 0 | $self->{b10} = ThriftTest::Bools->new(); | |||||||||||||
| 2093 | 0 | $xfer += $self->{b10}->read($input); | |||||||||||||
| 2094 | } else { | ||||||||||||||
| 2095 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2096 | } | ||||||||||||||
| 2097 | 0 | last; }; | |||||||||||||
| 2098 | 0 | ▶ | /^100$/ && do{ if ($ftype == Thrift::TType::STRUCT) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2099 | 0 | $self->{b100} = ThriftTest::Bools->new(); | |||||||||||||
| 2100 | 0 | $xfer += $self->{b100}->read($input); | |||||||||||||
| 2101 | } else { | ||||||||||||||
| 2102 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2103 | } | ||||||||||||||
| 2104 | 0 | last; }; | |||||||||||||
| 2105 | 0 | ▶ | /^500$/ && do{ if ($ftype == Thrift::TType::BOOL) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2106 | 0 | $xfer += $input->readBool(\$self->{check_true}); | |||||||||||||
| 2107 | } else { | ||||||||||||||
| 2108 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2109 | } | ||||||||||||||
| 2110 | 0 | last; }; | |||||||||||||
| 2111 | 0 | ▶ | /^1000$/ && do{ if ($ftype == Thrift::TType::STRUCT) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2112 | 0 | $self->{b1000} = ThriftTest::Bools->new(); | |||||||||||||
| 2113 | 0 | $xfer += $self->{b1000}->read($input); | |||||||||||||
| 2114 | } else { | ||||||||||||||
| 2115 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2116 | } | ||||||||||||||
| 2117 | 0 | last; }; | |||||||||||||
| 2118 | 0 | ▶ | /^1500$/ && do{ if ($ftype == Thrift::TType::BOOL) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2119 | 0 | $xfer += $input->readBool(\$self->{check_false}); | |||||||||||||
| 2120 | } else { | ||||||||||||||
| 2121 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2122 | } | ||||||||||||||
| 2123 | 0 | last; }; | |||||||||||||
| 2124 | 0 | ▶ | /^2000$/ && do{ if ($ftype == Thrift::TType::STRUCT) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2125 | 0 | $self->{vertwo2000} = ThriftTest::VersioningTestV2->new(); | |||||||||||||
| 2126 | 0 | $xfer += $self->{vertwo2000}->read($input); | |||||||||||||
| 2127 | } else { | ||||||||||||||
| 2128 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2129 | } | ||||||||||||||
| 2130 | 0 | last; }; | |||||||||||||
| 2131 | 0 | ▶ | /^2500$/ && do{ if ($ftype == Thrift::TType::SET) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2132 | { | ||||||||||||||
| 2133 | 0 | my $_size133 = 0; | |||||||||||||
| 2134 | 0 | $self->{a_set2500} = {}; | |||||||||||||
| 2135 | 0 | my $_etype136 = 0; | |||||||||||||
| 2136 | 0 | $xfer += $input->readSetBegin(\$_etype136, \$_size133); | |||||||||||||
| 2137 | 0 | ▶ | for (my $_i137 = 0; $_i137 < $_size133; ++$_i137) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2138 | { | ||||||||||||||
| 2139 | 0 | my $elem138 = undef; | |||||||||||||
| 2140 | 0 | $xfer += $input->readString(\$elem138); | |||||||||||||
| 2141 | 0 | $self->{a_set2500}->{$elem138} = 1; | |||||||||||||
| 2142 | } | ||||||||||||||
| 2143 | 0 | $xfer += $input->readSetEnd(); | |||||||||||||
| 2144 | } | ||||||||||||||
| 2145 | } else { | ||||||||||||||
| 2146 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2147 | } | ||||||||||||||
| 2148 | 0 | last; }; | |||||||||||||
| 2149 | 0 | ▶ | /^3000$/ && do{ if ($ftype == Thrift::TType::STRUCT) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2150 | 0 | $self->{vertwo3000} = ThriftTest::VersioningTestV2->new(); | |||||||||||||
| 2151 | 0 | $xfer += $self->{vertwo3000}->read($input); | |||||||||||||
| 2152 | } else { | ||||||||||||||
| 2153 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2154 | } | ||||||||||||||
| 2155 | 0 | last; }; | |||||||||||||
| 2156 | 0 | ▶ | /^4000$/ && do{ if ($ftype == Thrift::TType::LIST) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2157 | { | ||||||||||||||
| 2158 | 0 | my $_size139 = 0; | |||||||||||||
| 2159 | 0 | $self->{big_numbers} = []; | |||||||||||||
| 2160 | 0 | my $_etype142 = 0; | |||||||||||||
| 2161 | 0 | $xfer += $input->readListBegin(\$_etype142, \$_size139); | |||||||||||||
| 2162 | 0 | ▶ | for (my $_i143 = 0; $_i143 < $_size139; ++$_i143) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2163 | { | ||||||||||||||
| 2164 | 0 | my $elem144 = undef; | |||||||||||||
| 2165 | 0 | $xfer += $input->readI32(\$elem144); | |||||||||||||
| 2166 | 0 | push(@{$self->{big_numbers}},$elem144); | |||||||||||||
| 2167 | } | ||||||||||||||
| 2168 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 2169 | } | ||||||||||||||
| 2170 | } else { | ||||||||||||||
| 2171 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2172 | } | ||||||||||||||
| 2173 | 0 | last; }; | |||||||||||||
| 2174 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2175 | } | ||||||||||||||
| 2176 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 2177 | } | ||||||||||||||
| 2178 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 2179 | 0 | return $xfer; | |||||||||||||
| 2180 | } | ||||||||||||||
| 2181 | |||||||||||||||
| 2182 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=13 SCAR=52.0
| |||||||||||||||
| 2183 | 0 | my ($self, $output) = @_; | |||||||||||||
| 2184 | 0 | my $xfer = 0; | |||||||||||||
| 2185 | 0 | $xfer += $output->writeStructBegin('LargeDeltas'); | |||||||||||||
| 2186 | 0 | ▶ | if (defined $self->{b1}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2187 | 0 | $xfer += $output->writeFieldBegin('b1', Thrift::TType::STRUCT, 1); | |||||||||||||
| 2188 | 0 | $xfer += $self->{b1}->write($output); | |||||||||||||
| 2189 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2190 | } | ||||||||||||||
| 2191 | 0 | ▶ | if (defined $self->{b10}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2192 | 0 | $xfer += $output->writeFieldBegin('b10', Thrift::TType::STRUCT, 10); | |||||||||||||
| 2193 | 0 | $xfer += $self->{b10}->write($output); | |||||||||||||
| 2194 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2195 | } | ||||||||||||||
| 2196 | 0 | ▶ | if (defined $self->{b100}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2197 | 0 | $xfer += $output->writeFieldBegin('b100', Thrift::TType::STRUCT, 100); | |||||||||||||
| 2198 | 0 | $xfer += $self->{b100}->write($output); | |||||||||||||
| 2199 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2200 | } | ||||||||||||||
| 2201 | 0 | ▶ | if (defined $self->{check_true}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2202 | 0 | $xfer += $output->writeFieldBegin('check_true', Thrift::TType::BOOL, 500); | |||||||||||||
| 2203 | 0 | $xfer += $output->writeBool($self->{check_true}); | |||||||||||||
| 2204 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2205 | } | ||||||||||||||
| 2206 | 0 | ▶ | if (defined $self->{b1000}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2207 | 0 | $xfer += $output->writeFieldBegin('b1000', Thrift::TType::STRUCT, 1000); | |||||||||||||
| 2208 | 0 | $xfer += $self->{b1000}->write($output); | |||||||||||||
| 2209 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2210 | } | ||||||||||||||
| 2211 | 0 | ▶ | if (defined $self->{check_false}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2212 | 0 | $xfer += $output->writeFieldBegin('check_false', Thrift::TType::BOOL, 1500); | |||||||||||||
| 2213 | 0 | $xfer += $output->writeBool($self->{check_false}); | |||||||||||||
| 2214 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2215 | } | ||||||||||||||
| 2216 | 0 | ▶ | if (defined $self->{vertwo2000}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2217 | 0 | $xfer += $output->writeFieldBegin('vertwo2000', Thrift::TType::STRUCT, 2000); | |||||||||||||
| 2218 | 0 | $xfer += $self->{vertwo2000}->write($output); | |||||||||||||
| 2219 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2220 | } | ||||||||||||||
| 2221 | 0 | ▶ | if (defined $self->{a_set2500}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2222 | 0 | $xfer += $output->writeFieldBegin('a_set2500', Thrift::TType::SET, 2500); | |||||||||||||
| 2223 | { | ||||||||||||||
| 2224 | 0 | $xfer += $output->writeSetBegin(Thrift::TType::STRING, scalar(@{$self->{a_set2500}})); | |||||||||||||
| 2225 | { | ||||||||||||||
| 2226 | 0 | foreach my $iter145 (@{$self->{a_set2500}}) | |||||||||||||
| 2227 | { | ||||||||||||||
| 2228 | 0 | $xfer += $output->writeString($iter145); | |||||||||||||
| 2229 | } | ||||||||||||||
| 2230 | } | ||||||||||||||
| 2231 | 0 | $xfer += $output->writeSetEnd(); | |||||||||||||
| 2232 | } | ||||||||||||||
| 2233 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2234 | } | ||||||||||||||
| 2235 | 0 | ▶ | if (defined $self->{vertwo3000}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2236 | 0 | $xfer += $output->writeFieldBegin('vertwo3000', Thrift::TType::STRUCT, 3000); | |||||||||||||
| 2237 | 0 | $xfer += $self->{vertwo3000}->write($output); | |||||||||||||
| 2238 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2239 | } | ||||||||||||||
| 2240 | 0 | ▶ | if (defined $self->{big_numbers}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2241 | 0 | $xfer += $output->writeFieldBegin('big_numbers', Thrift::TType::LIST, 4000); | |||||||||||||
| 2242 | { | ||||||||||||||
| 2243 | 0 | $xfer += $output->writeListBegin(Thrift::TType::I32, scalar(@{$self->{big_numbers}})); | |||||||||||||
| 2244 | { | ||||||||||||||
| 2245 | 0 | foreach my $iter146 (@{$self->{big_numbers}}) | |||||||||||||
| 2246 | { | ||||||||||||||
| 2247 | 0 | $xfer += $output->writeI32($iter146); | |||||||||||||
| 2248 | } | ||||||||||||||
| 2249 | } | ||||||||||||||
| 2250 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 2251 | } | ||||||||||||||
| 2252 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2253 | } | ||||||||||||||
| 2254 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 2255 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 2256 | 0 | return $xfer; | |||||||||||||
| 2257 | } | ||||||||||||||
| 2258 | |||||||||||||||
| 2259 | package ThriftTest::NestedListsI32x2; | ||||||||||||||
| 2260 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 2261 | 2 | ThriftTest::NestedListsI32x2->mk_accessors( qw( integerlist ) ); | |||||||||||||
| 2262 | |||||||||||||||
| 2263 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=4 SCAR=30.0
| |||||||||||||||
| 2264 | 0 | my $classname = shift; | |||||||||||||
| 2265 | 0 | my $self = {}; | |||||||||||||
| 2266 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 2267 | 0 | $self->{integerlist} = undef; | |||||||||||||
| 2268 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2269 | 0 | ▶ | if (defined $vals->{integerlist}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2270 | 0 | $self->{integerlist} = $vals->{integerlist}; | |||||||||||||
| 2271 | } | ||||||||||||||
| 2272 | } | ||||||||||||||
| 2273 | 0 | return bless ($self, $classname); | |||||||||||||
| 2274 | } | ||||||||||||||
| 2275 | |||||||||||||||
| 2276 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 2277 | 0 | return 'NestedListsI32x2'; | |||||||||||||
| 2278 | } | ||||||||||||||
| 2279 | |||||||||||||||
| 2280 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=7 SCAR=40.3
| |||||||||||||||
| 2281 | 0 | my ($self, $input) = @_; | |||||||||||||
| 2282 | 0 | my $xfer = 0; | |||||||||||||
| 2283 | 0 | my $fname; | |||||||||||||
| 2284 | 0 | my $ftype = 0; | |||||||||||||
| 2285 | 0 | my $fid = 0; | |||||||||||||
| 2286 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 2287 | 0 | while (1) | |||||||||||||
| 2288 | { | ||||||||||||||
| 2289 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 2290 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2291 | 0 | last; | |||||||||||||
| 2292 | } | ||||||||||||||
| 2293 | 0 | SWITCH: for($fid) | |||||||||||||
| 2294 | { | ||||||||||||||
| 2295 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::LIST) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2296 | { | ||||||||||||||
| 2297 | 0 | my $_size147 = 0; | |||||||||||||
| 2298 | 0 | $self->{integerlist} = []; | |||||||||||||
| 2299 | 0 | my $_etype150 = 0; | |||||||||||||
| 2300 | 0 | $xfer += $input->readListBegin(\$_etype150, \$_size147); | |||||||||||||
| 2301 | 0 | ▶ | for (my $_i151 = 0; $_i151 < $_size147; ++$_i151) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2302 | { | ||||||||||||||
| 2303 | 0 | my $elem152 = undef; | |||||||||||||
| 2304 | { | ||||||||||||||
| 2305 | 0 | my $_size153 = 0; | |||||||||||||
| 2306 | 0 | $elem152 = []; | |||||||||||||
| 2307 | 0 | my $_etype156 = 0; | |||||||||||||
| 2308 | 0 | $xfer += $input->readListBegin(\$_etype156, \$_size153); | |||||||||||||
| 2309 | 0 | ▶ | for (my $_i157 = 0; $_i157 < $_size153; ++$_i157) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2310 | { | ||||||||||||||
| 2311 | 0 | my $elem158 = undef; | |||||||||||||
| 2312 | 0 | $xfer += $input->readI32(\$elem158); | |||||||||||||
| 2313 | 0 | push(@{$elem152},$elem158); | |||||||||||||
| 2314 | } | ||||||||||||||
| 2315 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 2316 | } | ||||||||||||||
| 2317 | 0 | push(@{$self->{integerlist}},$elem152); | |||||||||||||
| 2318 | } | ||||||||||||||
| 2319 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 2320 | } | ||||||||||||||
| 2321 | } else { | ||||||||||||||
| 2322 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2323 | } | ||||||||||||||
| 2324 | 0 | last; }; | |||||||||||||
| 2325 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2326 | } | ||||||||||||||
| 2327 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 2328 | } | ||||||||||||||
| 2329 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 2330 | 0 | return $xfer; | |||||||||||||
| 2331 | } | ||||||||||||||
| 2332 | |||||||||||||||
| 2333 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=4 SCAR=30.0
| |||||||||||||||
| 2334 | 0 | my ($self, $output) = @_; | |||||||||||||
| 2335 | 0 | my $xfer = 0; | |||||||||||||
| 2336 | 0 | $xfer += $output->writeStructBegin('NestedListsI32x2'); | |||||||||||||
| 2337 | 0 | ▶ | if (defined $self->{integerlist}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2338 | 0 | $xfer += $output->writeFieldBegin('integerlist', Thrift::TType::LIST, 1); | |||||||||||||
| 2339 | { | ||||||||||||||
| 2340 | 0 | $xfer += $output->writeListBegin(Thrift::TType::LIST, scalar(@{$self->{integerlist}})); | |||||||||||||
| 2341 | { | ||||||||||||||
| 2342 | 0 | foreach my $iter159 (@{$self->{integerlist}}) | |||||||||||||
| 2343 | { | ||||||||||||||
| 2344 | { | ||||||||||||||
| 2345 | 0 | $xfer += $output->writeListBegin(Thrift::TType::I32, scalar(@{${iter159}})); | |||||||||||||
| 2346 | { | ||||||||||||||
| 2347 | 0 | foreach my $iter160 (@{${iter159}}) | |||||||||||||
| 2348 | { | ||||||||||||||
| 2349 | 0 | $xfer += $output->writeI32($iter160); | |||||||||||||
| 2350 | } | ||||||||||||||
| 2351 | } | ||||||||||||||
| 2352 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 2353 | } | ||||||||||||||
| 2354 | } | ||||||||||||||
| 2355 | } | ||||||||||||||
| 2356 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 2357 | } | ||||||||||||||
| 2358 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2359 | } | ||||||||||||||
| 2360 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 2361 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 2362 | 0 | return $xfer; | |||||||||||||
| 2363 | } | ||||||||||||||
| 2364 | |||||||||||||||
| 2365 | package ThriftTest::NestedListsI32x3; | ||||||||||||||
| 2366 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 2367 | 2 | ThriftTest::NestedListsI32x3->mk_accessors( qw( integerlist ) ); | |||||||||||||
| 2368 | |||||||||||||||
| 2369 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=4 SCAR=30.0
| |||||||||||||||
| 2370 | 0 | my $classname = shift; | |||||||||||||
| 2371 | 0 | my $self = {}; | |||||||||||||
| 2372 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 2373 | 0 | $self->{integerlist} = undef; | |||||||||||||
| 2374 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2375 | 0 | ▶ | if (defined $vals->{integerlist}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2376 | 0 | $self->{integerlist} = $vals->{integerlist}; | |||||||||||||
| 2377 | } | ||||||||||||||
| 2378 | } | ||||||||||||||
| 2379 | 0 | return bless ($self, $classname); | |||||||||||||
| 2380 | } | ||||||||||||||
| 2381 | |||||||||||||||
| 2382 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 2383 | 0 | return 'NestedListsI32x3'; | |||||||||||||
| 2384 | } | ||||||||||||||
| 2385 | |||||||||||||||
| 2386 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=8 SCAR=42.8
| |||||||||||||||
| 2387 | 0 | my ($self, $input) = @_; | |||||||||||||
| 2388 | 0 | my $xfer = 0; | |||||||||||||
| 2389 | 0 | my $fname; | |||||||||||||
| 2390 | 0 | my $ftype = 0; | |||||||||||||
| 2391 | 0 | my $fid = 0; | |||||||||||||
| 2392 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 2393 | 0 | while (1) | |||||||||||||
| 2394 | { | ||||||||||||||
| 2395 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 2396 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2397 | 0 | last; | |||||||||||||
| 2398 | } | ||||||||||||||
| 2399 | 0 | SWITCH: for($fid) | |||||||||||||
| 2400 | { | ||||||||||||||
| 2401 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::LIST) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2402 | { | ||||||||||||||
| 2403 | 0 | my $_size161 = 0; | |||||||||||||
| 2404 | 0 | $self->{integerlist} = []; | |||||||||||||
| 2405 | 0 | my $_etype164 = 0; | |||||||||||||
| 2406 | 0 | $xfer += $input->readListBegin(\$_etype164, \$_size161); | |||||||||||||
| 2407 | 0 | ▶ | for (my $_i165 = 0; $_i165 < $_size161; ++$_i165) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2408 | { | ||||||||||||||
| 2409 | 0 | my $elem166 = undef; | |||||||||||||
| 2410 | { | ||||||||||||||
| 2411 | 0 | my $_size167 = 0; | |||||||||||||
| 2412 | 0 | $elem166 = []; | |||||||||||||
| 2413 | 0 | my $_etype170 = 0; | |||||||||||||
| 2414 | 0 | $xfer += $input->readListBegin(\$_etype170, \$_size167); | |||||||||||||
| 2415 | 0 | ▶ | for (my $_i171 = 0; $_i171 < $_size167; ++$_i171) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2416 | { | ||||||||||||||
| 2417 | 0 | my $elem172 = undef; | |||||||||||||
| 2418 | { | ||||||||||||||
| 2419 | 0 | my $_size173 = 0; | |||||||||||||
| 2420 | 0 | $elem172 = []; | |||||||||||||
| 2421 | 0 | my $_etype176 = 0; | |||||||||||||
| 2422 | 0 | $xfer += $input->readListBegin(\$_etype176, \$_size173); | |||||||||||||
| 2423 | 0 | ▶ | for (my $_i177 = 0; $_i177 < $_size173; ++$_i177) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2424 | { | ||||||||||||||
| 2425 | 0 | my $elem178 = undef; | |||||||||||||
| 2426 | 0 | $xfer += $input->readI32(\$elem178); | |||||||||||||
| 2427 | 0 | push(@{$elem172},$elem178); | |||||||||||||
| 2428 | } | ||||||||||||||
| 2429 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 2430 | } | ||||||||||||||
| 2431 | 0 | push(@{$elem166},$elem172); | |||||||||||||
| 2432 | } | ||||||||||||||
| 2433 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 2434 | } | ||||||||||||||
| 2435 | 0 | push(@{$self->{integerlist}},$elem166); | |||||||||||||
| 2436 | } | ||||||||||||||
| 2437 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 2438 | } | ||||||||||||||
| 2439 | } else { | ||||||||||||||
| 2440 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2441 | } | ||||||||||||||
| 2442 | 0 | last; }; | |||||||||||||
| 2443 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2444 | } | ||||||||||||||
| 2445 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 2446 | } | ||||||||||||||
| 2447 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 2448 | 0 | return $xfer; | |||||||||||||
| 2449 | } | ||||||||||||||
| 2450 | |||||||||||||||
| 2451 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=5 SCAR=34.0
| |||||||||||||||
| 2452 | 0 | my ($self, $output) = @_; | |||||||||||||
| 2453 | 0 | my $xfer = 0; | |||||||||||||
| 2454 | 0 | $xfer += $output->writeStructBegin('NestedListsI32x3'); | |||||||||||||
| 2455 | 0 | ▶ | if (defined $self->{integerlist}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2456 | 0 | $xfer += $output->writeFieldBegin('integerlist', Thrift::TType::LIST, 1); | |||||||||||||
| 2457 | { | ||||||||||||||
| 2458 | 0 | $xfer += $output->writeListBegin(Thrift::TType::LIST, scalar(@{$self->{integerlist}})); | |||||||||||||
| 2459 | { | ||||||||||||||
| 2460 | 0 | foreach my $iter179 (@{$self->{integerlist}}) | |||||||||||||
| 2461 | { | ||||||||||||||
| 2462 | { | ||||||||||||||
| 2463 | 0 | $xfer += $output->writeListBegin(Thrift::TType::LIST, scalar(@{${iter179}})); | |||||||||||||
| 2464 | { | ||||||||||||||
| 2465 | 0 | foreach my $iter180 (@{${iter179}}) | |||||||||||||
| 2466 | { | ||||||||||||||
| 2467 | { | ||||||||||||||
| 2468 | 0 | $xfer += $output->writeListBegin(Thrift::TType::I32, scalar(@{${iter180}})); | |||||||||||||
| 2469 | { | ||||||||||||||
| 2470 | 0 | foreach my $iter181 (@{${iter180}}) | |||||||||||||
| 2471 | { | ||||||||||||||
| 2472 | 0 | $xfer += $output->writeI32($iter181); | |||||||||||||
| 2473 | } | ||||||||||||||
| 2474 | } | ||||||||||||||
| 2475 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 2476 | } | ||||||||||||||
| 2477 | } | ||||||||||||||
| 2478 | } | ||||||||||||||
| 2479 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 2480 | } | ||||||||||||||
| 2481 | } | ||||||||||||||
| 2482 | } | ||||||||||||||
| 2483 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 2484 | } | ||||||||||||||
| 2485 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2486 | } | ||||||||||||||
| 2487 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 2488 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 2489 | 0 | return $xfer; | |||||||||||||
| 2490 | } | ||||||||||||||
| 2491 | |||||||||||||||
| 2492 | package ThriftTest::NestedMixedx2; | ||||||||||||||
| 2493 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 2494 | 2 | ThriftTest::NestedMixedx2->mk_accessors( qw( int_set_list map_int_strset map_int_strset_list ) ); | |||||||||||||
| 2495 | |||||||||||||||
| 2496 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=6 SCAR=37.4
| |||||||||||||||
| 2497 | 0 | my $classname = shift; | |||||||||||||
| 2498 | 0 | my $self = {}; | |||||||||||||
| 2499 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 2500 | 0 | $self->{int_set_list} = undef; | |||||||||||||
| 2501 | 0 | $self->{map_int_strset} = undef; | |||||||||||||
| 2502 | 0 | $self->{map_int_strset_list} = undef; | |||||||||||||
| 2503 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2504 | 0 | ▶ | if (defined $vals->{int_set_list}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2505 | 0 | $self->{int_set_list} = $vals->{int_set_list}; | |||||||||||||
| 2506 | } | ||||||||||||||
| 2507 | 0 | ▶ | if (defined $vals->{map_int_strset}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2508 | 0 | $self->{map_int_strset} = $vals->{map_int_strset}; | |||||||||||||
| 2509 | } | ||||||||||||||
| 2510 | 0 | ▶ | if (defined $vals->{map_int_strset_list}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2511 | 0 | $self->{map_int_strset_list} = $vals->{map_int_strset_list}; | |||||||||||||
| 2512 | } | ||||||||||||||
| 2513 | } | ||||||||||||||
| 2514 | 0 | return bless ($self, $classname); | |||||||||||||
| 2515 | } | ||||||||||||||
| 2516 | |||||||||||||||
| 2517 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 2518 | 0 | return 'NestedMixedx2'; | |||||||||||||
| 2519 | } | ||||||||||||||
| 2520 | |||||||||||||||
| 2521 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=16 SCAR=56.1
| |||||||||||||||
| 2522 | 0 | my ($self, $input) = @_; | |||||||||||||
| 2523 | 0 | my $xfer = 0; | |||||||||||||
| 2524 | 0 | my $fname; | |||||||||||||
| 2525 | 0 | my $ftype = 0; | |||||||||||||
| 2526 | 0 | my $fid = 0; | |||||||||||||
| 2527 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 2528 | 0 | while (1) | |||||||||||||
| 2529 | { | ||||||||||||||
| 2530 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 2531 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2532 | 0 | last; | |||||||||||||
| 2533 | } | ||||||||||||||
| 2534 | 0 | SWITCH: for($fid) | |||||||||||||
| 2535 | { | ||||||||||||||
| 2536 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::LIST) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2537 | { | ||||||||||||||
| 2538 | 0 | my $_size182 = 0; | |||||||||||||
| 2539 | 0 | $self->{int_set_list} = []; | |||||||||||||
| 2540 | 0 | my $_etype185 = 0; | |||||||||||||
| 2541 | 0 | $xfer += $input->readListBegin(\$_etype185, \$_size182); | |||||||||||||
| 2542 | 0 | ▶ | for (my $_i186 = 0; $_i186 < $_size182; ++$_i186) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2543 | { | ||||||||||||||
| 2544 | 0 | my $elem187 = undef; | |||||||||||||
| 2545 | { | ||||||||||||||
| 2546 | 0 | my $_size188 = 0; | |||||||||||||
| 2547 | 0 | $elem187 = {}; | |||||||||||||
| 2548 | 0 | my $_etype191 = 0; | |||||||||||||
| 2549 | 0 | $xfer += $input->readSetBegin(\$_etype191, \$_size188); | |||||||||||||
| 2550 | 0 | ▶ | for (my $_i192 = 0; $_i192 < $_size188; ++$_i192) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2551 | { | ||||||||||||||
| 2552 | 0 | my $elem193 = undef; | |||||||||||||
| 2553 | 0 | $xfer += $input->readI32(\$elem193); | |||||||||||||
| 2554 | 0 | $elem187->{$elem193} = 1; | |||||||||||||
| 2555 | } | ||||||||||||||
| 2556 | 0 | $xfer += $input->readSetEnd(); | |||||||||||||
| 2557 | } | ||||||||||||||
| 2558 | 0 | push(@{$self->{int_set_list}},$elem187); | |||||||||||||
| 2559 | } | ||||||||||||||
| 2560 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 2561 | } | ||||||||||||||
| 2562 | } else { | ||||||||||||||
| 2563 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2564 | } | ||||||||||||||
| 2565 | 0 | last; }; | |||||||||||||
| 2566 | 0 | ▶ | /^2$/ && do{ if ($ftype == Thrift::TType::MAP) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2567 | { | ||||||||||||||
| 2568 | 0 | my $_size194 = 0; | |||||||||||||
| 2569 | 0 | $self->{map_int_strset} = {}; | |||||||||||||
| 2570 | 0 | my $_ktype195 = 0; | |||||||||||||
| 2571 | 0 | my $_vtype196 = 0; | |||||||||||||
| 2572 | 0 | $xfer += $input->readMapBegin(\$_ktype195, \$_vtype196, \$_size194); | |||||||||||||
| 2573 | 0 | ▶ | for (my $_i198 = 0; $_i198 < $_size194; ++$_i198) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2574 | { | ||||||||||||||
| 2575 | 0 | my $key199 = 0; | |||||||||||||
| 2576 | 0 | my $val200 = []; | |||||||||||||
| 2577 | 0 | $xfer += $input->readI32(\$key199); | |||||||||||||
| 2578 | { | ||||||||||||||
| 2579 | 0 | my $_size201 = 0; | |||||||||||||
| 2580 | 0 | $val200 = {}; | |||||||||||||
| 2581 | 0 | my $_etype204 = 0; | |||||||||||||
| 2582 | 0 | $xfer += $input->readSetBegin(\$_etype204, \$_size201); | |||||||||||||
| 2583 | 0 | ▶ | for (my $_i205 = 0; $_i205 < $_size201; ++$_i205) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2584 | { | ||||||||||||||
| 2585 | 0 | my $elem206 = undef; | |||||||||||||
| 2586 | 0 | $xfer += $input->readString(\$elem206); | |||||||||||||
| 2587 | 0 | $val200->{$elem206} = 1; | |||||||||||||
| 2588 | } | ||||||||||||||
| 2589 | 0 | $xfer += $input->readSetEnd(); | |||||||||||||
| 2590 | } | ||||||||||||||
| 2591 | 0 | $self->{map_int_strset}->{$key199} = $val200; | |||||||||||||
| 2592 | } | ||||||||||||||
| 2593 | 0 | $xfer += $input->readMapEnd(); | |||||||||||||
| 2594 | } | ||||||||||||||
| 2595 | } else { | ||||||||||||||
| 2596 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2597 | } | ||||||||||||||
| 2598 | 0 | last; }; | |||||||||||||
| 2599 | 0 | ▶ | /^3$/ && do{ if ($ftype == Thrift::TType::LIST) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2600 | { | ||||||||||||||
| 2601 | 0 | my $_size207 = 0; | |||||||||||||
| 2602 | 0 | $self->{map_int_strset_list} = []; | |||||||||||||
| 2603 | 0 | my $_etype210 = 0; | |||||||||||||
| 2604 | 0 | $xfer += $input->readListBegin(\$_etype210, \$_size207); | |||||||||||||
| 2605 | 0 | ▶ | for (my $_i211 = 0; $_i211 < $_size207; ++$_i211) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2606 | { | ||||||||||||||
| 2607 | 0 | my $elem212 = undef; | |||||||||||||
| 2608 | { | ||||||||||||||
| 2609 | 0 | my $_size213 = 0; | |||||||||||||
| 2610 | 0 | $elem212 = {}; | |||||||||||||
| 2611 | 0 | my $_ktype214 = 0; | |||||||||||||
| 2612 | 0 | my $_vtype215 = 0; | |||||||||||||
| 2613 | 0 | $xfer += $input->readMapBegin(\$_ktype214, \$_vtype215, \$_size213); | |||||||||||||
| 2614 | 0 | ▶ | for (my $_i217 = 0; $_i217 < $_size213; ++$_i217) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2615 | { | ||||||||||||||
| 2616 | 0 | my $key218 = 0; | |||||||||||||
| 2617 | 0 | my $val219 = []; | |||||||||||||
| 2618 | 0 | $xfer += $input->readI32(\$key218); | |||||||||||||
| 2619 | { | ||||||||||||||
| 2620 | 0 | my $_size220 = 0; | |||||||||||||
| 2621 | 0 | $val219 = {}; | |||||||||||||
| 2622 | 0 | my $_etype223 = 0; | |||||||||||||
| 2623 | 0 | $xfer += $input->readSetBegin(\$_etype223, \$_size220); | |||||||||||||
| 2624 | 0 | ▶ | for (my $_i224 = 0; $_i224 < $_size220; ++$_i224) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2625 | { | ||||||||||||||
| 2626 | 0 | my $elem225 = undef; | |||||||||||||
| 2627 | 0 | $xfer += $input->readString(\$elem225); | |||||||||||||
| 2628 | 0 | $val219->{$elem225} = 1; | |||||||||||||
| 2629 | } | ||||||||||||||
| 2630 | 0 | $xfer += $input->readSetEnd(); | |||||||||||||
| 2631 | } | ||||||||||||||
| 2632 | 0 | $elem212->{$key218} = $val219; | |||||||||||||
| 2633 | } | ||||||||||||||
| 2634 | 0 | $xfer += $input->readMapEnd(); | |||||||||||||
| 2635 | } | ||||||||||||||
| 2636 | 0 | push(@{$self->{map_int_strset_list}},$elem212); | |||||||||||||
| 2637 | } | ||||||||||||||
| 2638 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 2639 | } | ||||||||||||||
| 2640 | } else { | ||||||||||||||
| 2641 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2642 | } | ||||||||||||||
| 2643 | 0 | last; }; | |||||||||||||
| 2644 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2645 | } | ||||||||||||||
| 2646 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 2647 | } | ||||||||||||||
| 2648 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 2649 | 0 | return $xfer; | |||||||||||||
| 2650 | } | ||||||||||||||
| 2651 | |||||||||||||||
| 2652 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=11 SCAR=48.8
| |||||||||||||||
| 2653 | 0 | my ($self, $output) = @_; | |||||||||||||
| 2654 | 0 | my $xfer = 0; | |||||||||||||
| 2655 | 0 | $xfer += $output->writeStructBegin('NestedMixedx2'); | |||||||||||||
| 2656 | 0 | ▶ | if (defined $self->{int_set_list}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2657 | 0 | $xfer += $output->writeFieldBegin('int_set_list', Thrift::TType::LIST, 1); | |||||||||||||
| 2658 | { | ||||||||||||||
| 2659 | 0 | $xfer += $output->writeListBegin(Thrift::TType::SET, scalar(@{$self->{int_set_list}})); | |||||||||||||
| 2660 | { | ||||||||||||||
| 2661 | 0 | foreach my $iter226 (@{$self->{int_set_list}}) | |||||||||||||
| 2662 | { | ||||||||||||||
| 2663 | { | ||||||||||||||
| 2664 | 0 | $xfer += $output->writeSetBegin(Thrift::TType::I32, scalar(@{${iter226}})); | |||||||||||||
| 2665 | { | ||||||||||||||
| 2666 | 0 | foreach my $iter227 (@{${iter226}}) | |||||||||||||
| 2667 | { | ||||||||||||||
| 2668 | 0 | $xfer += $output->writeI32($iter227); | |||||||||||||
| 2669 | } | ||||||||||||||
| 2670 | } | ||||||||||||||
| 2671 | 0 | $xfer += $output->writeSetEnd(); | |||||||||||||
| 2672 | } | ||||||||||||||
| 2673 | } | ||||||||||||||
| 2674 | } | ||||||||||||||
| 2675 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 2676 | } | ||||||||||||||
| 2677 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2678 | } | ||||||||||||||
| 2679 | 0 | ▶ | if (defined $self->{map_int_strset}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2680 | 0 | $xfer += $output->writeFieldBegin('map_int_strset', Thrift::TType::MAP, 2); | |||||||||||||
| 2681 | { | ||||||||||||||
| 2682 | 0 | $xfer += $output->writeMapBegin(Thrift::TType::I32, Thrift::TType::SET, scalar(keys %{$self->{map_int_strset}})); | |||||||||||||
| 2683 | { | ||||||||||||||
| 2684 | 0 | ▶ | while( my ($kiter228,$viter229) = each %{$self->{map_int_strset}}) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2685 | { | ||||||||||||||
| 2686 | 0 | $xfer += $output->writeI32($kiter228); | |||||||||||||
| 2687 | { | ||||||||||||||
| 2688 | 0 | $xfer += $output->writeSetBegin(Thrift::TType::STRING, scalar(@{${viter229}})); | |||||||||||||
| 2689 | { | ||||||||||||||
| 2690 | 0 | foreach my $iter230 (@{${viter229}}) | |||||||||||||
| 2691 | { | ||||||||||||||
| 2692 | 0 | $xfer += $output->writeString($iter230); | |||||||||||||
| 2693 | } | ||||||||||||||
| 2694 | } | ||||||||||||||
| 2695 | 0 | $xfer += $output->writeSetEnd(); | |||||||||||||
| 2696 | } | ||||||||||||||
| 2697 | } | ||||||||||||||
| 2698 | } | ||||||||||||||
| 2699 | 0 | $xfer += $output->writeMapEnd(); | |||||||||||||
| 2700 | } | ||||||||||||||
| 2701 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2702 | } | ||||||||||||||
| 2703 | 0 | ▶ | if (defined $self->{map_int_strset_list}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2704 | 0 | $xfer += $output->writeFieldBegin('map_int_strset_list', Thrift::TType::LIST, 3); | |||||||||||||
| 2705 | { | ||||||||||||||
| 2706 | 0 | $xfer += $output->writeListBegin(Thrift::TType::MAP, scalar(@{$self->{map_int_strset_list}})); | |||||||||||||
| 2707 | { | ||||||||||||||
| 2708 | 0 | foreach my $iter231 (@{$self->{map_int_strset_list}}) | |||||||||||||
| 2709 | { | ||||||||||||||
| 2710 | { | ||||||||||||||
| 2711 | 0 | $xfer += $output->writeMapBegin(Thrift::TType::I32, Thrift::TType::SET, scalar(keys %{${iter231}})); | |||||||||||||
| 2712 | { | ||||||||||||||
| 2713 | 0 | ▶ | while( my ($kiter232,$viter233) = each %{${iter231}}) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2714 | { | ||||||||||||||
| 2715 | 0 | $xfer += $output->writeI32($kiter232); | |||||||||||||
| 2716 | { | ||||||||||||||
| 2717 | 0 | $xfer += $output->writeSetBegin(Thrift::TType::STRING, scalar(@{${viter233}})); | |||||||||||||
| 2718 | { | ||||||||||||||
| 2719 | 0 | foreach my $iter234 (@{${viter233}}) | |||||||||||||
| 2720 | { | ||||||||||||||
| 2721 | 0 | $xfer += $output->writeString($iter234); | |||||||||||||
| 2722 | } | ||||||||||||||
| 2723 | } | ||||||||||||||
| 2724 | 0 | $xfer += $output->writeSetEnd(); | |||||||||||||
| 2725 | } | ||||||||||||||
| 2726 | } | ||||||||||||||
| 2727 | } | ||||||||||||||
| 2728 | 0 | $xfer += $output->writeMapEnd(); | |||||||||||||
| 2729 | } | ||||||||||||||
| 2730 | } | ||||||||||||||
| 2731 | } | ||||||||||||||
| 2732 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 2733 | } | ||||||||||||||
| 2734 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2735 | } | ||||||||||||||
| 2736 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 2737 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 2738 | 0 | return $xfer; | |||||||||||||
| 2739 | } | ||||||||||||||
| 2740 | |||||||||||||||
| 2741 | package ThriftTest::ListBonks; | ||||||||||||||
| 2742 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 2743 | 2 | ThriftTest::ListBonks->mk_accessors( qw( bonk ) ); | |||||||||||||
| 2744 | |||||||||||||||
| 2745 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=4 SCAR=30.0
| |||||||||||||||
| 2746 | 0 | my $classname = shift; | |||||||||||||
| 2747 | 0 | my $self = {}; | |||||||||||||
| 2748 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 2749 | 0 | $self->{bonk} = undef; | |||||||||||||
| 2750 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2751 | 0 | ▶ | if (defined $vals->{bonk}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2752 | 0 | $self->{bonk} = $vals->{bonk}; | |||||||||||||
| 2753 | } | ||||||||||||||
| 2754 | } | ||||||||||||||
| 2755 | 0 | return bless ($self, $classname); | |||||||||||||
| 2756 | } | ||||||||||||||
| 2757 | |||||||||||||||
| 2758 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 2759 | 0 | return 'ListBonks'; | |||||||||||||
| 2760 | } | ||||||||||||||
| 2761 | |||||||||||||||
| 2762 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=6 SCAR=37.4
| |||||||||||||||
| 2763 | 0 | my ($self, $input) = @_; | |||||||||||||
| 2764 | 0 | my $xfer = 0; | |||||||||||||
| 2765 | 0 | my $fname; | |||||||||||||
| 2766 | 0 | my $ftype = 0; | |||||||||||||
| 2767 | 0 | my $fid = 0; | |||||||||||||
| 2768 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 2769 | 0 | while (1) | |||||||||||||
| 2770 | { | ||||||||||||||
| 2771 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 2772 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2773 | 0 | last; | |||||||||||||
| 2774 | } | ||||||||||||||
| 2775 | 0 | SWITCH: for($fid) | |||||||||||||
| 2776 | { | ||||||||||||||
| 2777 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::LIST) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2778 | { | ||||||||||||||
| 2779 | 0 | my $_size235 = 0; | |||||||||||||
| 2780 | 0 | $self->{bonk} = []; | |||||||||||||
| 2781 | 0 | my $_etype238 = 0; | |||||||||||||
| 2782 | 0 | $xfer += $input->readListBegin(\$_etype238, \$_size235); | |||||||||||||
| 2783 | 0 | ▶ | for (my $_i239 = 0; $_i239 < $_size235; ++$_i239) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2784 | { | ||||||||||||||
| 2785 | 0 | my $elem240 = undef; | |||||||||||||
| 2786 | 0 | $elem240 = ThriftTest::Bonk->new(); | |||||||||||||
| 2787 | 0 | $xfer += $elem240->read($input); | |||||||||||||
| 2788 | 0 | push(@{$self->{bonk}},$elem240); | |||||||||||||
| 2789 | } | ||||||||||||||
| 2790 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 2791 | } | ||||||||||||||
| 2792 | } else { | ||||||||||||||
| 2793 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2794 | } | ||||||||||||||
| 2795 | 0 | last; }; | |||||||||||||
| 2796 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2797 | } | ||||||||||||||
| 2798 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 2799 | } | ||||||||||||||
| 2800 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 2801 | 0 | return $xfer; | |||||||||||||
| 2802 | } | ||||||||||||||
| 2803 | |||||||||||||||
| 2804 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=3 SCAR=24.8
| |||||||||||||||
| 2805 | 0 | my ($self, $output) = @_; | |||||||||||||
| 2806 | 0 | my $xfer = 0; | |||||||||||||
| 2807 | 0 | $xfer += $output->writeStructBegin('ListBonks'); | |||||||||||||
| 2808 | 0 | ▶ | if (defined $self->{bonk}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2809 | 0 | $xfer += $output->writeFieldBegin('bonk', Thrift::TType::LIST, 1); | |||||||||||||
| 2810 | { | ||||||||||||||
| 2811 | 0 | $xfer += $output->writeListBegin(Thrift::TType::STRUCT, scalar(@{$self->{bonk}})); | |||||||||||||
| 2812 | { | ||||||||||||||
| 2813 | 0 | foreach my $iter241 (@{$self->{bonk}}) | |||||||||||||
| 2814 | { | ||||||||||||||
| 2815 | 0 | $xfer += ${iter241}->write($output); | |||||||||||||
| 2816 | } | ||||||||||||||
| 2817 | } | ||||||||||||||
| 2818 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 2819 | } | ||||||||||||||
| 2820 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2821 | } | ||||||||||||||
| 2822 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 2823 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 2824 | 0 | return $xfer; | |||||||||||||
| 2825 | } | ||||||||||||||
| 2826 | |||||||||||||||
| 2827 | package ThriftTest::NestedListsBonk; | ||||||||||||||
| 2828 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 2829 | 2 | ThriftTest::NestedListsBonk->mk_accessors( qw( bonk ) ); | |||||||||||||
| 2830 | |||||||||||||||
| 2831 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=4 SCAR=30.0
| |||||||||||||||
| 2832 | 0 | my $classname = shift; | |||||||||||||
| 2833 | 0 | my $self = {}; | |||||||||||||
| 2834 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 2835 | 0 | $self->{bonk} = undef; | |||||||||||||
| 2836 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2837 | 0 | ▶ | if (defined $vals->{bonk}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2838 | 0 | $self->{bonk} = $vals->{bonk}; | |||||||||||||
| 2839 | } | ||||||||||||||
| 2840 | } | ||||||||||||||
| 2841 | 0 | return bless ($self, $classname); | |||||||||||||
| 2842 | } | ||||||||||||||
| 2843 | |||||||||||||||
| 2844 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 2845 | 0 | return 'NestedListsBonk'; | |||||||||||||
| 2846 | } | ||||||||||||||
| 2847 | |||||||||||||||
| 2848 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=8 SCAR=42.8
| |||||||||||||||
| 2849 | 0 | my ($self, $input) = @_; | |||||||||||||
| 2850 | 0 | my $xfer = 0; | |||||||||||||
| 2851 | 0 | my $fname; | |||||||||||||
| 2852 | 0 | my $ftype = 0; | |||||||||||||
| 2853 | 0 | my $fid = 0; | |||||||||||||
| 2854 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 2855 | 0 | while (1) | |||||||||||||
| 2856 | { | ||||||||||||||
| 2857 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 2858 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2859 | 0 | last; | |||||||||||||
| 2860 | } | ||||||||||||||
| 2861 | 0 | SWITCH: for($fid) | |||||||||||||
| 2862 | { | ||||||||||||||
| 2863 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::LIST) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2864 | { | ||||||||||||||
| 2865 | 0 | my $_size242 = 0; | |||||||||||||
| 2866 | 0 | $self->{bonk} = []; | |||||||||||||
| 2867 | 0 | my $_etype245 = 0; | |||||||||||||
| 2868 | 0 | $xfer += $input->readListBegin(\$_etype245, \$_size242); | |||||||||||||
| 2869 | 0 | ▶ | for (my $_i246 = 0; $_i246 < $_size242; ++$_i246) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2870 | { | ||||||||||||||
| 2871 | 0 | my $elem247 = undef; | |||||||||||||
| 2872 | { | ||||||||||||||
| 2873 | 0 | my $_size248 = 0; | |||||||||||||
| 2874 | 0 | $elem247 = []; | |||||||||||||
| 2875 | 0 | my $_etype251 = 0; | |||||||||||||
| 2876 | 0 | $xfer += $input->readListBegin(\$_etype251, \$_size248); | |||||||||||||
| 2877 | 0 | ▶ | for (my $_i252 = 0; $_i252 < $_size248; ++$_i252) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2878 | { | ||||||||||||||
| 2879 | 0 | my $elem253 = undef; | |||||||||||||
| 2880 | { | ||||||||||||||
| 2881 | 0 | my $_size254 = 0; | |||||||||||||
| 2882 | 0 | $elem253 = []; | |||||||||||||
| 2883 | 0 | my $_etype257 = 0; | |||||||||||||
| 2884 | 0 | $xfer += $input->readListBegin(\$_etype257, \$_size254); | |||||||||||||
| 2885 | 0 | ▶ | for (my $_i258 = 0; $_i258 < $_size254; ++$_i258) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2886 | { | ||||||||||||||
| 2887 | 0 | my $elem259 = undef; | |||||||||||||
| 2888 | 0 | $elem259 = ThriftTest::Bonk->new(); | |||||||||||||
| 2889 | 0 | $xfer += $elem259->read($input); | |||||||||||||
| 2890 | 0 | push(@{$elem253},$elem259); | |||||||||||||
| 2891 | } | ||||||||||||||
| 2892 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 2893 | } | ||||||||||||||
| 2894 | 0 | push(@{$elem247},$elem253); | |||||||||||||
| 2895 | } | ||||||||||||||
| 2896 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 2897 | } | ||||||||||||||
| 2898 | 0 | push(@{$self->{bonk}},$elem247); | |||||||||||||
| 2899 | } | ||||||||||||||
| 2900 | 0 | $xfer += $input->readListEnd(); | |||||||||||||
| 2901 | } | ||||||||||||||
| 2902 | } else { | ||||||||||||||
| 2903 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2904 | } | ||||||||||||||
| 2905 | 0 | last; }; | |||||||||||||
| 2906 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2907 | } | ||||||||||||||
| 2908 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 2909 | } | ||||||||||||||
| 2910 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 2911 | 0 | return $xfer; | |||||||||||||
| 2912 | } | ||||||||||||||
| 2913 | |||||||||||||||
| 2914 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=5 SCAR=34.0
| |||||||||||||||
| 2915 | 0 | my ($self, $output) = @_; | |||||||||||||
| 2916 | 0 | my $xfer = 0; | |||||||||||||
| 2917 | 0 | $xfer += $output->writeStructBegin('NestedListsBonk'); | |||||||||||||
| 2918 | 0 | ▶ | if (defined $self->{bonk}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2919 | 0 | $xfer += $output->writeFieldBegin('bonk', Thrift::TType::LIST, 1); | |||||||||||||
| 2920 | { | ||||||||||||||
| 2921 | 0 | $xfer += $output->writeListBegin(Thrift::TType::LIST, scalar(@{$self->{bonk}})); | |||||||||||||
| 2922 | { | ||||||||||||||
| 2923 | 0 | foreach my $iter260 (@{$self->{bonk}}) | |||||||||||||
| 2924 | { | ||||||||||||||
| 2925 | { | ||||||||||||||
| 2926 | 0 | $xfer += $output->writeListBegin(Thrift::TType::LIST, scalar(@{${iter260}})); | |||||||||||||
| 2927 | { | ||||||||||||||
| 2928 | 0 | foreach my $iter261 (@{${iter260}}) | |||||||||||||
| 2929 | { | ||||||||||||||
| 2930 | { | ||||||||||||||
| 2931 | 0 | $xfer += $output->writeListBegin(Thrift::TType::STRUCT, scalar(@{${iter261}})); | |||||||||||||
| 2932 | { | ||||||||||||||
| 2933 | 0 | foreach my $iter262 (@{${iter261}}) | |||||||||||||
| 2934 | { | ||||||||||||||
| 2935 | 0 | $xfer += ${iter262}->write($output); | |||||||||||||
| 2936 | } | ||||||||||||||
| 2937 | } | ||||||||||||||
| 2938 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 2939 | } | ||||||||||||||
| 2940 | } | ||||||||||||||
| 2941 | } | ||||||||||||||
| 2942 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 2943 | } | ||||||||||||||
| 2944 | } | ||||||||||||||
| 2945 | } | ||||||||||||||
| 2946 | 0 | $xfer += $output->writeListEnd(); | |||||||||||||
| 2947 | } | ||||||||||||||
| 2948 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 2949 | } | ||||||||||||||
| 2950 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 2951 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 2952 | 0 | return $xfer; | |||||||||||||
| 2953 | } | ||||||||||||||
| 2954 | |||||||||||||||
| 2955 | package ThriftTest::BoolTest; | ||||||||||||||
| 2956 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 2957 | 2 | ThriftTest::BoolTest->mk_accessors( qw( b s ) ); | |||||||||||||
| 2958 | |||||||||||||||
| 2959 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
| |||||||||||||||
| 2960 | 0 | my $classname = shift; | |||||||||||||
| 2961 | 0 | my $self = {}; | |||||||||||||
| 2962 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 2963 | 0 | $self->{b} = 1; | |||||||||||||
| 2964 | 0 | $self->{s} = "true"; | |||||||||||||
| 2965 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2966 | 0 | ▶ | if (defined $vals->{b}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2967 | 0 | $self->{b} = $vals->{b}; | |||||||||||||
| 2968 | } | ||||||||||||||
| 2969 | 0 | ▶ | if (defined $vals->{s}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2970 | 0 | $self->{s} = $vals->{s}; | |||||||||||||
| 2971 | } | ||||||||||||||
| 2972 | } | ||||||||||||||
| 2973 | 0 | return bless ($self, $classname); | |||||||||||||
| 2974 | } | ||||||||||||||
| 2975 | |||||||||||||||
| 2976 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 2977 | 0 | return 'BoolTest'; | |||||||||||||
| 2978 | } | ||||||||||||||
| 2979 | |||||||||||||||
| 2980 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=7 SCAR=40.3
| |||||||||||||||
| 2981 | 0 | my ($self, $input) = @_; | |||||||||||||
| 2982 | 0 | my $xfer = 0; | |||||||||||||
| 2983 | 0 | my $fname; | |||||||||||||
| 2984 | 0 | my $ftype = 0; | |||||||||||||
| 2985 | 0 | my $fid = 0; | |||||||||||||
| 2986 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 2987 | 0 | while (1) | |||||||||||||
| 2988 | { | ||||||||||||||
| 2989 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 2990 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 2991 | 0 | last; | |||||||||||||
| 2992 | } | ||||||||||||||
| 2993 | 0 | SWITCH: for($fid) | |||||||||||||
| 2994 | { | ||||||||||||||
| 2995 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::BOOL) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 2996 | 0 | $xfer += $input->readBool(\$self->{b}); | |||||||||||||
| 2997 | } else { | ||||||||||||||
| 2998 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 2999 | } | ||||||||||||||
| 3000 | 0 | last; }; | |||||||||||||
| 3001 | 0 | ▶ | /^2$/ && do{ if ($ftype == Thrift::TType::STRING) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 3002 | 0 | $xfer += $input->readString(\$self->{s}); | |||||||||||||
| 3003 | } else { | ||||||||||||||
| 3004 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 3005 | } | ||||||||||||||
| 3006 | 0 | last; }; | |||||||||||||
| 3007 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 3008 | } | ||||||||||||||
| 3009 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 3010 | } | ||||||||||||||
| 3011 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 3012 | 0 | return $xfer; | |||||||||||||
| 3013 | } | ||||||||||||||
| 3014 | |||||||||||||||
| 3015 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=3 SCAR=24.8
| |||||||||||||||
| 3016 | 0 | my ($self, $output) = @_; | |||||||||||||
| 3017 | 0 | my $xfer = 0; | |||||||||||||
| 3018 | 0 | $xfer += $output->writeStructBegin('BoolTest'); | |||||||||||||
| 3019 | 0 | ▶ | if (defined $self->{b}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3020 | 0 | $xfer += $output->writeFieldBegin('b', Thrift::TType::BOOL, 1); | |||||||||||||
| 3021 | 0 | $xfer += $output->writeBool($self->{b}); | |||||||||||||
| 3022 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 3023 | } | ||||||||||||||
| 3024 | 0 | ▶ | if (defined $self->{s}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3025 | 0 | $xfer += $output->writeFieldBegin('s', Thrift::TType::STRING, 2); | |||||||||||||
| 3026 | 0 | $xfer += $output->writeString($self->{s}); | |||||||||||||
| 3027 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 3028 | } | ||||||||||||||
| 3029 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 3030 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 3031 | 0 | return $xfer; | |||||||||||||
| 3032 | } | ||||||||||||||
| 3033 | |||||||||||||||
| 3034 | package ThriftTest::StructA; | ||||||||||||||
| 3035 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 3036 | 2 | ThriftTest::StructA->mk_accessors( qw( s ) ); | |||||||||||||
| 3037 | |||||||||||||||
| 3038 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=4 SCAR=30.0
| |||||||||||||||
| 3039 | 0 | my $classname = shift; | |||||||||||||
| 3040 | 0 | my $self = {}; | |||||||||||||
| 3041 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 3042 | 0 | $self->{s} = undef; | |||||||||||||
| 3043 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3044 | 0 | ▶ | if (defined $vals->{s}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3045 | 0 | $self->{s} = $vals->{s}; | |||||||||||||
| 3046 | } | ||||||||||||||
| 3047 | } | ||||||||||||||
| 3048 | 0 | return bless ($self, $classname); | |||||||||||||
| 3049 | } | ||||||||||||||
| 3050 | |||||||||||||||
| 3051 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 3052 | 0 | return 'StructA'; | |||||||||||||
| 3053 | } | ||||||||||||||
| 3054 | |||||||||||||||
| 3055 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=5 SCAR=34.0
| |||||||||||||||
| 3056 | 0 | my ($self, $input) = @_; | |||||||||||||
| 3057 | 0 | my $xfer = 0; | |||||||||||||
| 3058 | 0 | my $fname; | |||||||||||||
| 3059 | 0 | my $ftype = 0; | |||||||||||||
| 3060 | 0 | my $fid = 0; | |||||||||||||
| 3061 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 3062 | 0 | while (1) | |||||||||||||
| 3063 | { | ||||||||||||||
| 3064 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 3065 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3066 | 0 | last; | |||||||||||||
| 3067 | } | ||||||||||||||
| 3068 | 0 | SWITCH: for($fid) | |||||||||||||
| 3069 | { | ||||||||||||||
| 3070 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::STRING) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 3071 | 0 | $xfer += $input->readString(\$self->{s}); | |||||||||||||
| 3072 | } else { | ||||||||||||||
| 3073 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 3074 | } | ||||||||||||||
| 3075 | 0 | last; }; | |||||||||||||
| 3076 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 3077 | } | ||||||||||||||
| 3078 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 3079 | } | ||||||||||||||
| 3080 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 3081 | 0 | return $xfer; | |||||||||||||
| 3082 | } | ||||||||||||||
| 3083 | |||||||||||||||
| 3084 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=2 SCAR=17.9
| |||||||||||||||
| 3085 | 0 | my ($self, $output) = @_; | |||||||||||||
| 3086 | 0 | my $xfer = 0; | |||||||||||||
| 3087 | 0 | $xfer += $output->writeStructBegin('StructA'); | |||||||||||||
| 3088 | 0 | ▶ | if (defined $self->{s}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3089 | 0 | $xfer += $output->writeFieldBegin('s', Thrift::TType::STRING, 1); | |||||||||||||
| 3090 | 0 | $xfer += $output->writeString($self->{s}); | |||||||||||||
| 3091 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 3092 | } | ||||||||||||||
| 3093 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 3094 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 3095 | 0 | return $xfer; | |||||||||||||
| 3096 | } | ||||||||||||||
| 3097 | |||||||||||||||
| 3098 | package ThriftTest::StructB; | ||||||||||||||
| 3099 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 3100 | 2 | ThriftTest::StructB->mk_accessors( qw( aa ab ) ); | |||||||||||||
| 3101 | |||||||||||||||
| 3102 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
| |||||||||||||||
| 3103 | 0 | my $classname = shift; | |||||||||||||
| 3104 | 0 | my $self = {}; | |||||||||||||
| 3105 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 3106 | 0 | $self->{aa} = undef; | |||||||||||||
| 3107 | 0 | $self->{ab} = undef; | |||||||||||||
| 3108 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3109 | 0 | ▶ | if (defined $vals->{aa}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3110 | 0 | $self->{aa} = $vals->{aa}; | |||||||||||||
| 3111 | } | ||||||||||||||
| 3112 | 0 | ▶ | if (defined $vals->{ab}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3113 | 0 | $self->{ab} = $vals->{ab}; | |||||||||||||
| 3114 | } | ||||||||||||||
| 3115 | } | ||||||||||||||
| 3116 | 0 | return bless ($self, $classname); | |||||||||||||
| 3117 | } | ||||||||||||||
| 3118 | |||||||||||||||
| 3119 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 3120 | 0 | return 'StructB'; | |||||||||||||
| 3121 | } | ||||||||||||||
| 3122 | |||||||||||||||
| 3123 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=7 SCAR=40.3
| |||||||||||||||
| 3124 | 0 | my ($self, $input) = @_; | |||||||||||||
| 3125 | 0 | my $xfer = 0; | |||||||||||||
| 3126 | 0 | my $fname; | |||||||||||||
| 3127 | 0 | my $ftype = 0; | |||||||||||||
| 3128 | 0 | my $fid = 0; | |||||||||||||
| 3129 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 3130 | 0 | while (1) | |||||||||||||
| 3131 | { | ||||||||||||||
| 3132 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 3133 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3134 | 0 | last; | |||||||||||||
| 3135 | } | ||||||||||||||
| 3136 | 0 | SWITCH: for($fid) | |||||||||||||
| 3137 | { | ||||||||||||||
| 3138 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::STRUCT) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 3139 | 0 | $self->{aa} = ThriftTest::StructA->new(); | |||||||||||||
| 3140 | 0 | $xfer += $self->{aa}->read($input); | |||||||||||||
| 3141 | } else { | ||||||||||||||
| 3142 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 3143 | } | ||||||||||||||
| 3144 | 0 | last; }; | |||||||||||||
| 3145 | 0 | ▶ | /^2$/ && do{ if ($ftype == Thrift::TType::STRUCT) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 3146 | 0 | $self->{ab} = ThriftTest::StructA->new(); | |||||||||||||
| 3147 | 0 | $xfer += $self->{ab}->read($input); | |||||||||||||
| 3148 | } else { | ||||||||||||||
| 3149 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 3150 | } | ||||||||||||||
| 3151 | 0 | last; }; | |||||||||||||
| 3152 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 3153 | } | ||||||||||||||
| 3154 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 3155 | } | ||||||||||||||
| 3156 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 3157 | 0 | return $xfer; | |||||||||||||
| 3158 | } | ||||||||||||||
| 3159 | |||||||||||||||
| 3160 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=3 SCAR=24.8
| |||||||||||||||
| 3161 | 0 | my ($self, $output) = @_; | |||||||||||||
| 3162 | 0 | my $xfer = 0; | |||||||||||||
| 3163 | 0 | $xfer += $output->writeStructBegin('StructB'); | |||||||||||||
| 3164 | 0 | ▶ | if (defined $self->{aa}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3165 | 0 | $xfer += $output->writeFieldBegin('aa', Thrift::TType::STRUCT, 1); | |||||||||||||
| 3166 | 0 | $xfer += $self->{aa}->write($output); | |||||||||||||
| 3167 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 3168 | } | ||||||||||||||
| 3169 | 0 | ▶ | if (defined $self->{ab}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3170 | 0 | $xfer += $output->writeFieldBegin('ab', Thrift::TType::STRUCT, 2); | |||||||||||||
| 3171 | 0 | $xfer += $self->{ab}->write($output); | |||||||||||||
| 3172 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 3173 | } | ||||||||||||||
| 3174 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 3175 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 3176 | 0 | return $xfer; | |||||||||||||
| 3177 | } | ||||||||||||||
| 3178 | |||||||||||||||
| 3179 | package ThriftTest::OptionalSetDefaultTest; | ||||||||||||||
| 3180 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 3181 | 2 | ThriftTest::OptionalSetDefaultTest->mk_accessors( qw( with_default ) ); | |||||||||||||
| 3182 | |||||||||||||||
| 3183 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=4 SCAR=30.0
| |||||||||||||||
| 3184 | 0 | my $classname = shift; | |||||||||||||
| 3185 | 0 | my $self = {}; | |||||||||||||
| 3186 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 3187 | $self->{with_default} = [ | ||||||||||||||
| 3188 | 0 | "test" => 1, | |||||||||||||
| 3189 | ]; | ||||||||||||||
| 3190 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3191 | 0 | ▶ | if (defined $vals->{with_default}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3192 | 0 | $self->{with_default} = $vals->{with_default}; | |||||||||||||
| 3193 | } | ||||||||||||||
| 3194 | } | ||||||||||||||
| 3195 | 0 | return bless ($self, $classname); | |||||||||||||
| 3196 | } | ||||||||||||||
| 3197 | |||||||||||||||
| 3198 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 3199 | 0 | return 'OptionalSetDefaultTest'; | |||||||||||||
| 3200 | } | ||||||||||||||
| 3201 | |||||||||||||||
| 3202 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=6 SCAR=37.4
| |||||||||||||||
| 3203 | 0 | my ($self, $input) = @_; | |||||||||||||
| 3204 | 0 | my $xfer = 0; | |||||||||||||
| 3205 | 0 | my $fname; | |||||||||||||
| 3206 | 0 | my $ftype = 0; | |||||||||||||
| 3207 | 0 | my $fid = 0; | |||||||||||||
| 3208 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 3209 | 0 | while (1) | |||||||||||||
| 3210 | { | ||||||||||||||
| 3211 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 3212 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3213 | 0 | last; | |||||||||||||
| 3214 | } | ||||||||||||||
| 3215 | 0 | SWITCH: for($fid) | |||||||||||||
| 3216 | { | ||||||||||||||
| 3217 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::SET) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 3218 | { | ||||||||||||||
| 3219 | 0 | my $_size263 = 0; | |||||||||||||
| 3220 | 0 | $self->{with_default} = {}; | |||||||||||||
| 3221 | 0 | my $_etype266 = 0; | |||||||||||||
| 3222 | 0 | $xfer += $input->readSetBegin(\$_etype266, \$_size263); | |||||||||||||
| 3223 | 0 | ▶ | for (my $_i267 = 0; $_i267 < $_size263; ++$_i267) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3224 | { | ||||||||||||||
| 3225 | 0 | my $elem268 = undef; | |||||||||||||
| 3226 | 0 | $xfer += $input->readString(\$elem268); | |||||||||||||
| 3227 | 0 | $self->{with_default}->{$elem268} = 1; | |||||||||||||
| 3228 | } | ||||||||||||||
| 3229 | 0 | $xfer += $input->readSetEnd(); | |||||||||||||
| 3230 | } | ||||||||||||||
| 3231 | } else { | ||||||||||||||
| 3232 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 3233 | } | ||||||||||||||
| 3234 | 0 | last; }; | |||||||||||||
| 3235 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 3236 | } | ||||||||||||||
| 3237 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 3238 | } | ||||||||||||||
| 3239 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 3240 | 0 | return $xfer; | |||||||||||||
| 3241 | } | ||||||||||||||
| 3242 | |||||||||||||||
| 3243 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=3 SCAR=24.8
| |||||||||||||||
| 3244 | 0 | my ($self, $output) = @_; | |||||||||||||
| 3245 | 0 | my $xfer = 0; | |||||||||||||
| 3246 | 0 | $xfer += $output->writeStructBegin('OptionalSetDefaultTest'); | |||||||||||||
| 3247 | 0 | ▶ | if (defined $self->{with_default}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3248 | 0 | $xfer += $output->writeFieldBegin('with_default', Thrift::TType::SET, 1); | |||||||||||||
| 3249 | { | ||||||||||||||
| 3250 | 0 | $xfer += $output->writeSetBegin(Thrift::TType::STRING, scalar(@{$self->{with_default}})); | |||||||||||||
| 3251 | { | ||||||||||||||
| 3252 | 0 | foreach my $iter269 (@{$self->{with_default}}) | |||||||||||||
| 3253 | { | ||||||||||||||
| 3254 | 0 | $xfer += $output->writeString($iter269); | |||||||||||||
| 3255 | } | ||||||||||||||
| 3256 | } | ||||||||||||||
| 3257 | 0 | $xfer += $output->writeSetEnd(); | |||||||||||||
| 3258 | } | ||||||||||||||
| 3259 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 3260 | } | ||||||||||||||
| 3261 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 3262 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 3263 | 0 | return $xfer; | |||||||||||||
| 3264 | } | ||||||||||||||
| 3265 | |||||||||||||||
| 3266 | package ThriftTest::OptionalBinary; | ||||||||||||||
| 3267 | 2 | ▶ | use base qw(Class::Accessor); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 3268 | 2 | ThriftTest::OptionalBinary->mk_accessors( qw( bin_set bin_map ) ); | |||||||||||||
| 3269 | |||||||||||||||
| 3270 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
| |||||||||||||||
| 3271 | 0 | my $classname = shift; | |||||||||||||
| 3272 | 0 | my $self = {}; | |||||||||||||
| 3273 | 0 | ▶ | my $vals = shift || {}; | ||||||||||||
|
Condition0%0/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||
| 3274 | $self->{bin_set} = [ | ||||||||||||||
| 3275 | 0 | ]; | |||||||||||||
| 3276 | $self->{bin_map} = { | ||||||||||||||
| 3277 | 0 | }; | |||||||||||||
| 3278 | 0 | ▶ | if (UNIVERSAL::isa($vals,'HASH')) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3279 | 0 | ▶ | if (defined $vals->{bin_set}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3280 | 0 | $self->{bin_set} = $vals->{bin_set}; | |||||||||||||
| 3281 | } | ||||||||||||||
| 3282 | 0 | ▶ | if (defined $vals->{bin_map}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3283 | 0 | $self->{bin_map} = $vals->{bin_map}; | |||||||||||||
| 3284 | } | ||||||||||||||
| 3285 | } | ||||||||||||||
| 3286 | 0 | return bless ($self, $classname); | |||||||||||||
| 3287 | } | ||||||||||||||
| 3288 | |||||||||||||||
| 3289 | 0 | ▶ | sub getName { | ||||||||||||
|
Subroutine
getName: not called CC=1 SCAR=6.9
| |||||||||||||||
| 3290 | 0 | return 'OptionalBinary'; | |||||||||||||
| 3291 | } | ||||||||||||||
| 3292 | |||||||||||||||
| 3293 | 0 | ▶ | sub read { | ||||||||||||
|
Subroutine
read: not called CC=9 SCAR=45.0
| |||||||||||||||
| 3294 | 0 | my ($self, $input) = @_; | |||||||||||||
| 3295 | 0 | my $xfer = 0; | |||||||||||||
| 3296 | 0 | my $fname; | |||||||||||||
| 3297 | 0 | my $ftype = 0; | |||||||||||||
| 3298 | 0 | my $fid = 0; | |||||||||||||
| 3299 | 0 | $xfer += $input->readStructBegin(\$fname); | |||||||||||||
| 3300 | 0 | while (1) | |||||||||||||
| 3301 | { | ||||||||||||||
| 3302 | 0 | $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); | |||||||||||||
| 3303 | 0 | ▶ | if ($ftype == Thrift::TType::STOP) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3304 | 0 | last; | |||||||||||||
| 3305 | } | ||||||||||||||
| 3306 | 0 | SWITCH: for($fid) | |||||||||||||
| 3307 | { | ||||||||||||||
| 3308 | 0 | ▶ | /^1$/ && do{ if ($ftype == Thrift::TType::SET) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 3309 | { | ||||||||||||||
| 3310 | 0 | my $_size270 = 0; | |||||||||||||
| 3311 | 0 | $self->{bin_set} = {}; | |||||||||||||
| 3312 | 0 | my $_etype273 = 0; | |||||||||||||
| 3313 | 0 | $xfer += $input->readSetBegin(\$_etype273, \$_size270); | |||||||||||||
| 3314 | 0 | ▶ | for (my $_i274 = 0; $_i274 < $_size270; ++$_i274) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3315 | { | ||||||||||||||
| 3316 | 0 | my $elem275 = undef; | |||||||||||||
| 3317 | 0 | $xfer += $input->readString(\$elem275); | |||||||||||||
| 3318 | 0 | $self->{bin_set}->{$elem275} = 1; | |||||||||||||
| 3319 | } | ||||||||||||||
| 3320 | 0 | $xfer += $input->readSetEnd(); | |||||||||||||
| 3321 | } | ||||||||||||||
| 3322 | } else { | ||||||||||||||
| 3323 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 3324 | } | ||||||||||||||
| 3325 | 0 | last; }; | |||||||||||||
| 3326 | 0 | ▶ | /^2$/ && do{ if ($ftype == Thrift::TType::MAP) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 3327 | { | ||||||||||||||
| 3328 | 0 | my $_size276 = 0; | |||||||||||||
| 3329 | 0 | $self->{bin_map} = {}; | |||||||||||||
| 3330 | 0 | my $_ktype277 = 0; | |||||||||||||
| 3331 | 0 | my $_vtype278 = 0; | |||||||||||||
| 3332 | 0 | $xfer += $input->readMapBegin(\$_ktype277, \$_vtype278, \$_size276); | |||||||||||||
| 3333 | 0 | ▶ | for (my $_i280 = 0; $_i280 < $_size276; ++$_i280) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3334 | { | ||||||||||||||
| 3335 | 0 | my $key281 = ''; | |||||||||||||
| 3336 | 0 | my $val282 = 0; | |||||||||||||
| 3337 | 0 | $xfer += $input->readString(\$key281); | |||||||||||||
| 3338 | 0 | $xfer += $input->readI32(\$val282); | |||||||||||||
| 3339 | 0 | $self->{bin_map}->{$key281} = $val282; | |||||||||||||
| 3340 | } | ||||||||||||||
| 3341 | 0 | $xfer += $input->readMapEnd(); | |||||||||||||
| 3342 | } | ||||||||||||||
| 3343 | } else { | ||||||||||||||
| 3344 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 3345 | } | ||||||||||||||
| 3346 | 0 | last; }; | |||||||||||||
| 3347 | 0 | $xfer += $input->skip($ftype); | |||||||||||||
| 3348 | } | ||||||||||||||
| 3349 | 0 | $xfer += $input->readFieldEnd(); | |||||||||||||
| 3350 | } | ||||||||||||||
| 3351 | 0 | $xfer += $input->readStructEnd(); | |||||||||||||
| 3352 | 0 | return $xfer; | |||||||||||||
| 3353 | } | ||||||||||||||
| 3354 | |||||||||||||||
| 3355 | 0 | ▶ | sub write { | ||||||||||||
|
Subroutine
write: not called CC=5 SCAR=34.0
| |||||||||||||||
| 3356 | 0 | my ($self, $output) = @_; | |||||||||||||
| 3357 | 0 | my $xfer = 0; | |||||||||||||
| 3358 | 0 | $xfer += $output->writeStructBegin('OptionalBinary'); | |||||||||||||
| 3359 | 0 | ▶ | if (defined $self->{bin_set}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3360 | 0 | $xfer += $output->writeFieldBegin('bin_set', Thrift::TType::SET, 1); | |||||||||||||
| 3361 | { | ||||||||||||||
| 3362 | 0 | $xfer += $output->writeSetBegin(Thrift::TType::STRING, scalar(@{$self->{bin_set}})); | |||||||||||||
| 3363 | { | ||||||||||||||
| 3364 | 0 | foreach my $iter283 (@{$self->{bin_set}}) | |||||||||||||
| 3365 | { | ||||||||||||||
| 3366 | 0 | $xfer += $output->writeString($iter283); | |||||||||||||
| 3367 | } | ||||||||||||||
| 3368 | } | ||||||||||||||
| 3369 | 0 | $xfer += $output->writeSetEnd(); | |||||||||||||
| 3370 | } | ||||||||||||||
| 3371 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 3372 | } | ||||||||||||||
| 3373 | 0 | ▶ | if (defined $self->{bin_map}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3374 | 0 | $xfer += $output->writeFieldBegin('bin_map', Thrift::TType::MAP, 2); | |||||||||||||
| 3375 | { | ||||||||||||||
| 3376 | 0 | $xfer += $output->writeMapBegin(Thrift::TType::STRING, Thrift::TType::I32, scalar(keys %{$self->{bin_map}})); | |||||||||||||
| 3377 | { | ||||||||||||||
| 3378 | 0 | ▶ | while( my ($kiter284,$viter285) = each %{$self->{bin_map}}) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 3379 | { | ||||||||||||||
| 3380 | 0 | $xfer += $output->writeString($kiter284); | |||||||||||||
| 3381 | 0 | $xfer += $output->writeI32($viter285); | |||||||||||||
| 3382 | } | ||||||||||||||
| 3383 | } | ||||||||||||||
| 3384 | 0 | $xfer += $output->writeMapEnd(); | |||||||||||||
| 3385 | } | ||||||||||||||
| 3386 | 0 | $xfer += $output->writeFieldEnd(); | |||||||||||||
| 3387 | } | ||||||||||||||
| 3388 | 0 | $xfer += $output->writeFieldStop(); | |||||||||||||
| 3389 | 0 | $xfer += $output->writeStructEnd(); | |||||||||||||
| 3390 | 0 | return $xfer; | |||||||||||||
| 3391 | } | ||||||||||||||
| 3392 | |||||||||||||||
| 3393 | 2 | 1; | |||||||||||||