Branch Coverage

src/ldns/host2wire.c
Criterion Covered Total %
branch 73 116 62.9


line true false branch
36 5 120 if(!compression_data)
38 5 0 if (ldns_buffer_reserve(buffer, ldns_rdf_size(name)))
46 34 86 if(ldns_dname_label_count(name)==0)
48 34 0 if(ldns_buffer_reserve(buffer,1))
56 6 80 if((node = ldns_rbtree_search(compression_data, ldns_rdf_data(name))) != NULL)
60 6 0 if (ldns_buffer_reserve(buffer, 2))
71 0 80 if(!node)
75 80 0 if (ldns_buffer_position(buffer) < 16384) {
87 80 0 if(ldns_buffer_reserve(buffer, size))
108 3 217 if(compression_data && ldns_rdf_get_type(rdf) == LDNS_RDF_TYPE_DNAME)
3 0 if(compression_data && ldns_rdf_get_type(rdf) == LDNS_RDF_TYPE_DNAME)
113 217 0 if (ldns_buffer_reserve(buffer, ldns_rdf_size(rdf))) {
125 31 45 if (ldns_rdf_get_type(rdf) == LDNS_RDF_TYPE_DNAME) {
126 31 0 if (ldns_buffer_reserve(buffer, ldns_rdf_size(rdf))) {
128 316 31 for (i = 0; i < ldns_rdf_size(rdf); i++) {
135 45 0 if (ldns_buffer_reserve(buffer, ldns_rdf_size(rdf))) {
152 5 5 for(i = 0; i < rr_count; i++) {
168 6 12 switch (ldns_rr_get_type(rr)) {
199 18 0 if (ldns_rr_owner(rr)) {
203 18 0 if (ldns_buffer_reserve(buffer, 4)) {
208 18 0 if (section != LDNS_SECTION_QUESTION) {
209 18 0 if (ldns_buffer_reserve(buffer, 6)) {
215 66 18 for (i = 0; i < ldns_rr_rd_count(rr); i++) {
216 18 48 if (pre_rfc3597) {
224 18 0 if (rdl_pos != 0) {
245 42 0 if (ldns_rr_owner(rr)) {
249 42 0 if (ldns_buffer_reserve(buffer, 4)) {
254 11 31 if (section != LDNS_SECTION_QUESTION) {
255 11 0 if (ldns_buffer_reserve(buffer, 6)) {
261 8 3 if (LDNS_RR_COMPRESS ==
264 38 8 for (i = 0; i < ldns_rr_rd_count(rr); i++) {
269 0 3 for (i = 0; i < ldns_rr_rd_count(rr); i++) {
274 11 0 if (rdl_pos != 0) {
289 0 5 if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_RRSIG) {
295 40 5 for (i = 0; i < ldns_rr_rd_count(rr) - 1; i++) {
309 116 29 for (i = 0; i < ldns_rr_rd_count(rr); i++) {
324 31 0 if (ldns_buffer_reserve(buffer, 12)) {
345 0 31 if (ldns_pkt_tsig(packet)) {
348 3 28 if (ldns_pkt_edns(packet)) {
380 31 0 if (rr_list) {
381 31 31 for (i = 0; i < ldns_rr_list_rr_count(rr_list); i++) {
387 31 0 if (rr_list) {
388 3 31 for (i = 0; i < ldns_rr_list_rr_count(rr_list); i++) {
394 31 0 if (rr_list) {
395 0 31 for (i = 0; i < ldns_rr_list_rr_count(rr_list); i++) {
401 31 0 if (rr_list) {
402 0 31 for (i = 0; i < ldns_rr_list_rr_count(rr_list); i++) {
409 3 28 if (ldns_pkt_edns(packet)) {
411 0 3 if(!edns_rr) return LDNS_STATUS_MEM_ERR;
421 0 3 if (packet->_edns_data)
425 0 3 if (packet->_edns_data)
431 0 31 if (ldns_pkt_tsig(packet)) {
449 0 0 if(!buffer) return LDNS_STATUS_MEM_ERR;
452 0 0 if (status == LDNS_STATUS_OK) {
467 0 0 if(!buffer) return LDNS_STATUS_MEM_ERR;
470 0 0 if (status == LDNS_STATUS_OK) {
485 0 3 if(!buffer) return LDNS_STATUS_MEM_ERR;
488 3 0 if (status == LDNS_STATUS_OK) {