From 0f166ce739883154921b9173ea66c2c774033896 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Tue, 17 Sep 2019 17:34:47 +0100 Subject: [PATCH] fixed mac_test --- srsue/test/mac_test.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/srsue/test/mac_test.cc b/srsue/test/mac_test.cc index b3826ac58..7e328cbbc 100644 --- a/srsue/test/mac_test.cc +++ b/srsue/test/mac_test.cc @@ -328,7 +328,12 @@ public: class stack_dummy : public stack_interface_mac { - void process_pdus() final {} +public: + void init(mac* mac_) { mac_h = mac_; } + void process_pdus() final { mac_h->process_pdus(); } + +private: + mac* mac_h = nullptr; }; } // namespace srslte @@ -370,6 +375,7 @@ int mac_unpack_test() // the actual MAC mac mac(&mac_log); + stack.init(&mac); mac.init(&phy, &rlc, &rrc, &timers, &stack); // create dummy DL action and grant and push MAC PDU @@ -428,6 +434,7 @@ int mac_ul_sch_pdu_test1() // the actual MAC mac mac(&mac_log); + stack.init(&mac); mac.init(&phy, &rlc, &rrc, &timers, &stack); const uint16_t crnti = 0x1001; mac.set_ho_rnti(crnti, 0); @@ -497,6 +504,7 @@ int mac_ul_logical_channel_prioritization_test1() // the actual MAC mac mac(&mac_log); + stack.init(&mac); mac.init(&phy, &rlc, &rrc, &timers, &stack); const uint16_t crnti = 0x1001; mac.set_ho_rnti(crnti, 0); @@ -611,6 +619,7 @@ int mac_ul_logical_channel_prioritization_test2() // the actual MAC mac mac(&mac_log); + stack.init(&mac); mac.init(&phy, &rlc, &rrc, &timers, &stack); const uint16_t crnti = 0x1001; mac.set_ho_rnti(crnti, 0); @@ -712,6 +721,7 @@ int mac_ul_logical_channel_prioritization_test3() // the actual MAC mac mac(&mac_log); + stack.init(&mac); mac.init(&phy, &rlc, &rrc, &timers, &stack); const uint16_t crnti = 0x1001; mac.set_ho_rnti(crnti, 0); @@ -801,6 +811,7 @@ int mac_ul_sch_pdu_with_short_bsr_test() // the actual MAC mac mac(&mac_log); + stack.init(&mac); mac.init(&phy, &rlc, &rrc, &timers, &stack); const uint16_t crnti = 0x1001; mac.set_ho_rnti(crnti, 0); @@ -888,6 +899,7 @@ int mac_ul_sch_pdu_with_padding_bsr_test() // the actual MAC mac mac(&mac_log); + stack.init(&mac); mac.init(&phy, &rlc, &rrc, &timers, &stack); const uint16_t crnti = 0x1001; mac.set_ho_rnti(crnti, 0); @@ -984,6 +996,7 @@ int mac_ul_sch_pdu_one_byte_test() // the actual MAC mac mac(&mac_log); + stack.init(&mac); mac.init(&phy, &rlc, &rrc, &timers, &stack); const uint16_t crnti = 0x1001; mac.set_ho_rnti(crnti, 0); @@ -1045,6 +1058,7 @@ int mac_ul_sch_pdu_two_byte_test() // the actual MAC mac mac(&mac_log); + stack.init(&mac); mac.init(&phy, &rlc, &rrc, &timers, &stack); const uint16_t crnti = 0x1001; mac.set_ho_rnti(crnti, 0); @@ -1106,6 +1120,7 @@ int mac_ul_sch_pdu_three_byte_test() // the actual MAC mac mac(&mac_log); + stack.init(&mac); mac.init(&phy, &rlc, &rrc, &timers, &stack); const uint16_t crnti = 0x1001; mac.set_ho_rnti(crnti, 0); @@ -1360,6 +1375,7 @@ int mac_random_access_test() // Configure MAC mac mac(&mac_log); + stack.init(&mac); mac.init(&phy, &rlc, &rrc, &timers, &stack); srslte::mac_cfg_t mac_cfg; set_mac_cfg_t_rach_cfg_common(&mac_cfg, rach_cfg);