Branch Coverage

lib/Neo4j/Bolt/CTypeHandlers.xs
Criterion Covered Total %
branch 104 168 61.9


line true false branch
61 1 0 return neo4j_bool( (bool) SvIV(sv) );
65 3 0 return neo4j_int( (long long) SvIV(sv) );
69 1 0 return neo4j_float( SvNV(sv) );
76 16 0 k = SvPV(sv,len);
79 0 16 k = SvPVutf8(sv2, len);
91 0 28 if (!SvOK(sv) ) {
0 0 if (!SvOK(sv) ) {
0 0 if (!SvOK(sv) ) {
94 10 18 if (SvROK(sv)) { // a ref
97 1 9 if ( t < SVt_PVAV) { // scalar ref
98 0 1 if ((sv_isobject(sv) && sv_isa(sv, "JSON::PP::Boolean")) || (SvIOK(thing) && SvIV(thing) >> 1 == 0)) {
0 0 if ((sv_isobject(sv) && sv_isa(sv, "JSON::PP::Boolean")) || (SvIOK(thing) && SvIV(thing) >> 1 == 0)) {
1 0 if ((sv_isobject(sv) && sv_isa(sv, "JSON::PP::Boolean")) || (SvIOK(thing) && SvIV(thing) >> 1 == 0)) {
1 0 if ((sv_isobject(sv) && sv_isa(sv, "JSON::PP::Boolean")) || (SvIOK(thing) && SvIV(thing) >> 1 == 0)) {
1 0 if ((sv_isobject(sv) && sv_isa(sv, "JSON::PP::Boolean")) || (SvIOK(thing) && SvIV(thing) >> 1 == 0)) {
0 0 if ((sv_isobject(sv) && sv_isa(sv, "JSON::PP::Boolean")) || (SvIOK(thing) && SvIV(thing) >> 1 == 0)) {
106 2 7 else if (t == SVt_PVAV) { //array
107 1 1 if (sv_isobject(sv)) {
108 1 0 if (sv_isa(sv, PATH_CLASS)) { // path
115 7 0 else if (t == SVt_PVHV) { //hash
118 6 1 if (sv_isobject(sv)) {
119 3 3 if (sv_isa(sv, NODE_CLASS)) { // node
122 3 0 if (sv_isa(sv, RELATIONSHIP_CLASS)) { // reln
131 3 15 if (SvIOK(sv)) {
134 1 14 else if (SvNOK(sv)) {
137 14 0 else if (SvPOK(sv)) {
152 0 2 if (n < 0) {
156 0 2 Newx(items, n+1, neo4j_value_t);
157 6 2 for (i=0;i<=n;i++) {
170 0 4 if (!HvTOTALKEYS(hv)) {
173 0 4 Newx(map_ents,HvTOTALKEYS(hv),neo4j_map_entry_t);
176 9 4 while ((ent = hv_iternext(hv))) {
178 0 9 k = SvPVutf8(ksv, retlen);
204 1 2 if (lbls_ref_p && SvROK(*lbls_ref_p)) {
1 0 if (lbls_ref_p && SvROK(*lbls_ref_p)) {
209 1 2 if (lbls && SvTYPE((SV*)lbls) == SVt_PVAV && av_len(lbls) >= 0) {
1 0 if (lbls && SvTYPE((SV*)lbls) == SVt_PVAV && av_len(lbls) >= 0) {
1 0 if (lbls && SvTYPE((SV*)lbls) == SVt_PVAV && av_len(lbls) >= 0) {
215 3 0 fields[0] = neo4j_identity( node_id_p ? SvIV( *node_id_p ) : -1 );
3 0 fields[0] = neo4j_identity( node_id_p ? SvIV( *node_id_p ) : -1 );
218 2 1 if (props_ref_p && SvROK(*props_ref_p)) {
2 0 if (props_ref_p && SvROK(*props_ref_p)) {
223 2 1 if (props && SvTYPE((SV*)props) == SVt_PVHV && HvTOTALKEYS(props)) {
2 0 if (props && SvTYPE((SV*)props) == SVt_PVHV && HvTOTALKEYS(props)) {
2 0 if (props && SvTYPE((SV*)props) == SVt_PVHV && HvTOTALKEYS(props)) {
253 3 0 fields[0] = neo4j_identity( reln_id_p ? SvIV( *reln_id_p ) : -1 );
3 0 fields[0] = neo4j_identity( reln_id_p ? SvIV( *reln_id_p ) : -1 );
254 3 0 fields[1] = neo4j_identity( start_id_p ? SvIV( *start_id_p ) : -1 );
3 0 fields[1] = neo4j_identity( start_id_p ? SvIV( *start_id_p ) : -1 );
255 3 0 fields[2] = neo4j_identity( end_id_p ? SvIV( *end_id_p ) : -1 );
3 0 fields[2] = neo4j_identity( end_id_p ? SvIV( *end_id_p ) : -1 );
256 2 1 if (type_p && SvOK(*type_p)) {
0 2 if (type_p && SvOK(*type_p)) {
0 0 if (type_p && SvOK(*type_p)) {
0 0 if (type_p && SvOK(*type_p)) {
263 1 2 if (props_ref_p && SvROK(*props_ref_p)) {
1 0 if (props_ref_p && SvROK(*props_ref_p)) {
268 1 2 if (props && SvTYPE((SV*)props) == SVt_PVHV && HvTOTALKEYS(props)) {
1 0 if (props && SvTYPE((SV*)props) == SVt_PVHV && HvTOTALKEYS(props)) {
1 0 if (props && SvTYPE((SV*)props) == SVt_PVHV && HvTOTALKEYS(props)) {
320 2 27 if ( the_type == NEO4J_BOOL) {
322 0 27 } else if ( the_type == NEO4J_BYTES) {
324 1 26 } else if ( the_type == NEO4J_FLOAT) {
326 3 23 } else if ( the_type == NEO4J_INT) {
328 3 20 } else if ( the_type == NEO4J_NODE) {
331 3 17 } else if ( the_type == NEO4J_RELATIONSHIP) {
334 0 17 } else if ( the_type == NEO4J_NULL) {
336 2 15 } else if ( the_type == NEO4J_LIST) {
338 1 14 } else if ( the_type == NEO4J_MAP) {
340 0 14 } else if ( the_type == NEO4J_PATH ){
344 14 0 } else if ( the_type == NEO4J_STRING) {
358 6 2 for (i=0;i
374 9 7 for (i=0;i
380 0 9 if (! is_ascii_string((U8 *)ks, (STRLEN)klen)) {
384 0 9 if (hv_store(hv, ks, klen, sv, 0) == NULL) {
408 1 2 if (neo4j_list_length(labels)) {
411 2 1 if (HvTOTALKEYS(props_hv)) {
433 3 0 SvPV(type,len);
435 2 1 if (retlen) {
438 1 2 if (HvTOTALKEYS(props_hv)) {
456 0 0 if (n==0) {
459 0 0 for (i=1; i<=n; i++) {
463 0 0 hv_stores( (HV*) SvRV(rel_sv), "start", newSViv( (IV) (dir ? last_node_id : node_id)));
464 0 0 hv_stores( (HV*) SvRV(rel_sv), "end", newSViv( (IV) (dir ? node_id : last_node_id)));