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) 2013 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 3 * Copyright (c) 2013 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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 UeManager::State ueManagerState = ueManager->GetState (); | 583 UeManager::State ueManagerState = ueManager->GetState (); |
584 NS_TEST_ASSERT_MSG_EQ (ueManagerState, UeManager::CONNECTED_NORMALLY, "Wrong U
eManager state!"); | 584 NS_TEST_ASSERT_MSG_EQ (ueManagerState, UeManager::CONNECTED_NORMALLY, "Wrong U
eManager state!"); |
585 NS_ASSERT_MSG (ueManagerState == UeManager::CONNECTED_NORMALLY, "Wrong UeManag
er state!"); | 585 NS_ASSERT_MSG (ueManagerState == UeManager::CONNECTED_NORMALLY, "Wrong UeManag
er state!"); |
586 | 586 |
587 uint16_t ueCellId = ueRrc->GetCellId (); | 587 uint16_t ueCellId = ueRrc->GetCellId (); |
588 uint16_t enbCellId = enbLteDevice->GetCellId (); | 588 uint16_t enbCellId = enbLteDevice->GetCellId (); |
589 uint8_t ueDlBandwidth = ueRrc->GetDlBandwidth (); | 589 uint8_t ueDlBandwidth = ueRrc->GetDlBandwidth (); |
590 uint8_t enbDlBandwidth = enbLteDevice->GetDlBandwidth (); | 590 uint8_t enbDlBandwidth = enbLteDevice->GetDlBandwidth (); |
591 uint8_t ueUlBandwidth = ueRrc->GetUlBandwidth (); | 591 uint8_t ueUlBandwidth = ueRrc->GetUlBandwidth (); |
592 uint8_t enbUlBandwidth = enbLteDevice->GetUlBandwidth (); | 592 uint8_t enbUlBandwidth = enbLteDevice->GetUlBandwidth (); |
593 uint8_t ueDlEarfcn = (uint8_t)ueRrc->GetDlEarfcn (); | 593 uint8_t ueDlEarfcn = static_cast<uint8_t> (ueRrc->GetDlEarfcn ()); |
594 uint8_t enbDlEarfcn = (uint8_t)enbLteDevice->GetDlEarfcn (); | 594 uint8_t enbDlEarfcn = static_cast<uint8_t> (enbLteDevice->GetDlEarfcn ()); |
595 uint8_t ueUlEarfcn = (uint8_t)ueRrc->GetUlEarfcn (); | 595 uint8_t ueUlEarfcn = static_cast<uint8_t> (ueRrc->GetUlEarfcn ()); |
596 uint8_t enbUlEarfcn = (uint8_t)enbLteDevice->GetUlEarfcn (); | 596 uint8_t enbUlEarfcn = static_cast<uint8_t> (enbLteDevice->GetUlEarfcn ()); |
597 uint64_t ueImsi = ueLteDevice->GetImsi (); | 597 uint64_t ueImsi = ueLteDevice->GetImsi (); |
598 uint64_t enbImsi = ueManager->GetImsi (); | 598 uint64_t enbImsi = ueManager->GetImsi (); |
599 | 599 |
600 NS_TEST_ASSERT_MSG_EQ (ueImsi, enbImsi, "inconsistent IMSI"); | 600 NS_TEST_ASSERT_MSG_EQ (ueImsi, enbImsi, "inconsistent IMSI"); |
601 NS_TEST_ASSERT_MSG_EQ (ueCellId, enbCellId, "inconsistent CellId"); | 601 NS_TEST_ASSERT_MSG_EQ (ueCellId, enbCellId, "inconsistent CellId"); |
602 NS_TEST_ASSERT_MSG_EQ (ueDlBandwidth, enbDlBandwidth, "inconsistent DlBandwidt
h"); | 602 NS_TEST_ASSERT_MSG_EQ (ueDlBandwidth, enbDlBandwidth, "inconsistent DlBandwidt
h"); |
603 NS_TEST_ASSERT_MSG_EQ (ueUlBandwidth, enbUlBandwidth, "inconsistent UlBandwidt
h"); | 603 NS_TEST_ASSERT_MSG_EQ (ueUlBandwidth, enbUlBandwidth, "inconsistent UlBandwidt
h"); |
604 NS_TEST_ASSERT_MSG_EQ (ueDlEarfcn, enbDlEarfcn, "inconsistent DlEarfcn"); | 604 NS_TEST_ASSERT_MSG_EQ (ueDlEarfcn, enbDlEarfcn, "inconsistent DlEarfcn"); |
605 NS_TEST_ASSERT_MSG_EQ (ueUlEarfcn, enbUlEarfcn, "inconsistent UlEarfcn"); | 605 NS_TEST_ASSERT_MSG_EQ (ueUlEarfcn, enbUlEarfcn, "inconsistent UlEarfcn"); |
606 | 606 |
(...skipping 29 matching lines...) Expand all Loading... |
636 void | 636 void |
637 LteX2HandoverMeasuresTestCase::SaveStats (uint32_t ueIndex) | 637 LteX2HandoverMeasuresTestCase::SaveStats (uint32_t ueIndex) |
638 { | 638 { |
639 NS_LOG_FUNCTION (ueIndex); | 639 NS_LOG_FUNCTION (ueIndex); |
640 for (std::list<BearerData>::iterator it = m_ueDataVector.at (ueIndex).bearerDa
taList.begin (); | 640 for (std::list<BearerData>::iterator it = m_ueDataVector.at (ueIndex).bearerDa
taList.begin (); |
641 it != m_ueDataVector.at (ueIndex).bearerDataList.end (); | 641 it != m_ueDataVector.at (ueIndex).bearerDataList.end (); |
642 ++it) | 642 ++it) |
643 { | 643 { |
644 if (it->dlSink) | 644 if (it->dlSink) |
645 { | 645 { |
646 it->dlOldTotalRx = (uint32_t)it->dlSink->GetTotalRx (); | 646 it->dlOldTotalRx = static_cast<uint32_t> (it->dlSink->GetTotalRx ()); |
647 } | 647 } |
648 if (it->ulSink) | 648 if (it->ulSink) |
649 { | 649 { |
650 it->ulOldTotalRx = (uint32_t)it->ulSink->GetTotalRx (); | 650 it->ulOldTotalRx = static_cast<uint32_t> (it->ulSink->GetTotalRx ()); |
651 } | 651 } |
652 } | 652 } |
653 } | 653 } |
654 | 654 |
655 void | 655 void |
656 LteX2HandoverMeasuresTestCase::CheckStats (uint32_t ueIndex) | 656 LteX2HandoverMeasuresTestCase::CheckStats (uint32_t ueIndex) |
657 { | 657 { |
658 NS_LOG_FUNCTION (ueIndex); | 658 NS_LOG_FUNCTION (ueIndex); |
659 uint32_t b = 1; | 659 uint32_t b = 1; |
660 for (std::list<BearerData>::iterator it = m_ueDataVector.at (ueIndex).bearerDa
taList.begin (); | 660 for (std::list<BearerData>::iterator it = m_ueDataVector.at (ueIndex).bearerDa
taList.begin (); |
661 it != m_ueDataVector.at (ueIndex).bearerDataList.end (); | 661 it != m_ueDataVector.at (ueIndex).bearerDataList.end (); |
662 ++it) | 662 ++it) |
663 { | 663 { |
664 uint32_t dlRx = 0; | 664 uint32_t dlRx = 0; |
665 uint32_t ulRx = 0; | 665 uint32_t ulRx = 0; |
666 | 666 |
667 if (it->dlSink) | 667 if (it->dlSink) |
668 { | 668 { |
669 dlRx = (uint32_t)(it->dlSink->GetTotalRx () - it->dlOldTotalRx); | 669 dlRx = static_cast<uint32_t> (it->dlSink->GetTotalRx () - it->dlOldTot
alRx); |
670 } | 670 } |
671 | 671 |
672 if (it->ulSink) | 672 if (it->ulSink) |
673 { | 673 { |
674 ulRx = (uint32_t)(it->ulSink->GetTotalRx () - it->ulOldTotalRx); | 674 ulRx = static_cast<uint32_t> (it->ulSink->GetTotalRx () - it->ulOldTot
alRx); |
675 } | 675 } |
676 double expectedBytes = m_udpClientPktSize * (m_statsDuration.GetSeconds ()
/ m_udpClientInterval.GetSeconds ()); | 676 double expectedBytes = m_udpClientPktSize * (m_statsDuration.GetSeconds ()
/ m_udpClientInterval.GetSeconds ()); |
677 | 677 |
678 NS_LOG_LOGIC ("expBytes " << expectedBytes << " dlRx " << dlRx << " ulRx "
<< ulRx); | 678 NS_LOG_LOGIC ("expBytes " << expectedBytes << " dlRx " << dlRx << " ulRx "
<< ulRx); |
679 | 679 |
680 // tolerance | 680 // tolerance |
681 if (it->dlSink) | 681 if (it->dlSink) |
682 { | 682 { |
683 NS_TEST_ASSERT_MSG_GT (dlRx, 0.500 * expectedBytes, "too few RX byte
s in DL, ue=" << ueIndex << ", b=" << b); | 683 NS_TEST_ASSERT_MSG_GT (dlRx, 0.500 * expectedBytes, "too few RX byte
s in DL, ue=" << ueIndex << ", b=" << b); |
684 } | 684 } |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 { | 769 { |
770 // nEnbs, nUes, nDBearers, celist
, name, useUdp, sched, admitHo, idealRrc | 770 // nEnbs, nUes, nDBearers, celist
, name, useUdp, sched, admitHo, idealRrc |
771 AddTestCase (new LteX2HandoverMeasuresTestCase (2, 1, 0, cel1, cel
1name, true, sched, ho, true, useIdealRrc), TestCase::QUICK); | 771 AddTestCase (new LteX2HandoverMeasuresTestCase (2, 1, 0, cel1, cel
1name, true, sched, ho, true, useIdealRrc), TestCase::QUICK); |
772 AddTestCase (new LteX2HandoverMeasuresTestCase (3, 1, 0, cel2, cel
2name, true, sched, ho, true, useIdealRrc), TestCase::TAKES_FOREVER); | 772 AddTestCase (new LteX2HandoverMeasuresTestCase (3, 1, 0, cel2, cel
2name, true, sched, ho, true, useIdealRrc), TestCase::TAKES_FOREVER); |
773 AddTestCase (new LteX2HandoverMeasuresTestCase (4, 1, 0, cel3, cel
3name, true, sched, ho, true, useIdealRrc), TestCase::EXTENSIVE); | 773 AddTestCase (new LteX2HandoverMeasuresTestCase (4, 1, 0, cel3, cel
3name, true, sched, ho, true, useIdealRrc), TestCase::EXTENSIVE); |
774 } | 774 } |
775 | 775 |
776 } // end of LteX2HandoverMeasuresTestSuite () | 776 } // end of LteX2HandoverMeasuresTestSuite () |
777 | 777 |
778 static LteX2HandoverMeasuresTestSuite g_lteX2HandoverMeasuresTestSuiteInstance; | 778 static LteX2HandoverMeasuresTestSuite g_lteX2HandoverMeasuresTestSuiteInstance; |
LEFT | RIGHT |