LEFT | RIGHT |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 NS_LOG_COMPONENT_DEFINE ("LteUeMeasurementsTest"); | 58 NS_LOG_COMPONENT_DEFINE ("LteUeMeasurementsTest"); |
59 | 59 |
60 // ===== LTE-UE-MEASUREMENTS TEST SUITE ==================================== // | 60 // ===== LTE-UE-MEASUREMENTS TEST SUITE ==================================== // |
61 | 61 |
62 void | 62 void |
63 ReportUeMeasurementsCallback (LteUeMeasurementsTestCase *testcase, | 63 ReportUeMeasurementsCallback (LteUeMeasurementsTestCase *testcase, |
64 std::string path, uint16_t rnti, uint16_t cellId, | 64 std::string path, uint16_t rnti, uint16_t cellId, |
65 double rsrp, double rsrq, bool servingCell, uint8_
t componentCarrierId) | 65 double rsrp, double rsrq, bool servingCell, uint8_
t componentCarrierId) |
66 { | 66 { |
67 NS_UNUSED(componentCarrierId); | 67 NS_UNUSED (componentCarrierId); |
68 testcase->ReportUeMeasurements (rnti, cellId, rsrp, rsrq, servingCell); | 68 testcase->ReportUeMeasurements (rnti, cellId, rsrp, rsrq, servingCell); |
69 } | 69 } |
70 | 70 |
71 void | 71 void |
72 RecvMeasurementReportCallback (LteUeMeasurementsTestCase *testcase, | 72 RecvMeasurementReportCallback (LteUeMeasurementsTestCase *testcase, |
73 std::string path, uint64_t imsi, uint16_t cellId, | 73 std::string path, uint64_t imsi, uint16_t cellId, |
74 uint16_t rnti, LteRrcSap::MeasurementReport meas) | 74 uint16_t rnti, LteRrcSap::MeasurementReport meas) |
75 { | 75 { |
76 testcase->RecvMeasurementReport (imsi, cellId, rnti, meas); | 76 testcase->RecvMeasurementReport (imsi, cellId, rnti, meas); |
77 } | 77 } |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 Simulator::Destroy (); | 216 Simulator::Destroy (); |
217 | 217 |
218 } | 218 } |
219 | 219 |
220 void | 220 void |
221 LteUeMeasurementsTestCase::ReportUeMeasurements (uint16_t rnti, uint16_t cellId, | 221 LteUeMeasurementsTestCase::ReportUeMeasurements (uint16_t rnti, uint16_t cellId, |
222 double rsrp, double rsrq, | 222 double rsrp, double rsrq, |
223 bool servingCell) | 223 bool servingCell) |
224 { | 224 { |
225 NS_UNUSED(rnti); | 225 NS_UNUSED (rnti); |
226 // need to allow for RRC connection establishment + CQI feedback reception + U
E measurements filtering (200 ms) | 226 // need to allow for RRC connection establishment + CQI feedback reception + U
E measurements filtering (200 ms) |
227 if (Simulator::Now () > MilliSeconds (400)) | 227 if (Simulator::Now () > MilliSeconds (400)) |
228 { | 228 { |
229 if (servingCell) | 229 if (servingCell) |
230 { | 230 { |
231 NS_LOG_DEBUG ("UE serving cellId " << cellId << " Rxed RSRP " << rsrp
<< " thr " << m_rsrpDbmUeServingCell << " RSRQ " << rsrq << " thr " << m_rsrqDbU
eServingCell); | 231 NS_LOG_DEBUG ("UE serving cellId " << cellId << " Rxed RSRP " << rsrp
<< " thr " << m_rsrpDbmUeServingCell << " RSRQ " << rsrq << " thr " << m_rsrqDbU
eServingCell); |
232 NS_TEST_ASSERT_MSG_EQ_TOL (m_rsrpDbmUeServingCell, rsrp, 0.2, "Wrong R
SRP UE 1"); | 232 NS_TEST_ASSERT_MSG_EQ_TOL (m_rsrpDbmUeServingCell, rsrp, 0.2, "Wrong R
SRP UE 1"); |
233 NS_TEST_ASSERT_MSG_EQ_TOL (m_rsrqDbUeServingCell, rsrq, 0.2, "Wrong RS
RQ UE 1"); | 233 NS_TEST_ASSERT_MSG_EQ_TOL (m_rsrqDbUeServingCell, rsrq, 0.2, "Wrong RS
RQ UE 1"); |
234 } | 234 } |
235 else | 235 else |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 | 521 |
522 LteUeMeasurementsPiecewiseTestCase1::LteUeMeasurementsPiecewiseTestCase1 ( | 522 LteUeMeasurementsPiecewiseTestCase1::LteUeMeasurementsPiecewiseTestCase1 ( |
523 std::string name, LteRrcSap::ReportConfigEutra config, | 523 std::string name, LteRrcSap::ReportConfigEutra config, |
524 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp) | 524 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp) |
525 : TestCase (name), | 525 : TestCase (name), |
526 m_config (config), | 526 m_config (config), |
527 m_expectedTime (expectedTime), | 527 m_expectedTime (expectedTime), |
528 m_expectedRsrp (expectedRsrp) | 528 m_expectedRsrp (expectedRsrp) |
529 { | 529 { |
530 // input sanity check | 530 // input sanity check |
531 uint16_t size = static_cast<uint16_t>(m_expectedTime.size ()); | 531 uint16_t size = static_cast<uint16_t> (m_expectedTime.size ()); |
532 | 532 |
533 if (size != m_expectedRsrp.size ()) | 533 if (size != m_expectedRsrp.size ()) |
534 { | 534 { |
535 NS_FATAL_ERROR ("Vectors of expected results are not of the same size"); | 535 NS_FATAL_ERROR ("Vectors of expected results are not of the same size"); |
536 } | 536 } |
537 | 537 |
538 m_itExpectedTime = m_expectedTime.begin (); | 538 m_itExpectedTime = m_expectedTime.begin (); |
539 m_itExpectedRsrp = m_expectedRsrp.begin (); | 539 m_itExpectedRsrp = m_expectedRsrp.begin (); |
540 | 540 |
541 NS_LOG_INFO (this << " name=" << name); | 541 NS_LOG_INFO (this << " name=" << name); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 hasEnded = m_itExpectedRsrp == m_expectedRsrp.end (); | 663 hasEnded = m_itExpectedRsrp == m_expectedRsrp.end (); |
664 NS_ASSERT (hasEnded); | 664 NS_ASSERT (hasEnded); |
665 } | 665 } |
666 | 666 |
667 void | 667 void |
668 LteUeMeasurementsPiecewiseTestCase1::RecvMeasurementReportCallback ( | 668 LteUeMeasurementsPiecewiseTestCase1::RecvMeasurementReportCallback ( |
669 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, | 669 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, |
670 LteRrcSap::MeasurementReport report) | 670 LteRrcSap::MeasurementReport report) |
671 { | 671 { |
672 NS_LOG_FUNCTION (this << context); | 672 NS_LOG_FUNCTION (this << context); |
673 NS_UNUSED(imsi); | 673 NS_UNUSED (imsi); |
674 NS_ASSERT (rnti == 1); | 674 NS_ASSERT (rnti == 1); |
675 (void)rnti; // make compiler happy | 675 (void)rnti; // make compiler happy |
676 NS_ASSERT (cellId == 1); | 676 NS_ASSERT (cellId == 1); |
677 (void)cellId; //make compiler happy | 677 (void)cellId; //make compiler happy |
678 | 678 |
679 if (report.measResults.measId == m_expectedMeasId) | 679 if (report.measResults.measId == m_expectedMeasId) |
680 { | 680 { |
681 // verifying the report completeness | 681 // verifying the report completeness |
682 LteRrcSap::MeasResults measResults = report.measResults; | 682 LteRrcSap::MeasResults measResults = report.measResults; |
683 NS_LOG_DEBUG (this << " rsrp=" << (uint16_t) measResults.rsrpResult | 683 NS_LOG_DEBUG (this << " rsrp=" << (uint16_t) measResults.rsrpResult |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 | 1109 |
1110 LteUeMeasurementsPiecewiseTestCase2::LteUeMeasurementsPiecewiseTestCase2 ( | 1110 LteUeMeasurementsPiecewiseTestCase2::LteUeMeasurementsPiecewiseTestCase2 ( |
1111 std::string name, LteRrcSap::ReportConfigEutra config, | 1111 std::string name, LteRrcSap::ReportConfigEutra config, |
1112 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp) | 1112 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp) |
1113 : TestCase (name), | 1113 : TestCase (name), |
1114 m_config (config), | 1114 m_config (config), |
1115 m_expectedTime (expectedTime), | 1115 m_expectedTime (expectedTime), |
1116 m_expectedRsrp (expectedRsrp) | 1116 m_expectedRsrp (expectedRsrp) |
1117 { | 1117 { |
1118 // input sanity check | 1118 // input sanity check |
1119 uint16_t size = static_cast<uint16_t>(m_expectedTime.size ()); | 1119 uint16_t size = static_cast<uint16_t> (m_expectedTime.size ()); |
1120 | 1120 |
1121 if (size != m_expectedRsrp.size ()) | 1121 if (size != m_expectedRsrp.size ()) |
1122 { | 1122 { |
1123 NS_FATAL_ERROR ("Vectors of expected results are not of the same size"); | 1123 NS_FATAL_ERROR ("Vectors of expected results are not of the same size"); |
1124 } | 1124 } |
1125 | 1125 |
1126 m_itExpectedTime = m_expectedTime.begin (); | 1126 m_itExpectedTime = m_expectedTime.begin (); |
1127 m_itExpectedRsrp = m_expectedRsrp.begin (); | 1127 m_itExpectedRsrp = m_expectedRsrp.begin (); |
1128 | 1128 |
1129 NS_LOG_INFO (this << " name=" << name); | 1129 NS_LOG_INFO (this << " name=" << name); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1256 hasEnded = m_itExpectedRsrp == m_expectedRsrp.end (); | 1256 hasEnded = m_itExpectedRsrp == m_expectedRsrp.end (); |
1257 NS_ASSERT (hasEnded); | 1257 NS_ASSERT (hasEnded); |
1258 } | 1258 } |
1259 | 1259 |
1260 void | 1260 void |
1261 LteUeMeasurementsPiecewiseTestCase2::RecvMeasurementReportCallback ( | 1261 LteUeMeasurementsPiecewiseTestCase2::RecvMeasurementReportCallback ( |
1262 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, | 1262 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, |
1263 LteRrcSap::MeasurementReport report) | 1263 LteRrcSap::MeasurementReport report) |
1264 { | 1264 { |
1265 NS_LOG_FUNCTION (this << context); | 1265 NS_LOG_FUNCTION (this << context); |
1266 NS_UNUSED(imsi); | 1266 NS_UNUSED (imsi); |
1267 NS_ASSERT (rnti == 1); | 1267 NS_ASSERT (rnti == 1); |
1268 (void)rnti; // make compiler happy | 1268 (void)rnti; // make compiler happy |
1269 NS_ASSERT (cellId == 1); | 1269 NS_ASSERT (cellId == 1); |
1270 (void)cellId; // make compiler happy | 1270 (void)cellId; // make compiler happy |
1271 | 1271 |
1272 if (report.measResults.measId == m_expectedMeasId) | 1272 if (report.measResults.measId == m_expectedMeasId) |
1273 { | 1273 { |
1274 // verifying the report completeness | 1274 // verifying the report completeness |
1275 LteRrcSap::MeasResults measResults = report.measResults; | 1275 LteRrcSap::MeasResults measResults = report.measResults; |
1276 NS_LOG_DEBUG (this << " Serving cellId=" << cellId | 1276 NS_LOG_DEBUG (this << " Serving cellId=" << cellId |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp, | 1663 std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp, |
1664 Time duration) | 1664 Time duration) |
1665 : TestCase (name), | 1665 : TestCase (name), |
1666 m_sourceConfigList (sourceConfigList), | 1666 m_sourceConfigList (sourceConfigList), |
1667 m_targetConfigList (targetConfigList), | 1667 m_targetConfigList (targetConfigList), |
1668 m_expectedTime (expectedTime), | 1668 m_expectedTime (expectedTime), |
1669 m_expectedRsrp (expectedRsrp), | 1669 m_expectedRsrp (expectedRsrp), |
1670 m_duration (duration) | 1670 m_duration (duration) |
1671 { | 1671 { |
1672 // input sanity check | 1672 // input sanity check |
1673 uint16_t size = static_cast<uint16_t>(m_expectedTime.size ()); | 1673 uint16_t size = static_cast<uint16_t> (m_expectedTime.size ()); |
1674 | 1674 |
1675 if (size != m_expectedRsrp.size ()) | 1675 if (size != m_expectedRsrp.size ()) |
1676 { | 1676 { |
1677 NS_FATAL_ERROR ("Vectors of expected results are not of the same size"); | 1677 NS_FATAL_ERROR ("Vectors of expected results are not of the same size"); |
1678 } | 1678 } |
1679 | 1679 |
1680 m_itExpectedTime = m_expectedTime.begin (); | 1680 m_itExpectedTime = m_expectedTime.begin (); |
1681 m_itExpectedRsrp = m_expectedRsrp.begin (); | 1681 m_itExpectedRsrp = m_expectedRsrp.begin (); |
1682 | 1682 |
1683 NS_LOG_INFO (this << " name=" << name); | 1683 NS_LOG_INFO (this << " name=" << name); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1838 "Reporting should have occurred at " << m_itExpectedTim
e->GetSeconds () << "s"); | 1838 "Reporting should have occurred at " << m_itExpectedTim
e->GetSeconds () << "s"); |
1839 hasEnded = m_itExpectedRsrp == m_expectedRsrp.end (); | 1839 hasEnded = m_itExpectedRsrp == m_expectedRsrp.end (); |
1840 NS_ASSERT (hasEnded); | 1840 NS_ASSERT (hasEnded); |
1841 } | 1841 } |
1842 | 1842 |
1843 void | 1843 void |
1844 LteUeMeasurementsHandoverTestCase::RecvMeasurementReportCallback ( | 1844 LteUeMeasurementsHandoverTestCase::RecvMeasurementReportCallback ( |
1845 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, | 1845 std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, |
1846 LteRrcSap::MeasurementReport report) | 1846 LteRrcSap::MeasurementReport report) |
1847 { | 1847 { |
1848 NS_UNUSED(imsi); | 1848 NS_UNUSED (imsi); |
1849 NS_UNUSED(rnti); | 1849 NS_UNUSED (rnti); |
1850 uint8_t measId = report.measResults.measId; | 1850 uint8_t measId = report.measResults.measId; |
1851 NS_LOG_FUNCTION (this << context << (uint16_t) measId); | 1851 NS_LOG_FUNCTION (this << context << (uint16_t) measId); |
1852 | 1852 |
1853 bool isCorrectMeasId; | 1853 bool isCorrectMeasId; |
1854 if (cellId == 1) | 1854 if (cellId == 1) |
1855 { | 1855 { |
1856 std::set<uint8_t>::iterator itMeasId = m_expectedSourceCellMeasId.find (me
asId); | 1856 std::set<uint8_t>::iterator itMeasId = m_expectedSourceCellMeasId.find (me
asId); |
1857 isCorrectMeasId = (itMeasId != m_expectedSourceCellMeasId.end ()); | 1857 isCorrectMeasId = (itMeasId != m_expectedSourceCellMeasId.end ()); |
1858 } | 1858 } |
1859 else if (cellId == 2) | 1859 else if (cellId == 2) |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1926 NS_TEST_ASSERT_MSG_EQ (timeNowMs, timeExpectedMs, | 1926 NS_TEST_ASSERT_MSG_EQ (timeNowMs, timeExpectedMs, |
1927 "Reporting should not have occurred at this tim
e"); | 1927 "Reporting should not have occurred at this tim
e"); |
1928 NS_TEST_ASSERT_MSG_EQ (observedRsrp, referenceRsrp, | 1928 NS_TEST_ASSERT_MSG_EQ (observedRsrp, referenceRsrp, |
1929 "The RSRP observed differs with the reference R
SRP"); | 1929 "The RSRP observed differs with the reference R
SRP"); |
1930 | 1930 |
1931 } // end of if (!hasEnded) | 1931 } // end of if (!hasEnded) |
1932 | 1932 |
1933 } // end of if (report.measResults.measId == correctMeasId) | 1933 } // end of if (report.measResults.measId == correctMeasId) |
1934 | 1934 |
1935 } // end of void LteUeMeasurementsHandoverTestCase::RecvMeasurementReportCallbac
k | 1935 } // end of void LteUeMeasurementsHandoverTestCase::RecvMeasurementReportCallbac
k |
LEFT | RIGHT |