Branch Coverage

src/xh.c
Criterion Covered Total %
branch 153 268 57.0


line true false branch
13 116 0 XH_PARAM_READ_STRING (opts->root, "XML::Hash::XS::root", XH_DEF_ROOT);
116 0 XH_PARAM_READ_STRING (opts->root, "XML::Hash::XS::root", XH_DEF_ROOT);
14 116 0 XH_PARAM_READ_STRING (opts->version, "XML::Hash::XS::version", XH_DEF_VERSION);
116 0 XH_PARAM_READ_STRING (opts->version, "XML::Hash::XS::version", XH_DEF_VERSION);
15 116 0 XH_PARAM_READ_STRING (opts->encoding, "XML::Hash::XS::encoding", XH_DEF_ENCODING);
116 0 XH_PARAM_READ_STRING (opts->encoding, "XML::Hash::XS::encoding", XH_DEF_ENCODING);
16 116 0 XH_PARAM_READ_INT (opts->indent, "XML::Hash::XS::indent", XH_DEF_INDENT);
17 116 0 XH_PARAM_READ_BOOL (opts->canonical, "XML::Hash::XS::canonical", XH_DEF_CANONICAL);
4 112 XH_PARAM_READ_BOOL (opts->canonical, "XML::Hash::XS::canonical", XH_DEF_CANONICAL);
18 116 0 XH_PARAM_READ_STRING (opts->content, "XML::Hash::XS::content", XH_DEF_CONTENT);
4 112 XH_PARAM_READ_STRING (opts->content, "XML::Hash::XS::content", XH_DEF_CONTENT);
19 116 0 XH_PARAM_READ_BOOL (opts->utf8, "XML::Hash::XS::utf8", XH_DEF_UTF8);
116 0 XH_PARAM_READ_BOOL (opts->utf8, "XML::Hash::XS::utf8", XH_DEF_UTF8);
20 116 0 XH_PARAM_READ_BOOL (opts->xml_decl, "XML::Hash::XS::xml_decl", XH_DEF_XML_DECL);
113 3 XH_PARAM_READ_BOOL (opts->xml_decl, "XML::Hash::XS::xml_decl", XH_DEF_XML_DECL);
21 116 0 XH_PARAM_READ_BOOL (opts->keep_root, "XML::Hash::XS::keep_root", XH_DEF_KEEP_ROOT);
53 63 XH_PARAM_READ_BOOL (opts->keep_root, "XML::Hash::XS::keep_root", XH_DEF_KEEP_ROOT);
25 116 0 XH_PARAM_READ_BOOL (use_attr, "XML::Hash::XS::use_attr", XH_DEF_USE_ATTR);
3 113 XH_PARAM_READ_BOOL (use_attr, "XML::Hash::XS::use_attr", XH_DEF_USE_ATTR);
26 116 0 XH_PARAM_READ_INT (opts->max_depth, "XML::Hash::XS::max_depth", XH_DEF_MAX_DEPTH);
27 116 0 XH_PARAM_READ_INT (opts->buf_size, "XML::Hash::XS::buf_size", XH_DEF_BUF_SIZE);
28 116 0 XH_PARAM_READ_PATTERN(opts->force_array, "XML::Hash::XS::force_array", XH_DEF_FORCE_ARRAY);
29 116 0 XH_PARAM_READ_BOOL (opts->force_content, "XML::Hash::XS::force_content", XH_DEF_FORCE_CONTENT);
0 116 XH_PARAM_READ_BOOL (opts->force_content, "XML::Hash::XS::force_content", XH_DEF_FORCE_CONTENT);
30 116 0 XH_PARAM_READ_BOOL (opts->merge_text, "XML::Hash::XS::merge_text", XH_DEF_MERGE_TEXT);
0 116 XH_PARAM_READ_BOOL (opts->merge_text, "XML::Hash::XS::merge_text", XH_DEF_MERGE_TEXT);
33 116 0 XH_PARAM_READ_STRING (opts->attr, "XML::Hash::XS::attr", XH_DEF_ATTR);
116 0 XH_PARAM_READ_STRING (opts->attr, "XML::Hash::XS::attr", XH_DEF_ATTR);
35 116 0 XH_PARAM_READ_STRING (opts->text, "XML::Hash::XS::text", XH_DEF_TEXT);
116 0 XH_PARAM_READ_STRING (opts->text, "XML::Hash::XS::text", XH_DEF_TEXT);
36 116 0 XH_PARAM_READ_BOOL (opts->trim, "XML::Hash::XS::trim", XH_DEF_TRIM);
15 101 XH_PARAM_READ_BOOL (opts->trim, "XML::Hash::XS::trim", XH_DEF_TRIM);
37 116 0 XH_PARAM_READ_STRING (opts->cdata, "XML::Hash::XS::cdata", XH_DEF_CDATA);
0 116 XH_PARAM_READ_STRING (opts->cdata, "XML::Hash::XS::cdata", XH_DEF_CDATA);
38 116 0 XH_PARAM_READ_STRING (opts->comm, "XML::Hash::XS::comm", XH_DEF_COMM);
0 116 XH_PARAM_READ_STRING (opts->comm, "XML::Hash::XS::comm", XH_DEF_COMM);
41 116 0 XH_PARAM_READ_STRING (method, "XML::Hash::XS::method", XH_DEF_METHOD);
116 0 XH_PARAM_READ_STRING (method, "XML::Hash::XS::method", XH_DEF_METHOD);
42 15 101 if (xh_strcmp(method, XH_CHAR_CAST "LX") == 0) {
45 3 98 else if (use_attr) {
53 116 0 XH_PARAM_READ_REF (opts->output, "XML::Hash::XS::output", XH_DEF_OUTPUT);
0 116 XH_PARAM_READ_REF (opts->output, "XML::Hash::XS::output", XH_DEF_OUTPUT);
0 0 XH_PARAM_READ_REF (opts->output, "XML::Hash::XS::output", XH_DEF_OUTPUT);
56 116 0 if ( (sv = get_sv("XML::Hash::XS::suppress_empty", 0)) != NULL ) {
57 116 0 if ( SvOK(sv) ) {
58 116 0 if (SvTYPE(sv) == SVt_IV) {
81 0 4 if ((opts = malloc(sizeof(xh_opts_t))) == NULL) {
86 0 4 if (! xh_init_opts(opts)) {
97 3 115 if (opts->force_array.expr != NULL)
100 6 112 if (opts->filter.expr != NULL)
103 1 117 if (opts->cb != NULL)
111 1 1 if (dst->force_array.expr != NULL) {
125 0 62 if ((items - first) % 2 != 0) {
129 95 60 for (i = first; i < items; i = i + 2) {
131 0 95 if (!SvOK(v)) {
140 1 0 if (xh_str_equal2(p, 'c', 'b')) {
154 1 30 if (xh_str_equal4(p, 'a', 't', 't', 'r')) {
156 0 1 if (opts->attr[0] == '\0') {
164 2 28 if (xh_str_equal4(p, 'c', 'o', 'm', 'm')) {
168 0 28 if (xh_str_equal4(p, 'r', 'o', 'o', 't')) {
172 20 8 if (xh_str_equal4(p, 't', 'r', 'i', 'm')) {
176 1 7 if (xh_str_equal4(p, 't', 'e', 'x', 't')) {
180 7 0 if (xh_str_equal4(p, 'u', 't', 'f', '8')) {
186 2 0 if (xh_str_equal5(p, 'c', 'd', 'a', 't', 'a')) {
2 0 if (xh_str_equal5(p, 'c', 'd', 'a', 't', 'a')) {
192 3 8 if (xh_str_equal6(p, 'i', 'n', 'd', 'e', 'n', 't')) {
3 0 if (xh_str_equal6(p, 'i', 'n', 'd', 'e', 'n', 't')) {
196 0 8 if (xh_str_equal6(p, 'm', 'e', 't', 'h', 'o', 'd')) {
0 0 if (xh_str_equal6(p, 'm', 'e', 't', 'h', 'o', 'd')) {
197 0 0 if (!SvOK(v)) {
203 0 0 if (xh_str_equal6(cv, 'N', 'A', 'T', 'I', 'V', 'E')) {
0 0 if (xh_str_equal6(cv, 'N', 'A', 'T', 'I', 'V', 'E')) {
209 0 0 if (cv[0] == 'L' && cv[1] == 'X') {
0 0 if (cv[0] == 'L' && cv[1] == 'X') {
219 2 6 if (xh_str_equal6(p, 'o', 'u', 't', 'p', 'u', 't')) {
2 0 if (xh_str_equal6(p, 'o', 'u', 't', 'p', 'u', 't')) {
220 2 0 if ( SvOK(v) && SvROK(v) ) {
2 0 if ( SvOK(v) && SvROK(v) ) {
228 6 0 if (xh_str_equal6(p, 'f', 'i', 'l', 't', 'e', 'r')) {
6 0 if (xh_str_equal6(p, 'f', 'i', 'l', 't', 'e', 'r')) {
234 2 0 if (xh_str_equal7(p, 'c', 'o', 'n', 't', 'e', 'n', 't')) {
2 0 if (xh_str_equal7(p, 'c', 'o', 'n', 't', 'e', 'n', 't')) {
238 0 0 if (xh_str_equal7(p, 'v', 'e', 'r', 's', 'i', 'o', 'n')) {
0 0 if (xh_str_equal7(p, 'v', 'e', 'r', 's', 'i', 'o', 'n')) {
244 6 6 if (xh_str_equal8(p, 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g')) {
6 0 if (xh_str_equal8(p, 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g')) {
248 2 4 if (xh_str_equal8(p, 'u', 's', 'e', '_', 'a', 't', 't', 'r')) {
2 0 if (xh_str_equal8(p, 'u', 's', 'e', '_', 'a', 't', 't', 'r')) {
252 1 3 if (xh_str_equal8(p, 'x', 'm', 'l', '_', 'd', 'e', 'c', 'l')) {
1 0 if (xh_str_equal8(p, 'x', 'm', 'l', '_', 'd', 'e', 'c', 'l')) {
256 3 0 if (xh_str_equal8(p, 'b', 'u', 'f', '_', 's', 'i', 'z', 'e')) {
3 0 if (xh_str_equal8(p, 'b', 'u', 'f', '_', 's', 'i', 'z', 'e')) {
262 3 16 if (xh_str_equal9(p, 'c', 'a', 'n', 'o', 'n', 'i', 'c', 'a', 'l')) {
3 0 if (xh_str_equal9(p, 'c', 'a', 'n', 'o', 'n', 'i', 'c', 'a', 'l')) {
3 0 if (xh_str_equal9(p, 'c', 'a', 'n', 'o', 'n', 'i', 'c', 'a', 'l')) {
266 0 16 if (xh_str_equal9(p, 'm', 'a', 'x', '_', 'd', 'e', 'p', 't', 'h')) {
0 0 if (xh_str_equal9(p, 'm', 'a', 'x', '_', 'd', 'e', 'p', 't', 'h')) {
0 0 if (xh_str_equal9(p, 'm', 'a', 'x', '_', 'd', 'e', 'p', 't', 'h')) {
270 16 0 if (xh_str_equal9(p, 'k', 'e', 'e', 'p', '_', 'r', 'o', 'o', 't')) {
16 0 if (xh_str_equal9(p, 'k', 'e', 'e', 'p', '_', 'r', 'o', 'o', 't')) {
16 0 if (xh_str_equal9(p, 'k', 'e', 'e', 'p', '_', 'r', 'o', 'o', 't')) {
276 3 0 if (xh_str_equal10(p, 'm', 'e', 'r', 'g', 'e', '_', 't', 'e', 'x', 't')) {
3 0 if (xh_str_equal10(p, 'm', 'e', 'r', 'g', 'e', '_', 't', 'e', 'x', 't')) {
3 0 if (xh_str_equal10(p, 'm', 'e', 'r', 'g', 'e', '_', 't', 'e', 'x', 't')) {
282 7 0 if (xh_str_equal11(p, 'f', 'o', 'r', 'c', 'e', '_', 'a', 'r', 'r', 'a', 'y')) {
7 0 if (xh_str_equal11(p, 'f', 'o', 'r', 'c', 'e', '_', 'a', 'r', 'r', 'a', 'y')) {
7 0 if (xh_str_equal11(p, 'f', 'o', 'r', 'c', 'e', '_', 'a', 'r', 'r', 'a', 'y')) {
288 2 0 if (xh_str_equal13(p, 'f', 'o', 'r', 'c', 'e', '_', 'c', 'o', 'n', 't', 'e', 'n', 't')) {
2 0 if (xh_str_equal13(p, 'f', 'o', 'r', 'c', 'e', '_', 'c', 'o', 'n', 't', 'e', 'n', 't')) {
2 0 if (xh_str_equal13(p, 'f', 'o', 'r', 'c', 'e', '_', 'c', 'o', 'n', 't', 'e', 'n', 't')) {
2 0 if (xh_str_equal13(p, 'f', 'o', 'r', 'c', 'e', '_', 'c', 'o', 'n', 't', 'e', 'n', 't')) {
294 3 0 if (xh_str_equal14(p, 's', 'u', 'p', 'p', 'r', 'e', 's', 's', '_', 'e', 'm', 'p', 't', 'y')) {
3 0 if (xh_str_equal14(p, 's', 'u', 'p', 'p', 'r', 'e', 's', 's', '_', 'e', 'm', 'p', 't', 'y')) {
3 0 if (xh_str_equal14(p, 's', 'u', 'p', 'p', 'r', 'e', 's', 's', '_', 'e', 'm', 'p', 't', 'y')) {
3 0 if (xh_str_equal14(p, 's', 'u', 'p', 'p', 'r', 'e', 's', 's', '_', 'e', 'm', 'p', 't', 'y')) {
295 2 1 if (SvOK(v)) {
296 1 1 if (SvTYPE(v) == SVt_IV) {
313 2 58 if (use_attr != -1 && (opts->method == XH_METHOD_NATIVE || opts->method == XH_METHOD_NATIVE_ATTR_MODE)) {
0 2 if (use_attr != -1 && (opts->method == XH_METHOD_NATIVE || opts->method == XH_METHOD_NATIVE_ATTR_MODE)) {
0 0 if (use_attr != -1 && (opts->method == XH_METHOD_NATIVE || opts->method == XH_METHOD_NATIVE_ATTR_MODE)) {
314 2 0 if (use_attr == TRUE) {
338 0 114 if (*nparam >= items)
342 2 112 if ( sv_derived_from(param, class) ) {
343 2 0 if ( sv_isobject(param) ) {
359 0 42 if (*nparam >= items)
363 42 0 if (!SvROK(param) || SvTYPE(SvRV(param)) != SVt_PVHV)
0 42 if (!SvROK(param) || SvTYPE(SvRV(param)) != SVt_PVHV)
376 0 72 if (*nparam >= items)
380 3 69 if (SvROK(param))
383 0 72 if (!SvOK(param))
386 2 70 if (!SvPOK(param) && SvTYPE(param) != SVt_PVGV)
0 2 if (!SvPOK(param) && SvTYPE(param) != SVt_PVGV)
397 112 2 if (opts == NULL) {
405 58 56 if (nparam < items) {