Fix typos and bad comments in rlc_am_lte.cc and rlc_am_test.cc

Added checks for the nack_sn in the status reports of the rlc_am_test.
master
Pedro Alvarez 4 years ago
parent 24db20bcca
commit d0ef6ce00b

@ -381,7 +381,7 @@ int rlc_am_lte::rlc_am_lte_tx::write_sdu(unique_byte_buffer_t sdu)
// Store SDU info
uint32_t info_count = undelivered_sdu_info_queue.count(info.sn);
if (info_count != 0) {
log->error("PDCP SDU info alreay exists\n");
log->error("PDCP SDU info already exists\n");
return SRSLTE_ERROR;
}
@ -1080,7 +1080,7 @@ void rlc_am_lte::rlc_am_lte_tx::update_notification_ack_info(const rlc_amd_tx_pd
{
// Iterate over all undelivered SDUs
for (auto& info_it : undelivered_sdu_info_queue) {
// Iterate over all SNs that
// Iterate over all SNs that were TX'ed
uint32_t pdcp_sn = info_it.first;
auto& info = info_it.second;
for (auto& rlc_sn_info : info.rlc_sn_info_list) {

@ -59,11 +59,11 @@ public:
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) {}
void notify_delivery(uint32_t lcid, const std::vector<uint32_t>& pdcp_sn_vec)
{
assert(lcid == 1);
for (uint32_t pdcp_sn : pdcp_sn_vec) {
if (notified_counts.find(pdcp_sn) == notified_counts.end()) {
notified_counts[pdcp_sn] = 0;
}
assert(lcid == 1);
notified_counts[pdcp_sn] += 1;
}
}
@ -447,6 +447,7 @@ int retx_test()
rlc_status_pdu_t status_check = {};
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
TESTASSERT(status_check.N_nack == 1); // 1 packet was lost.
TESTASSERT(status_check.nacks[0].nack_sn == 1); // SN 1 was lost.
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 4.
// Write status PDU to RLC1
@ -495,7 +496,7 @@ int retx_test()
// Assert status is correct
status_check = {};
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
TESTASSERT(status_check.N_nack == 0); // 1 packet was lost.
TESTASSERT(status_check.N_nack == 0); // No packet was lost.
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 4.
// Write status PDU to RLC1
@ -578,7 +579,7 @@ int segment_retx_test()
// Assert status is correct
rlc_status_pdu_t status_check = {};
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
TESTASSERT(status_check.N_nack == 0); // 1 packet was lost.
TESTASSERT(status_check.N_nack == 0); // No packet was lost.
TESTASSERT(status_check.ack_sn == 1); // Delivered up to SN 0.
// Write status PDU to RLC1
@ -612,7 +613,7 @@ int segment_retx_test()
// Assert status is correct
status_check = {};
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
TESTASSERT(status_check.N_nack == 0); // 1 packet was lost.
TESTASSERT(status_check.N_nack == 0); // No packet was lost.
TESTASSERT(status_check.ack_sn == 2); // Delivered up to SN 0.
// Make sure SDU was notified
@ -698,6 +699,7 @@ int resegment_test_1()
rlc_status_pdu_t status_check = {};
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
TESTASSERT(status_check.N_nack == 1); // 1 packet was lost.
TESTASSERT(status_check.nacks[0].nack_sn == 1); // SN 1 was lost.
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
// Write status PDU to RLC1
@ -741,6 +743,7 @@ int resegment_test_1()
status_check = {};
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
TESTASSERT(status_check.N_nack == 1); // 1 packet was lost.
TESTASSERT(status_check.nacks[0].nack_sn == 1); // SN 1 was lost.
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
// Read the remaining segment
@ -854,7 +857,7 @@ int resegment_test_2()
// Assert status is correct
rlc_status_pdu_t status_check = {};
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
TESTASSERT(status_check.N_nack == 1); // all packets delivered.
TESTASSERT(status_check.N_nack == 1); // One packet was lost.
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
// Write status PDU to RLC1
@ -987,7 +990,8 @@ int resegment_test_3()
// Assert status is correct
rlc_status_pdu_t status_check = {};
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
TESTASSERT(status_check.N_nack == 1); // all packets delivered.
TESTASSERT(status_check.N_nack == 1); // One packet was lost.
TESTASSERT(status_check.nacks[0].nack_sn == 2); // SN 2 was lost.
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
// Write status PDU to RLC1
@ -1118,7 +1122,8 @@ int resegment_test_4()
// Assert status is correct
rlc_status_pdu_t status_check = {};
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
TESTASSERT(status_check.N_nack == 1); // all packets delivered.
TESTASSERT(status_check.N_nack == 1); // one packet lost.
TESTASSERT(status_check.nacks[0].nack_sn == 2); // SN 2 was lost.
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
// Write status PDU to RLC1
@ -1250,7 +1255,8 @@ int resegment_test_5()
// Assert status is correct
rlc_status_pdu_t status_check = {};
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
TESTASSERT(status_check.N_nack == 1); // all packets delivered.
TESTASSERT(status_check.N_nack == 1); // one packet was lost.
TESTASSERT(status_check.nacks[0].nack_sn == 2); // SN 2 was lost.
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
// Write status PDU to RLC1
@ -1389,7 +1395,8 @@ int resegment_test_6()
// Assert status is correct
rlc_status_pdu_t status_check = {};
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
TESTASSERT(status_check.N_nack == 1);
TESTASSERT(status_check.N_nack == 1); // One packet was lost.
TESTASSERT(status_check.nacks[0].nack_sn == 3); // SN 3 was lost.
TESTASSERT(status_check.ack_sn == 5);
// Write status PDU to RLC1
@ -1576,7 +1583,8 @@ int resegment_test_7()
// Assert status is correct
rlc_status_pdu_t status_check = {};
rlc_am_read_status_pdu(status_buf.msg, status_buf.N_bytes, &status_check);
TESTASSERT(status_check.N_nack == 1); // all packets delivered.
TESTASSERT(status_check.N_nack == 1); // one packet dropped.
TESTASSERT(status_check.nacks[0].nack_sn == 2); // SN 2 dropped.
TESTASSERT(status_check.ack_sn == 5); // Delivered up to SN 5.
// Write status PDU to RLC1

Loading…
Cancel
Save