@@ -180,7 +180,7 @@ class base_fallback_tester
180180 bench->pucch_alloc .slot_indication (current_slot);
181181 }
182182
183- void run_slot (bool disabled_csi_rs = false )
183+ void run_slot ()
184184 {
185185 ++current_slot;
186186
@@ -192,9 +192,7 @@ class base_fallback_tester
192192 bench->pdcch_sch .slot_indication (current_slot);
193193 bench->pucch_alloc .slot_indication (current_slot);
194194
195- if (not disabled_csi_rs) {
196- bench->csi_rs_sched .run_slot (bench->res_grid [0 ]);
197- }
195+ bench->csi_rs_sched .run_slot (bench->res_grid [0 ]);
198196
199197 bench->fallback_sched .run_slot (bench->res_grid );
200198
@@ -318,18 +316,19 @@ TEST_P(fallback_scheduler_tester, successfully_allocated_resources)
318316{
319317 setup_sched (create_expert_config (2 ), create_custom_cell_config_request (params.k0 ));
320318 // Add UE.
321- add_ue (to_rnti (0x4601 ), to_du_ue_index (0 ));
319+ const du_ue_index_t ue_idx = to_du_ue_index (0 );
320+ add_ue (to_rnti (0x4601 ), ue_idx);
322321 // Notify about SRB0 message in DL of size 101 bytes.
323322 const unsigned mac_srb0_sdu_size = 101 ;
324- push_buffer_state_to_dl_ue (to_du_ue_index ( 0 ) , mac_srb0_sdu_size);
323+ push_buffer_state_to_dl_ue (ue_idx , mac_srb0_sdu_size);
325324
326- const unsigned exp_size = get_pending_bytes (to_du_ue_index ( 0 ) );
325+ const unsigned exp_size = get_pending_bytes (ue_idx );
327326
328327 // Test the following:
329328 // 1. Check for DCI_1_0 allocation for SRB0 on PDCCH.
330329 // 2. Check for PDSCH allocation.
331330 // 3. Check whether CW TB bytes matches with pending bytes to be sent.
332- const auto & test_ue = get_ue (to_du_ue_index ( 0 ) );
331+ const auto & test_ue = get_ue (ue_idx );
333332 bool is_ue_allocated_pdcch{false };
334333 bool is_ue_allocated_pdsch{false };
335334 for (unsigned sl_idx = 0 ; sl_idx < bench->max_test_run_slots_per_ue * (1U << current_slot.numerology ()); sl_idx++) {
@@ -344,6 +343,7 @@ TEST_P(fallback_scheduler_tester, successfully_allocated_resources)
344343 }
345344 ASSERT_TRUE (is_ue_allocated_pdcch);
346345 ASSERT_TRUE (is_ue_allocated_pdsch);
346+ ASSERT_FALSE (test_ue.has_pending_dl_newtx_bytes (LCID_SRB0));
347347}
348348
349349TEST_P (fallback_scheduler_tester, failed_allocating_resources)
@@ -377,14 +377,15 @@ TEST_P(fallback_scheduler_tester, test_large_srb0_buffer_size)
377377{
378378 setup_sched (create_expert_config (27 ), create_custom_cell_config_request (params.k0 ));
379379 // Add UE.
380- add_ue (to_rnti (0x4601 ), to_du_ue_index (0 ));
380+ const du_ue_index_t ue_idx = to_du_ue_index (0 );
381+ add_ue (to_rnti (0x4601 ), ue_idx);
381382 // Notify about SRB0 message in DL of size 458 bytes.
382383 const unsigned mac_srb0_sdu_size = 458 ;
383- push_buffer_state_to_dl_ue (to_du_ue_index ( 0 ) , mac_srb0_sdu_size);
384+ push_buffer_state_to_dl_ue (ue_idx , mac_srb0_sdu_size);
384385
385- const unsigned exp_size = get_pending_bytes (to_du_ue_index ( 0 ) );
386+ const unsigned exp_size = get_pending_bytes (ue_idx );
386387
387- const auto & test_ue = get_ue (to_du_ue_index ( 0 ) );
388+ const auto & test_ue = get_ue (ue_idx );
388389 bool is_ue_allocated_pdcch{false };
389390 bool is_ue_allocated_pdsch{false };
390391 for (unsigned sl_idx = 0 ; sl_idx < bench->max_test_run_slots_per_ue * (1U << current_slot.numerology ()); sl_idx++) {
@@ -399,6 +400,8 @@ TEST_P(fallback_scheduler_tester, test_large_srb0_buffer_size)
399400 }
400401 ASSERT_TRUE (is_ue_allocated_pdcch);
401402 ASSERT_TRUE (is_ue_allocated_pdsch);
403+
404+ ASSERT_FALSE (test_ue.has_pending_dl_newtx_bytes (LCID_SRB0));
402405}
403406
404407TEST_P (fallback_scheduler_tester, test_srb0_buffer_size_exceeding_max_msg4_mcs_index)
@@ -424,7 +427,8 @@ TEST_P(fallback_scheduler_tester, sanity_check_with_random_max_mcs_and_payload_s
424427 const sch_mcs_index max_msg4_mcs = get_random_uint (0 , 27 );
425428 setup_sched (create_expert_config (max_msg4_mcs), create_custom_cell_config_request (params.k0 ));
426429 // Add UE.
427- add_ue (to_rnti (0x4601 ), to_du_ue_index (0 ));
430+ const du_ue_index_t ue_idx = to_du_ue_index (0 );
431+ add_ue (to_rnti (0x4601 ), ue_idx);
428432 // Random payload size.
429433 const unsigned mac_srb0_sdu_size = get_random_uint (1 , 458 );
430434 push_buffer_state_to_dl_ue (to_du_ue_index (0 ), mac_srb0_sdu_size);
@@ -444,7 +448,7 @@ class fallback_scheduler_tdd_tester : public base_fallback_tester, public ::test
444448TEST_F (fallback_scheduler_tdd_tester, test_allocation_in_appropriate_slots_in_tdd)
445449{
446450 const unsigned k0 = 0 ;
447- const sch_mcs_index max_msg4_mcs_index = 1 ;
451+ const sch_mcs_index max_msg4_mcs_index = 5 ;
448452 auto cell_cfg = create_custom_cell_config_request (k0);
449453 setup_sched (create_expert_config (max_msg4_mcs_index), cell_cfg);
450454
@@ -477,6 +481,11 @@ TEST_F(fallback_scheduler_tdd_tester, test_allocation_in_appropriate_slots_in_td
477481 }
478482 }
479483 }
484+
485+ for (unsigned ue_idx = 0 ; ue_idx < MAX_UES; ue_idx++) {
486+ const auto & test_ue = get_ue (to_du_ue_index (ue_idx));
487+ ASSERT_FALSE (test_ue.has_pending_dl_newtx_bytes (LCID_SRB0)) << " UE " << ue_idx << " has still pending DL bytes" ;
488+ }
480489}
481490
482491TEST_F (fallback_scheduler_tdd_tester, test_allocation_in_partial_slots_tdd)
@@ -493,6 +502,9 @@ TEST_F(fallback_scheduler_tdd_tester, test_allocation_in_partial_slots_tdd)
493502 // Generate PDSCH Time domain allocation based on the partial slot TDD configuration.
494503 cell_cfg.dl_cfg_common .init_dl_bwp .pdsch_common .pdsch_td_alloc_list = config_helpers::make_pdsch_time_domain_resource (
495504 cell_cfg.searchspace0 , cell_cfg.dl_cfg_common .init_dl_bwp .pdcch_common , nullopt , cell_cfg.tdd_ul_dl_cfg_common );
505+ // Disabled CSI-RS resources, as this test uses a TDD configuration that is not compatible with CSI-RS scheduling.
506+ cell_cfg.nzp_csi_rs_res_list .clear ();
507+ cell_cfg.zp_csi_rs_list .clear ();
496508 setup_sched (create_expert_config (max_msg4_mcs_index), cell_cfg);
497509
498510 const unsigned MAX_TEST_RUN_SLOTS = 40 ;
@@ -502,7 +514,7 @@ TEST_F(fallback_scheduler_tdd_tester, test_allocation_in_partial_slots_tdd)
502514 add_ue (to_rnti (0x4601 ), to_du_ue_index (0 ));
503515
504516 for (unsigned idx = 0 ; idx < MAX_TEST_RUN_SLOTS * (1U << current_slot.numerology ()); idx++) {
505- run_slot (true );
517+ run_slot ();
506518 // Notify about SRB0 message in DL one slot before partial slot in order for it to be scheduled in the next
507519 // (partial) slot.
508520 if (bench->cell_cfg .is_dl_enabled (current_slot + 1 ) and
0 commit comments