File Coverage

xs/Packer.xs
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine n/a
pod n/a
total 9 9 100.0


line stmt bran cond sub pod time code
1             MODULE = MsgPack::Raw PACKAGE = MsgPack::Raw::Packer
2              
3             Packer
4             new (class)
5             SV *class
6              
7             PREINIT:
8             msgpack_raw_packer *self;
9              
10             CODE:
11 15           Newxz (self, 1, msgpack_raw_packer);
12 15           msgpack_packer_init (&self->packer, self, msgpack_raw_packer_write);
13              
14 15           RETVAL = self;
15              
16             OUTPUT: RETVAL
17              
18             SV *
19             pack (self, content)
20             Packer self
21             SV *content
22              
23             CODE:
24             // create the output buffer
25 70           self->data = sv_2mortal (newSV (64));
26 70           SvPOK_only (self->data);
27 70           encode_msgpack (self, content);
28              
29 64           SvREFCNT_inc (self->data);
30 64           RETVAL = self->data;
31              
32             OUTPUT: RETVAL
33              
34             void
35             DESTROY (self)
36             Packer self
37              
38             CODE:
39 15           Safefree (self);