From c30eb2c16664a48a0a46f51e9033616fb958ec61 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Thu, 28 Nov 2019 11:01:57 +0000 Subject: [PATCH] Starting to add test for when the RLC notifies the PDCP of tx and disarms the discardTimer. --- lib/test/upper/pdcp_nr_test.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/test/upper/pdcp_nr_test.cc b/lib/test/upper/pdcp_nr_test.cc index c20f4c590..a1cf9d043 100644 --- a/lib/test/upper/pdcp_nr_test.cc +++ b/lib/test/upper/pdcp_nr_test.cc @@ -154,6 +154,7 @@ int test_rx(std::vector events, */ int test_tx_sdu_discard(const pdcp_initial_state& init_state, srslte::pdcp_discard_timer_t discard_timeout, + bool imediate_notify, srslte::byte_buffer_pool* pool, srslte::log* log) { @@ -172,8 +173,6 @@ int test_tx_sdu_discard(const pdcp_initial_state& init_state, pdcp_hlp.set_pdcp_initial_state(init_state); - // Run test - // Test SDU srslte::unique_byte_buffer_t sdu = allocate_unique_buffer(*pool); sdu->append_bytes(sdu1, sizeof(sdu1)); @@ -184,7 +183,11 @@ int test_tx_sdu_discard(const pdcp_initial_state& init_state, } TESTASSERT(rlc->discard_count == 0); timers->step_all(); - TESTASSERT(rlc->discard_count == 1); + if (imediate_notify) { + TESTASSERT(rlc->discard_count == 0); // RLC imediatly notified the PDCP of tx, there should be no timeouts + } else { + TESTASSERT(rlc->discard_count == 1); // RLC does not notify the the PDCP of tx, there should be a timeout + } return 0; } @@ -333,7 +336,7 @@ int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log* log) * TX Test 9: PDCP Entity with SN LEN = 12 * Test TX PDU discard. */ - TESTASSERT(test_tx_sdu_discard(normal_init_state, srslte::pdcp_discard_timer_t::ms50, pool, log) == 0); + TESTASSERT(test_tx_sdu_discard(normal_init_state, srslte::pdcp_discard_timer_t::ms50, false, pool, log) == 0); return 0; }