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) 2014 Piotr Gawlowicz | 3 * Copyright (c) 2014 Piotr Gawlowicz |
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 NS_LOG_COMPONENT_DEFINE ("LteDownlinkPowerControlTest"); | 54 NS_LOG_COMPONENT_DEFINE ("LteDownlinkPowerControlTest"); |
55 | 55 |
56 /** | 56 /** |
57 * TestSuite | 57 * TestSuite |
58 */ | 58 */ |
59 | 59 |
60 LteDownlinkPowerControlTestSuite::LteDownlinkPowerControlTestSuite () | 60 LteDownlinkPowerControlTestSuite::LteDownlinkPowerControlTestSuite () |
61 : TestSuite ("lte-downlink-power-control", SYSTEM) | 61 : TestSuite ("lte-downlink-power-control", SYSTEM) |
62 { | 62 { |
63 #if 0 | 63 // LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL
_DEBUG); |
64 LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_D
EBUG); | 64 // LogComponentEnable ("LteDownlinkPowerControlTest", logLevel); |
65 LogComponentEnable ("LteDownlinkPowerControlTest", logLevel); | |
66 #endif | |
67 | |
68 NS_LOG_INFO ("Creating LteDownlinkPowerControlTestSuite"); | 65 NS_LOG_INFO ("Creating LteDownlinkPowerControlTestSuite"); |
69 | 66 |
70 // Spectrum helper test | 67 // Spectrum helper test |
71 { | 68 { |
72 std::vector<int> activeRbs_txpowdB30nrb6run1earfcn500 (4); | 69 std::vector<int> activeRbs_txpowdB30nrb6run1earfcn500 (4); |
73 activeRbs_txpowdB30nrb6run1earfcn500[0] = 0; | 70 activeRbs_txpowdB30nrb6run1earfcn500[0] = 0; |
74 activeRbs_txpowdB30nrb6run1earfcn500[1] = 2; | 71 activeRbs_txpowdB30nrb6run1earfcn500[1] = 2; |
75 activeRbs_txpowdB30nrb6run1earfcn500[2] = 3; | 72 activeRbs_txpowdB30nrb6run1earfcn500[2] = 3; |
76 activeRbs_txpowdB30nrb6run1earfcn500[3] = 5; | 73 activeRbs_txpowdB30nrb6run1earfcn500[3] = 5; |
77 | 74 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 "DataCtrlPowerDifference_dB1
"), TestCase::QUICK); | 327 "DataCtrlPowerDifference_dB1
"), TestCase::QUICK); |
331 AddTestCase (new LteDownlinkPowerControlTestCase (true, LteRrcSap::PdschConfig
Dedicated::dB2, | 328 AddTestCase (new LteDownlinkPowerControlTestCase (true, LteRrcSap::PdschConfig
Dedicated::dB2, |
332 "DataCtrlPowerDifference_dB2
"), TestCase::QUICK); | 329 "DataCtrlPowerDifference_dB2
"), TestCase::QUICK); |
333 AddTestCase (new LteDownlinkPowerControlTestCase (true, LteRrcSap::PdschConfig
Dedicated::dB3, | 330 AddTestCase (new LteDownlinkPowerControlTestCase (true, LteRrcSap::PdschConfig
Dedicated::dB3, |
334 "DataCtrlPowerDifference_dB3
"), TestCase::QUICK); | 331 "DataCtrlPowerDifference_dB3
"), TestCase::QUICK); |
335 | 332 |
336 | 333 |
337 // RrcConnectionReconfiguration test | 334 // RrcConnectionReconfiguration test |
338 AddTestCase (new LteDownlinkPowerControlRrcConnectionReconfigurationTestCase (
false, "RrcConnReconf-IdealRrc"), TestCase::QUICK); | 335 AddTestCase (new LteDownlinkPowerControlRrcConnectionReconfigurationTestCase (
false, "RrcConnReconf-IdealRrc"), TestCase::QUICK); |
339 AddTestCase (new LteDownlinkPowerControlRrcConnectionReconfigurationTestCase (
true, "RrcConnReconf-RealRrc"), TestCase::QUICK); | 336 AddTestCase (new LteDownlinkPowerControlRrcConnectionReconfigurationTestCase (
true, "RrcConnReconf-RealRrc"), TestCase::QUICK); |
| 337 |
| 338 |
340 } | 339 } |
341 | 340 |
342 double | 341 double |
343 LteDownlinkPowerControlTestSuite::CalculateRbTxPower (double txPower, uint8_t pa
) | 342 LteDownlinkPowerControlTestSuite::CalculateRbTxPower (double txPower, uint8_t pa
) |
344 { | 343 { |
345 LteRrcSap::PdschConfigDedicated pdschConfigDedicated; | 344 LteRrcSap::PdschConfigDedicated pdschConfigDedicated; |
346 pdschConfigDedicated.pa = pa; | 345 pdschConfigDedicated.pa = pa; |
347 double rbTxpower = txPower + LteRrcSap::ConvertPdschConfigDedicated2Double (pd
schConfigDedicated); | 346 double rbTxpower = txPower + LteRrcSap::ConvertPdschConfigDedicated2Double (pd
schConfigDedicated); |
348 | 347 |
349 return rbTxpower; | 348 return rbTxpower; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 | 503 |
505 } | 504 } |
506 | 505 |
507 LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::~LteDownlinkPowerCo
ntrolRrcConnectionReconfigurationTestCase () | 506 LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::~LteDownlinkPowerCo
ntrolRrcConnectionReconfigurationTestCase () |
508 { | 507 { |
509 } | 508 } |
510 | 509 |
511 void | 510 void |
512 LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::ConnectionReconfigu
rationEnb (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti) | 511 LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::ConnectionReconfigu
rationEnb (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti) |
513 { | 512 { |
514 NS_UNUSED(imsi); | 513 NS_UNUSED (imsi); |
515 NS_UNUSED(cellid); | 514 NS_UNUSED (cellid); |
516 NS_UNUSED(rnti); | 515 NS_UNUSED (rnti); |
517 if (Simulator::Now () > MilliSeconds (100)) | 516 if (Simulator::Now () > MilliSeconds (100)) |
518 { | 517 { |
519 NS_LOG_DEBUG ("eNb ConnectionReconfigurationCompleted"); | 518 NS_LOG_DEBUG ("eNb ConnectionReconfigurationCompleted"); |
520 m_connectionReconfigurationEnbCompleted = true; | 519 m_connectionReconfigurationEnbCompleted = true; |
521 } | 520 } |
522 } | 521 } |
523 | 522 |
524 void | 523 void |
525 LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::ConnectionReconfigu
rationUe (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti) | 524 LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::ConnectionReconfigu
rationUe (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti) |
526 { | 525 { |
527 NS_UNUSED(imsi); | 526 NS_UNUSED (imsi); |
528 NS_UNUSED(cellid); | 527 NS_UNUSED (cellid); |
529 NS_UNUSED(rnti); | 528 NS_UNUSED (rnti); |
530 if (Simulator::Now () > MilliSeconds (100)) | 529 if (Simulator::Now () > MilliSeconds (100)) |
531 { | 530 { |
532 NS_LOG_DEBUG ("Ue ConnectionReconfiguration"); | 531 NS_LOG_DEBUG ("Ue ConnectionReconfiguration"); |
533 m_connectionReconfigurationUeReceived = true; | 532 m_connectionReconfigurationUeReceived = true; |
534 } | 533 } |
535 } | 534 } |
536 | 535 |
537 void | 536 void |
538 LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::ChangePdschConfigDe
dicated (uint16_t rnti, uint8_t pa) | 537 LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::ChangePdschConfigDe
dicated (uint16_t rnti, uint8_t pa) |
539 { | 538 { |
540 NS_UNUSED(rnti); | 539 NS_UNUSED (rnti); |
541 NS_UNUSED(pa); | 540 NS_UNUSED (pa); |
542 NS_LOG_DEBUG ("FFR Algorithm ChangePdschConfigDedicated"); | 541 NS_LOG_DEBUG ("FFR Algorithm ChangePdschConfigDedicated"); |
543 m_changePdschConfigDedicatedTriggered = true; | 542 m_changePdschConfigDedicatedTriggered = true; |
544 } | 543 } |
545 | 544 |
546 void | 545 void |
547 LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::DoRun (void) | 546 LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::DoRun (void) |
548 { | 547 { |
549 Config::Reset (); | 548 Config::Reset (); |
550 Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (m_useIdealRrc
)); | 549 Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (m_useIdealRrc
)); |
551 | 550 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 NS_TEST_ASSERT_MSG_EQ (m_changePdschConfigDedicatedTriggered, true, | 603 NS_TEST_ASSERT_MSG_EQ (m_changePdschConfigDedicatedTriggered, true, |
605 "Ffr have not changed PdschConfigDedicated for UE"); | 604 "Ffr have not changed PdschConfigDedicated for UE"); |
606 NS_TEST_ASSERT_MSG_EQ (m_connectionReconfigurationUeReceived, true, | 605 NS_TEST_ASSERT_MSG_EQ (m_connectionReconfigurationUeReceived, true, |
607 "Ue have not received RrcConnectionReconfiguration"); | 606 "Ue have not received RrcConnectionReconfiguration"); |
608 NS_TEST_ASSERT_MSG_EQ (m_connectionReconfigurationEnbCompleted, true, | 607 NS_TEST_ASSERT_MSG_EQ (m_connectionReconfigurationEnbCompleted, true, |
609 "Enb have not received RrcConnectionReconfigurationComp
leted"); | 608 "Enb have not received RrcConnectionReconfigurationComp
leted"); |
610 | 609 |
611 Simulator::Destroy (); | 610 Simulator::Destroy (); |
612 } | 611 } |
613 | 612 |
LEFT | RIGHT |