Branch Coverage

src/xh_h2x_lx.c
Criterion Covered Total %
branch 52 62 83.8


line true false branch
26 8 41 if (ctx->opts.cdata[0] != '\0' && xh_strcmp(key, ctx->opts.cdata) == 0) {
4 4 if (ctx->opts.cdata[0] != '\0' && xh_strcmp(key, ctx->opts.cdata) == 0) {
27 2 2 if (flag & XH_H2X_F_ATTR_ONLY || !(type & XH_H2X_T_SCALAR)) return;
1 1 if (flag & XH_H2X_F_ATTR_ONLY || !(type & XH_H2X_T_SCALAR)) return;
30 45 0 else if (ctx->opts.text[0] != '\0' && xh_strcmp(key, ctx->opts.text) == 0) {
4 41 else if (ctx->opts.text[0] != '\0' && xh_strcmp(key, ctx->opts.text) == 0) {
31 2 2 if (flag & XH_H2X_F_ATTR_ONLY || !(type & XH_H2X_T_SCALAR)) return;
0 2 if (flag & XH_H2X_F_ATTR_ONLY || !(type & XH_H2X_T_SCALAR)) return;
34 8 33 else if (ctx->opts.comm[0] != '\0' && xh_strcmp(key, ctx->opts.comm) == 0) {
4 4 else if (ctx->opts.comm[0] != '\0' && xh_strcmp(key, ctx->opts.comm) == 0) {
35 2 2 if (flag & XH_H2X_F_ATTR_ONLY) return;
37 1 1 if (type & XH_H2X_T_SCALAR) {
44 37 0 else if (ctx->opts.attr[0] != '\0') {
45 8 29 if (xh_strncmp(key, ctx->opts.attr, ctx->opts.attr_len) == 0) {
46 4 4 if (!(flag & XH_H2X_F_ATTR_ONLY)) return;
51 3 1 if (type & XH_H2X_T_SCALAR) {
59 7 22 if (flag & XH_H2X_F_ATTR_ONLY) return;
61 1 21 if (type & XH_H2X_T_ARRAY) {
64 20 1 else if (type & XH_H2X_T_NOT_NULL) {
73 0 0 if (type & XH_H2X_T_NOT_NULL) {
92 20 50 if (type & XH_H2X_T_SCALAR) {
93 10 10 if (flag & XH_H2X_F_ATTR_ONLY) goto FINISH;
96 47 3 else if (type & XH_H2X_T_HASH) {
97 0 47 len = HvUSEDKEYS((HV *) value);
99 2 45 if (len > 1 && ctx->opts.canonical) {
0 2 if (len > 1 && ctx->opts.canonical) {
101 0 0 for (i = 0; i < len; i++) {
108 49 47 while ((hash_value = hv_iternextsv((HV *) value, (char **) &key, &key_len))) {
113 3 0 else if (type & XH_H2X_T_ARRAY) {
114 1 2 if (flag & XH_H2X_F_ATTR_ONLY) goto FINISH;
116 7 2 for (i = 0; i < len; i++) {