CID 1405983 test_channelpadding.c dead code
Coverity found this dead code in test_channelpadding.c
recently. It looks like the CHANNELS_TO_TEST/3
loop never runs because the CHANNELS_TO_TEST/2
loop runs before it? Is the right thing to do here to switch the sequence of those two loops?
{{{
299 /* This loop should add timers to the first position in the timerslot 300 * array, since its timeout is before all other timers. */ at_least: At condition i < 33, the value of i must be at least 50. dead_error_condition: The condition i < 33 cannot be true. 301 for (; i < CHANNELS_TO_TEST/3; i++) {
CID 1405983 (#1 of 1): Logically dead code (DEADCODE) dead_error_begin: Execution cannot reach this statement: chans[i]->next_padding_time.... 302 chans[i]->next_padding_time_ms = monotime_coarse_absolute_msec() + 1; 303 decision = channelpadding_decide_to_pad_channel(chans[i]); 304 tt_int_op(decision, OP_EQ, CHANNELPADDING_PADDING_SCHEDULED); 305 tt_assert(chans[i]->pending_padding_callback); 306 tt_int_op(tried_to_write_cell, OP_EQ, 0); 307 }}}}