From eb294fd4e3569e3713994b04ead16e02b1cdd6cf Mon Sep 17 00:00:00 2001 From: Fabian Eckermann Date: Thu, 30 Sep 2021 17:04:17 +0200 Subject: [PATCH] Add phy object to rrc_nr_test. --- srsenb/test/common/dummy_classes_nr.h | 6 ++++++ srsenb/test/rrc/rrc_nr_test.cc | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/srsenb/test/common/dummy_classes_nr.h b/srsenb/test/common/dummy_classes_nr.h index 1fb094db4..2148aa810 100644 --- a/srsenb/test/common/dummy_classes_nr.h +++ b/srsenb/test/common/dummy_classes_nr.h @@ -49,6 +49,12 @@ public: srsenb::sched_interface::cell_cfg_t cellcfgobj; }; +class phy_nr_dummy : public phy_interface_stack_nr +{ +public: + int set_common_cfg(const phy_interface_rrc_nr::common_cfg_t& common_cfg_) override { return SRSRAN_SUCCESS; } +}; + } // namespace srsenb #endif // SRSRAN_DUMMY_NR_CLASSES_H diff --git a/srsenb/test/rrc/rrc_nr_test.cc b/srsenb/test/rrc/rrc_nr_test.cc index 7df9b3a72..717f2a643 100644 --- a/srsenb/test/rrc/rrc_nr_test.cc +++ b/srsenb/test/rrc/rrc_nr_test.cc @@ -14,6 +14,7 @@ #include "srsenb/test/common/dummy_classes_common.h" #include "srsenb/test/common/dummy_classes_nr.h" #include "srsran/common/test_common.h" +#include "srsran/interfaces/gnb_rrc_nr_interfaces.h" #include using namespace asn1::rrc_nr; @@ -67,15 +68,19 @@ int test_rrc_setup() { srsran::task_scheduler task_sched; + phy_nr_dummy phy_obj; mac_nr_dummy mac_obj; rlc_dummy rlc_obj; pdcp_dummy pdcp_obj; rrc_nr rrc_obj(&task_sched); // set cfg - rrc_nr_cfg_t default_cfg = {}; - rrc_nr_cfg_t rrc_cfg = rrc_obj.update_default_cfg(default_cfg); - TESTASSERT(rrc_obj.init(rrc_cfg, nullptr, &mac_obj, &rlc_obj, &pdcp_obj, nullptr, nullptr, nullptr) == + rrc_nr_cfg_t default_cfg = {}; + rrc_cell_cfg_nr_t cell_cfg = {}; + rrc_nr_cfg_t rrc_cfg_nr = rrc_obj.update_default_cfg(default_cfg); + rrc_cfg_nr.cell_list.push_back(cell_cfg); + + TESTASSERT(rrc_obj.init(rrc_cfg_nr, &phy_obj, &mac_obj, &rlc_obj, &pdcp_obj, nullptr, nullptr, nullptr) == SRSRAN_SUCCESS); for (uint32_t n = 0; n < 2; ++n) {