Branch Coverage

src/xh_writer.c
Criterion Covered Total %
branch 31 44 70.4


line true false branch
15 1 40 if (writer->perl_obj != NULL) {
19 1 39 else if (writer->perl_io != NULL) {
36 0 2 if (len > (size_t) (enc_buf->end - enc_buf->cur)) {
52 2 39 if (writer->encoder != NULL) {
69 40 1 if (writer->perl_obj != NULL || writer->perl_io != NULL) {
1 39 if (writer->perl_obj != NULL || writer->perl_io != NULL) {
70 2 0 if (writer->main_buf.scalar != NULL)
73 0 2 if (writer->enc_buf.scalar != NULL)
76 2 37 else if (writer->encoder != NULL) {
77 2 0 if (writer->main_buf.scalar != NULL)
95 2 39 if (encoding[0] != '\0' && xh_strcasecmp(encoding, XH_INTERNAL_ENCODING) != 0) {
2 0 if (encoding[0] != '\0' && xh_strcasecmp(encoding, XH_INTERNAL_ENCODING) != 0) {
98 0 2 if (writer->encoder == NULL) {
108 2 39 if (output != NULL) {
111 2 0 IO *io = GvIO(gv);
0 2 IO *io = GvIO(gv);
0 0 IO *io = GvIO(gv);
2 0 IO *io = GvIO(gv);
113 0 2 if (!io)
116 1 1 if ((mg = SvTIED_mg(MUTABLE_SV(io), PERL_MAGIC_tiedscalar))) {
1 1 if ((mg = SvTIED_mg(MUTABLE_SV(io), PERL_MAGIC_tiedscalar))) {
118 1 0 writer->perl_obj = SvTIED_obj(MUTABLE_SV(io), mg);