Fix for tests, minor fix for RLC UM

master
Paul Sutton 7 years ago
parent 494802ba9b
commit 49a105baed

@ -277,7 +277,7 @@ int rlc_um::build_data_pdu(uint8_t *payload, uint32_t nof_bytes)
int head_len = rlc_um_packed_length(&header); int head_len = rlc_um_packed_length(&header);
int pdu_space = nof_bytes; int pdu_space = nof_bytes;
if(pdu_space <= head_len) if(pdu_space <= head_len + 1)
{ {
log->warning("%s Cannot build a PDU - %d bytes available, %d bytes required for header\n", log->warning("%s Cannot build a PDU - %d bytes available, %d bytes required for header\n",
rrc->get_rb_name(lcid).c_str(), nof_bytes, head_len); rrc->get_rb_name(lcid).c_str(), nof_bytes, head_len);

@ -123,7 +123,7 @@ void basic_test()
byte_buffer_t pdu_bufs[NBUFS]; byte_buffer_t pdu_bufs[NBUFS];
for(int i=0;i<NBUFS;i++) for(int i=0;i<NBUFS;i++)
{ {
len = rlc1.read_pdu(pdu_bufs[i].msg, 3); // 3 bytes for header + payload len = rlc1.read_pdu(pdu_bufs[i].msg, 4); // 3 bytes for header + payload
pdu_bufs[i].N_bytes = len; pdu_bufs[i].N_bytes = len;
} }
@ -191,7 +191,7 @@ void loss_test()
byte_buffer_t pdu_bufs[NBUFS]; byte_buffer_t pdu_bufs[NBUFS];
for(int i=0;i<NBUFS;i++) for(int i=0;i<NBUFS;i++)
{ {
len = rlc1.read_pdu(pdu_bufs[i].msg, 3); // 3 bytes for header + payload len = rlc1.read_pdu(pdu_bufs[i].msg, 4); // 3 bytes for header + payload
pdu_bufs[i].N_bytes = len; pdu_bufs[i].N_bytes = len;
} }

Loading…
Cancel
Save