From 40f19b0e2c972e99209d2a50d9f7668b5d002ec2 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Thu, 7 Jul 2022 12:40:10 +0100 Subject: [PATCH] lib,rlc: added check for status report in full rx_window test. --- lib/test/rlc/rlc_am_nr_test.cc | 10 +++++++++- lib/test/rlc/rlc_test_common.h | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/test/rlc/rlc_am_nr_test.cc b/lib/test/rlc/rlc_am_nr_test.cc index 983859c41..3567092af 100644 --- a/lib/test/rlc/rlc_am_nr_test.cc +++ b/lib/test/rlc/rlc_am_nr_test.cc @@ -3219,7 +3219,7 @@ int full_rx_window_t_reassembly_expiry(rlc_am_nr_sn_size_t sn_size) auto& test_logger = srslog::fetch_basic_logger("TESTER "); test_delimit_logger delimiter("Full RX window and t-Reassmbly expiry test ({} bit SN)", to_number(sn_size)); rlc_am rlc1(srsran_rat_t::nr, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); - rlc_am rlc2(srsran_rat_t::nr, srslog::fetch_basic_logger("RLC_AM_1"), 1, &tester, &tester, &timers); + rlc_am rlc2(srsran_rat_t::nr, srslog::fetch_basic_logger("RLC_AM_2"), 1, &tester, &tester, &timers); rlc_am_nr_tx* tx1 = dynamic_cast(rlc1.get_tx()); rlc_am_nr_rx* rx1 = dynamic_cast(rlc1.get_rx()); @@ -3262,6 +3262,14 @@ int full_rx_window_t_reassembly_expiry(rlc_am_nr_sn_size_t sn_size) timers.step_all(); } + // Read status PDU + { + TESTASSERT_EQ(0, rlc1.get_buffer_state()); + unique_byte_buffer_t status_buf = srsran::make_byte_buffer(); + status_buf->N_bytes = rlc2.read_pdu(status_buf->msg, 1000); + rlc1.write_pdu(status_buf->msg, status_buf->N_bytes); + TESTASSERT_EQ(header_size + payload_size, rlc1.get_buffer_state()); + } // Check Rx_Status_Highest { rlc_am_nr_rx_state_t st = rx2->get_rx_state(); diff --git a/lib/test/rlc/rlc_test_common.h b/lib/test/rlc/rlc_test_common.h index 519103243..3b76231af 100644 --- a/lib/test/rlc/rlc_test_common.h +++ b/lib/test/rlc/rlc_test_common.h @@ -78,7 +78,7 @@ public: void write_pdu(uint32_t lcid, unique_byte_buffer_t sdu) { assert(lcid == 1); - sdus.push_back(std::move(sdu)); + // sdus.push_back(std::move(sdu)); } void write_pdu_bcch_bch(unique_byte_buffer_t sdu) {} void write_pdu_bcch_dlsch(unique_byte_buffer_t sdu) {}