Skip to content

Commit fff0f60

Browse files
committed
sched: fix scheduler_tdd_test crc ind generation
1 parent 0c628e5 commit fff0f60

File tree

2 files changed

+13
-48
lines changed

2 files changed

+13
-48
lines changed

tests/unittests/scheduler/scheduler_ta_cmd_test.cpp

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,10 @@ class scheduler_ta_cmd_tester : public scheduler_test_simulator, public ::testin
2323
scheduler_ta_cmd_tester() :
2424
scheduler_test_simulator(4, GetParam() == duplex_mode::FDD ? subcarrier_spacing::kHz15 : subcarrier_spacing::kHz30)
2525
{
26-
// Add Cell.
27-
this->add_cell([this, duplex_mode = GetParam()]() {
28-
params =
29-
duplex_mode == duplex_mode::FDD ? cell_config_builder_profiles::fdd() : cell_config_builder_profiles::tdd();
30-
31-
sched_cell_configuration_request_message sched_cfg_req =
32-
sched_config_helper::make_default_sched_cell_configuration_request(params);
26+
params = GetParam() == duplex_mode::FDD ? cell_config_builder_profiles::fdd() : cell_config_builder_profiles::tdd();
3327

34-
return sched_cfg_req;
35-
}());
28+
// Add Cell.
29+
this->add_cell(sched_config_helper::make_default_sched_cell_configuration_request(params));
3630

3731
// Add UE
3832
this->add_ue(sched_config_helper::create_default_sched_ue_creation_request(params, {ue_drb_lcid}));
@@ -47,32 +41,16 @@ class scheduler_ta_cmd_tester : public scheduler_test_simulator, public ::testin
4741
uci_indication uci_ind{};
4842
uci_ind.cell_index = to_du_cell_index(0);
4943
uci_ind.slot_rx = uci_sl;
50-
uci_ind.ucis.resize(1);
51-
uci_ind.ucis[0].crnti = pucch_pdu.crnti;
52-
uci_ind.ucis[0].ue_index = ue_index;
53-
switch (pucch_pdu.format()) {
54-
case pucch_format::FORMAT_1: {
55-
uci_indication::uci_pdu::uci_pucch_f0_or_f1_pdu f1{};
56-
f1.harqs.resize(pucch_pdu.uci_bits.harq_ack_nof_bits);
57-
std::fill(f1.harqs.begin(), f1.harqs.end(), mac_harq_ack_report_status::ack);
58-
f1.ul_sinr_dB = ul_sinr;
59-
f1.time_advance_offset = phy_time_unit::from_units_of_Tc(time_advance_offset_in_tc);
60-
uci_ind.ucis[0].pdu = f1;
61-
} break;
62-
case pucch_format::FORMAT_2: {
63-
uci_indication::uci_pdu::uci_pucch_f2_or_f3_or_f4_pdu f2{};
64-
f2.harqs.resize(pucch_pdu.uci_bits.harq_ack_nof_bits);
65-
std::fill(f2.harqs.begin(), f2.harqs.end(), mac_harq_ack_report_status::ack);
66-
f2.ul_sinr_dB = ul_sinr;
67-
f2.time_advance_offset = phy_time_unit::from_units_of_Tc(time_advance_offset_in_tc);
68-
uci_ind.ucis[0].pdu = f2;
69-
if (pucch_pdu.uci_bits.csi_part1_nof_bits > 0) {
70-
f2.csi.emplace();
71-
f2.csi->first_tb_wideband_cqi = 15;
72-
}
73-
} break;
74-
default:
75-
report_fatal_error("Unsupported PUCCH format");
44+
uci_ind.ucis.push_back(test_helper::create_uci_indication_pdu(ue_index, pucch_pdu));
45+
if (auto* f0_f1 = std::get_if<uci_indication::uci_pdu::uci_pucch_f0_or_f1_pdu>(&uci_ind.ucis[0].pdu)) {
46+
f0_f1->ul_sinr_dB = ul_sinr;
47+
f0_f1->time_advance_offset = phy_time_unit::from_units_of_Tc(time_advance_offset_in_tc);
48+
} else if (auto* f2_f3_f4 =
49+
std::get_if<uci_indication::uci_pdu::uci_pucch_f2_or_f3_or_f4_pdu>(&uci_ind.ucis[0].pdu)) {
50+
f2_f3_f4->ul_sinr_dB = ul_sinr;
51+
f2_f3_f4->time_advance_offset = phy_time_unit::from_units_of_Tc(time_advance_offset_in_tc);
52+
} else {
53+
report_fatal_error("Unsupported PUCCH format");
7654
}
7755
return uci_ind;
7856
}

tests/unittests/scheduler/scheduler_tdd_test.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,6 @@ TEST_P(scheduler_ul_tdd_tester, all_ul_slots_are_scheduled)
136136
ASSERT_FALSE(this->last_sched_res_list[to_du_cell_index(0)]->ul.puschs.empty()) << fmt::format(
137137
"The UE configuration is leading to slot {} not having UL UE grant scheduled", this->last_result_slot());
138138
}
139-
140-
for (const ul_sched_info& pusch : this->last_sched_res_list[to_du_cell_index(0)]->ul.puschs) {
141-
ul_crc_indication crc{};
142-
crc.cell_index = to_du_cell_index(0);
143-
crc.sl_rx = this->last_result_slot();
144-
crc.crcs.resize(1);
145-
crc.crcs[0].ue_index = ue_idx;
146-
crc.crcs[0].rnti = ue_rnti;
147-
crc.crcs[0].harq_id = to_harq_id(pusch.pusch_cfg.harq_id);
148-
crc.crcs[0].tb_crc_success = true;
149-
crc.crcs[0].ul_sinr_dB = 100;
150-
this->sched->handle_crc_indication(crc);
151-
}
152139
}
153140
}
154141

0 commit comments

Comments
 (0)