Branch Coverage

amqp_table.c
Criterion Covered Total %
branch 51 142 35.9


line true false branch
68 0 5 if (!amqp_decode_32(encoded, offset, &arraysize)) {
72 0 5 if (arraysize + *offset > encoded.len) {
77 0 5 if (entries == NULL) {
82 114 5 while (*offset < limit) {
83 3 111 if (num_entries >= allocated_entries) {
89 0 3 if (newentries == NULL) {
97 0 114 if (res < 0) {
108 0 5 if (output->entries == NULL) {
109 0 0 if (num_entries == 0) {
134 0 90 if (!amqp_decode_32(encoded, offset, &tablesize)) {
138 0 90 if (tablesize + *offset > encoded.len) {
143 0 90 if (entries == NULL) {
148 652 90 while (*offset < limit) {
152 0 652 if (!amqp_decode_8(encoded, offset, &keylen)) {
156 0 652 if (num_entries >= allocated_entries) {
162 0 0 if (newentries == NULL) {
170 0 652 if (!amqp_decode_bytes(encoded, offset, &entries[num_entries].key,
177 0 652 if (res < 0) {
188 0 90 if (output->entries == NULL) {
189 0 0 if (num_entries == 0) {
209 0 766 if (!amqp_decode_8(encoded, offset, &entry->kind)) {
226 0 342 SIMPLE_FIELD_DECODER(8, boolean, val ? 1 : 0);
229 0 0 SIMPLE_FIELD_DECODER(8, i8, (int8_t)val);
231 0 0 TRIVIAL_FIELD_DECODER(8);
234 0 0 SIMPLE_FIELD_DECODER(16, i16, (int16_t)val);
236 0 0 TRIVIAL_FIELD_DECODER(16);
239 0 0 SIMPLE_FIELD_DECODER(32, i32, (int32_t)val);
241 0 0 TRIVIAL_FIELD_DECODER(32);
244 0 122 SIMPLE_FIELD_DECODER(64, i64, (int64_t)val);
246 0 0 TRIVIAL_FIELD_DECODER(64);
249 0 0 TRIVIAL_FIELD_DECODER(32);
253 0 2 TRIVIAL_FIELD_DECODER(64);
281 0 0 TRIVIAL_FIELD_DECODER(64);
309 114 5 for (i = 0; i < input->num_entries; i++) {
311 0 114 if (res < 0) {
316 0 5 if (!amqp_encode_32(encoded, &start, (uint32_t)(*offset - start - 4))) {
334 360 193 for (i = 0; i < input->num_entries; i++) {
335 0 360 if (!amqp_encode_8(encoded, offset, (uint8_t)input->entries[i].key.len)) {
340 0 360 if (!amqp_encode_bytes(encoded, offset, input->entries[i].key)) {
346 0 360 if (res < 0) {
351 0 193 if (!amqp_encode_32(encoded, &start, (uint32_t)(*offset - start - 4))) {
366 0 474 if (!amqp_encode_8(encoded, offset, entry->kind)) {
379 0 76 FIELD_ENCODER(8, entry->value.boolean ? 1 : 0);
382 0 0 FIELD_ENCODER(8, entry->value.i8);
384 0 0 FIELD_ENCODER(8, entry->value.u8);
387 0 0 FIELD_ENCODER(16, entry->value.i16);
389 0 0 FIELD_ENCODER(16, entry->value.u16);
392 0 0 FIELD_ENCODER(32, entry->value.i32);
394 0 0 FIELD_ENCODER(32, entry->value.u32);
397 0 124 FIELD_ENCODER(64, entry->value.i64);
399 0 0 FIELD_ENCODER(64, entry->value.u64);
403 0 0 FIELD_ENCODER(32, entry->value.u32);
407 0 2 FIELD_ENCODER(64, entry->value.u64);
434 0 0 FIELD_ENCODER(64, entry->value.u64);
464 0 0 if (p2->key.len < minlen) {
469 0 0 if (d != 0) {
535 0 419 if (0 == original->value.bytes.len) {
540 0 419 if (NULL == clone->value.bytes.bytes) {
549 0 0 if (0 == original->value.array.entries) {
555 0 0 if (NULL == clone->value.array.entries) {
559 0 0 for (i = 0; i < clone->value.array.num_entries; ++i) {
562 0 0 if (AMQP_STATUS_OK != res) {
586 0 913 if (0 == original->key.len) {
591 0 913 if (NULL == clone->key.bytes) {
605 0 152 if (0 == clone->num_entries) {
613 0 152 if (NULL == clone->entries) {
617 913 152 for (i = 0; i < clone->num_entries; ++i) {
620 0 913 if (AMQP_STATUS_OK != res) {
661 0 1 assert(table != NULL);
662 6 1 for (i = 0; i < table->num_entries; ++i) {
663 0 6 if (amqp_bytes_equal(table->entries[i].key, key)) {