Branch Coverage

amqp_connection.c
Criterion Covered Total %
branch 50 86 58.1


line true false branch
81 0 32 if (state == NULL) {
86 0 32 if (0 != res) {
101 0 32 if (state->sock_inbound_buffer.bytes == NULL) {
121 782 0 return state->socket ? amqp_socket_get_sockfd(state->socket) : -1;
126 0 0 if (!socket) {
146 0 70 ENFORCE_STATE(state, CONNECTION_STATE_IDLE);
152 0 70 if (0 > state->heartbeat) {
158 0 70 if (AMQP_STATUS_OK != res) {
163 0 70 if (AMQP_STATUS_OK != res) {
169 0 70 if (newbuf == NULL) {
191 31 0 if (state) {
193 496 31 for (i = 0; i < POOL_TABLE_SIZE; ++i) {
195 53 496 while (NULL != entry) {
224 5 950 if (received_data->len < bytes_consumed) {
246 0 480 if (received_data.len == 0) {
250 446 34 if (state->state == CONNECTION_STATE_IDLE) {
258 3 477 if (state->inbound_offset < state->target_size) {
267 0 29 if (memcmp(raw_frame, "AMQP", 4) == 0) {
300 0 475 if (frame_size >= INT32_MAX) {
305 0 475 if ((size_t)state->frame_max < state->target_size) {
310 0 475 if (NULL == channel_pool) {
316 0 475 if (NULL == state->inbound_buffer.bytes) {
328 2 473 if (state->inbound_offset < state->target_size) {
340 0 475 if (amqp_d8(amqp_offset(raw_frame, state->target_size - 1)) !=
350 0 475 if (NULL == channel_pool) {
364 0 400 if (res < 0) {
383 0 25 if (res < 0) {
421 0 295 ENFORCE_STATE(state, CONNECTION_STATE_IDLE);
423 4720 295 for (i = 0; i < POOL_TABLE_SIZE; ++i) {
426 474 4720 for (; NULL != entry; entry = entry->next) {
433 38 0 if (amqp_release_buffers_ok(state)) {
442 0 480 if (CONNECTION_STATE_IDLE != state->state) {
448 19 479 while (NULL != queued_link) {
450 1 18 if (channel == frame->channel) {
459 479 0 if (pool != NULL) {
492 0 414 if (res < 0) {
515 0 28 if (res < 0) {
559 0 483 if (AMQP_STATUS_OK != res) {
568 4 479 if (0 > sent) {
574 0 479 if ((ssize_t)encoded.len != sent) {
575 0 0 if (amqp_time_equal(next_timeout, deadline)) {
582 0 0 if (AMQP_STATUS_TIMEOUT == res) {
584 0 0 } else if (AMQP_STATUS_OK != res) {