ns3 formatting

This commit is contained in:
lluis
2013-02-19 19:42:02 +01:00
parent ef2f84ea71
commit 870ac2024e
2 changed files with 867 additions and 719 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -46,7 +46,7 @@ public:
pkt->CopyData (buffer, psize);
for (uint32_t i = 0; i < psize; i++)
{
sprintf (&sbuffer[i*3],"%02x ",buffer[i]);
sprintf (&sbuffer[i * 3],"%02x ",buffer[i]);
}
return std::string (sbuffer);
}
@@ -95,12 +95,12 @@ public:
virtual void DoRun (void) = 0;
LteRrcSap::RadioResourceConfigDedicated CreateRadioResourceConfigDedicated ();
void AssertEqualRadioResourceConfigDedicated (LteRrcSap::RadioResourceConfigDedicated rrcd1, LteRrcSap::RadioResourceConfigDedicated rrcd2);
protected:
Ptr<Packet> packet;
};
RrcHeaderTestCase :: RrcHeaderTestCase(std::string s) : TestCase(s)
RrcHeaderTestCase :: RrcHeaderTestCase (std::string s) : TestCase (s)
{
}
@@ -254,7 +254,7 @@ RrcConnectionRequestTestCase::RrcConnectionRequestTestCase () : RrcHeaderTestCas
void
RrcConnectionRequestTestCase::DoRun (void)
{
packet = Create<Packet>();
packet = Create<Packet> ();
NS_LOG_DEBUG ("============= RrcConnectionRequestTestCase ===========");
LteRrcSap::RrcConnectionRequest msg;
@@ -282,7 +282,7 @@ RrcConnectionRequestTestCase::DoRun (void)
// Check that the destination and source headers contain the same values
NS_TEST_ASSERT_MSG_EQ (source.GetMmec (),destination.GetMmec (), "Different m_mmec!");
NS_TEST_ASSERT_MSG_EQ (source.GetMtmsi (),destination.GetMtmsi (), "Different m_mTmsi!");
packet = 0;
}
@@ -301,7 +301,7 @@ RrcConnectionSetupTestCase::RrcConnectionSetupTestCase () : RrcHeaderTestCase ("
void
RrcConnectionSetupTestCase::DoRun (void)
{
packet = Create<Packet>();
packet = Create<Packet> ();
NS_LOG_DEBUG ("============= RrcConnectionSetupTestCase ===========");
LteRrcSap::RrcConnectionSetup msg;
@@ -331,7 +331,7 @@ RrcConnectionSetupTestCase::DoRun (void)
NS_TEST_ASSERT_MSG_EQ (source.GetRrcTransactionIdentifier (),destination.GetRrcTransactionIdentifier (), "RrcTransactionIdentifier");
AssertEqualRadioResourceConfigDedicated (source.GetRadioResourceConfigDedicated (),destination.GetRadioResourceConfigDedicated ());
packet = 0;
}
@@ -350,7 +350,7 @@ RrcConnectionSetupCompleteTestCase::RrcConnectionSetupCompleteTestCase () : RrcH
void
RrcConnectionSetupCompleteTestCase::DoRun (void)
{
packet = Create<Packet>();
packet = Create<Packet> ();
NS_LOG_DEBUG ("============= RrcConnectionSetupCompleteTestCase ===========");
LteRrcSap::RrcConnectionSetupCompleted msg;
@@ -377,7 +377,7 @@ RrcConnectionSetupCompleteTestCase::DoRun (void)
// Check that the destination and source headers contain the same values
NS_TEST_ASSERT_MSG_EQ (source.GetRrcTransactionIdentifier (),destination.GetRrcTransactionIdentifier (), "RrcTransactionIdentifier");
packet = 0;
}
@@ -397,7 +397,7 @@ RrcConnectionReconfigurationCompleteTestCase::RrcConnectionReconfigurationComple
void
RrcConnectionReconfigurationCompleteTestCase::DoRun (void)
{
packet = Create<Packet>();
packet = Create<Packet> ();
NS_LOG_DEBUG ("============= RrcConnectionReconfigurationCompleteTestCase ===========");
LteRrcSap::RrcConnectionReconfigurationCompleted msg;
@@ -424,7 +424,7 @@ RrcConnectionReconfigurationCompleteTestCase::DoRun (void)
// Check that the destination and source headers contain the same values
NS_TEST_ASSERT_MSG_EQ (source.GetRrcTransactionIdentifier (),destination.GetRrcTransactionIdentifier (), "RrcTransactionIdentifier");
packet = 0;
}
@@ -444,26 +444,26 @@ RrcConnectionReconfigurationTestCase::RrcConnectionReconfigurationTestCase ()
void
RrcConnectionReconfigurationTestCase::DoRun (void)
{
packet = Create<Packet>();
packet = Create<Packet> ();
NS_LOG_DEBUG ("============= RrcConnectionReconfigurationTestCase ===========");
LteRrcSap::RrcConnectionReconfiguration msg;
msg.rrcTransactionIdentifier = 2;
msg.haveMeasConfig = true;
msg.measConfig.haveQuantityConfig = true;
msg.measConfig.quantityConfig.filterCoefficientRSRP = 8;
msg.measConfig.quantityConfig.filterCoefficientRSRQ = 7;
msg.measConfig.haveMeasGapConfig = true;
msg.measConfig.measGapConfig.type = LteRrcSap::MeasGapConfig::SETUP;
msg.measConfig.measGapConfig.gapOffsetChoice = LteRrcSap::MeasGapConfig::gp0;
msg.measConfig.measGapConfig.gapOffsetValue = 21;
msg.measConfig.measGapConfig.gapOffsetValue = 21;
msg.measConfig.haveSmeasure = true;
msg.measConfig.sMeasure = 57;
msg.measConfig.haveSpeedStatePars = true;
msg.measConfig.speedStatePars.type = LteRrcSap::SpeedStatePars::SETUP;
msg.measConfig.speedStatePars.mobilityStateParameters.tEvaluation = 240;
@@ -472,21 +472,21 @@ RrcConnectionReconfigurationTestCase::DoRun (void)
msg.measConfig.speedStatePars.mobilityStateParameters.nCellChangeHigh = 13;
msg.measConfig.speedStatePars.timeToTriggerSf.sfMedium = 25;
msg.measConfig.speedStatePars.timeToTriggerSf.sfHigh = 75;
msg.measConfig.measObjectToRemoveList.push_back(23);
msg.measConfig.measObjectToRemoveList.push_back(13);
msg.measConfig.reportConfigToRemoveList.push_back(7);
msg.measConfig.reportConfigToRemoveList.push_back(16);
msg.measConfig.measIdToRemoveList.push_back(4);
msg.measConfig.measIdToRemoveList.push_back(18);
msg.measConfig.measObjectToRemoveList.push_back (23);
msg.measConfig.measObjectToRemoveList.push_back (13);
msg.measConfig.reportConfigToRemoveList.push_back (7);
msg.measConfig.reportConfigToRemoveList.push_back (16);
msg.measConfig.measIdToRemoveList.push_back (4);
msg.measConfig.measIdToRemoveList.push_back (18);
// TODO: Test the following:
// std::list<MeasObjectToAddMod> measObjectToAddModList;
// std::list<ReportConfigToAddMod> reportConfigToAddModList;
// std::list<MeasIdToAddMod> measIdToAddModList;
msg.haveMobilityControlInfo = true;
msg.mobilityControlInfo.targetPhysCellId = 4;
msg.mobilityControlInfo.haveCarrierFreq = true;
@@ -575,7 +575,7 @@ RrcConnectionReconfigurationTestCase::DoRun (void)
{
AssertEqualRadioResourceConfigDedicated (source.GetRadioResourceConfigDedicated (), destination.GetRadioResourceConfigDedicated ());
}
packet = 0;
}
@@ -594,7 +594,7 @@ HandoverPreparationInfoTestCase::HandoverPreparationInfoTestCase () : RrcHeaderT
void
HandoverPreparationInfoTestCase::DoRun (void)
{
packet = Create<Packet>();
packet = Create<Packet> ();
NS_LOG_DEBUG ("============= HandoverPreparationInfoTestCase ===========");
LteRrcSap::HandoverPreparationInfo msg;
@@ -609,12 +609,12 @@ HandoverPreparationInfoTestCase::DoRun (void)
msg.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIdentity = 4;
msg.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity = 123;
msg.asConfig.sourceSystemInformationBlockType2.freqInfo.ulBandwidth=100;
msg.asConfig.sourceSystemInformationBlockType2.freqInfo.ulCarrierFreq=10;
msg.asConfig.sourceSystemInformationBlockType2.freqInfo.ulBandwidth = 100;
msg.asConfig.sourceSystemInformationBlockType2.freqInfo.ulCarrierFreq = 10;
msg.asConfig.sourceSystemInformationBlockType2.radioResourceConfigCommon.rachConfigCommon.preambleInfo.numberOfRaPreambles = 4;
msg.asConfig.sourceSystemInformationBlockType2.radioResourceConfigCommon.rachConfigCommon.raSupervisionInfo.preambleTransMax = 3;
msg.asConfig.sourceSystemInformationBlockType2.radioResourceConfigCommon.rachConfigCommon.raSupervisionInfo.raResponseWindowSize = 6;
HandoverPreparationInfoHeader source;
source.SetMessage (msg);
@@ -644,8 +644,8 @@ HandoverPreparationInfoTestCase::DoRun (void)
NS_TEST_ASSERT_MSG_EQ (source.GetAsConfig ().sourceSystemInformationBlockType1.cellAccessRelatedInfo.cellIdentity, destination.GetAsConfig ().sourceSystemInformationBlockType1.cellAccessRelatedInfo.cellIdentity, "cellIdentity");
NS_TEST_ASSERT_MSG_EQ (source.GetAsConfig ().sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIdentity, destination.GetAsConfig ().sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIdentity, "csgIdentity");
NS_TEST_ASSERT_MSG_EQ (source.GetAsConfig ().sourceDlCarrierFreq, destination.GetAsConfig ().sourceDlCarrierFreq, "sourceDlCarrierFreq");
packet = 0;
packet = 0;
}
// --------------------------- CLASS RrcConnectionReestablishmentRequestTestCase -----------------------------
@@ -663,7 +663,7 @@ RrcConnectionReestablishmentRequestTestCase::RrcConnectionReestablishmentRequest
void
RrcConnectionReestablishmentRequestTestCase::DoRun (void)
{
packet = Create<Packet>();
packet = Create<Packet> ();
NS_LOG_DEBUG ("============= RrcConnectionReestablishmentRequestTestCase ===========");
LteRrcSap::RrcConnectionReestablishmentRequest msg;
@@ -694,7 +694,7 @@ RrcConnectionReestablishmentRequestTestCase::DoRun (void)
NS_TEST_ASSERT_MSG_EQ (source.GetUeIdentity ().cRnti, destination.GetUeIdentity ().cRnti, "cRnti");
NS_TEST_ASSERT_MSG_EQ (source.GetUeIdentity ().physCellId, destination.GetUeIdentity ().physCellId, "physCellId");
NS_TEST_ASSERT_MSG_EQ (source.GetReestablishmentCause (),destination.GetReestablishmentCause (), "ReestablishmentCause");
packet = 0;
}
@@ -713,7 +713,7 @@ RrcConnectionReestablishmentTestCase::RrcConnectionReestablishmentTestCase () :
void
RrcConnectionReestablishmentTestCase::DoRun (void)
{
packet = Create<Packet>();
packet = Create<Packet> ();
NS_LOG_DEBUG ("============= RrcConnectionReestablishmentTestCase ===========");
LteRrcSap::RrcConnectionReestablishment msg;
@@ -742,7 +742,7 @@ RrcConnectionReestablishmentTestCase::DoRun (void)
// Check that the destination and source headers contain the same values
NS_TEST_ASSERT_MSG_EQ (source.GetRrcTransactionIdentifier (), destination.GetRrcTransactionIdentifier (), "rrcTransactionIdentifier");
AssertEqualRadioResourceConfigDedicated (source.GetRadioResourceConfigDedicated (),destination.GetRadioResourceConfigDedicated ());
packet = 0;
}
@@ -761,7 +761,7 @@ RrcConnectionReestablishmentCompleteTestCase::RrcConnectionReestablishmentComple
void
RrcConnectionReestablishmentCompleteTestCase::DoRun (void)
{
packet = Create<Packet>();
packet = Create<Packet> ();
NS_LOG_DEBUG ("============= RrcConnectionReestablishmentCompleteTestCase ===========");
LteRrcSap::RrcConnectionReestablishmentComplete msg;
@@ -788,7 +788,7 @@ RrcConnectionReestablishmentCompleteTestCase::DoRun (void)
// Check that the destination and source headers contain the same values
NS_TEST_ASSERT_MSG_EQ (source.GetRrcTransactionIdentifier (), destination.GetRrcTransactionIdentifier (), "rrcTransactionIdentifier");
packet = 0;
}
@@ -807,7 +807,7 @@ RrcConnectionRejectTestCase::RrcConnectionRejectTestCase () : RrcHeaderTestCase
void
RrcConnectionRejectTestCase::DoRun (void)
{
packet = Create<Packet>();
packet = Create<Packet> ();
NS_LOG_DEBUG ("============= RrcConnectionRejectTestCase ===========");
LteRrcSap::RrcConnectionReject msg;
@@ -834,7 +834,7 @@ RrcConnectionRejectTestCase::DoRun (void)
// Check that the destination and source headers contain the same values
NS_TEST_ASSERT_MSG_EQ (source.GetMessage ().waitTime, destination.GetMessage ().waitTime, "Different waitTime!");
packet = 0;
}
@@ -853,7 +853,7 @@ MeasurementReportTestCase::MeasurementReportTestCase () : RrcHeaderTestCase ("Te
void
MeasurementReportTestCase::DoRun (void)
{
packet = Create<Packet>();
packet = Create<Packet> ();
NS_LOG_DEBUG ("============= MeasurementReportTestCase ===========");
LteRrcSap::MeasurementReport msg;
@@ -945,7 +945,7 @@ MeasurementReportTestCase::DoRun (void)
}
}
packet = 0;
packet = 0;
}
// --------------------------- CLASS Asn1EncodingSuite -----------------------------
@@ -959,17 +959,17 @@ Asn1EncodingSuite::Asn1EncodingSuite ()
: TestSuite ("test-asn1-encoding", UNIT)
{
NS_LOG_FUNCTION (this);
AddTestCase (new RrcConnectionRequestTestCase());
AddTestCase (new RrcConnectionSetupTestCase());
AddTestCase (new RrcConnectionSetupCompleteTestCase());
AddTestCase (new RrcConnectionReconfigurationCompleteTestCase());
AddTestCase (new RrcConnectionReconfigurationTestCase());
AddTestCase (new HandoverPreparationInfoTestCase());
AddTestCase (new RrcConnectionReestablishmentRequestTestCase());
AddTestCase (new RrcConnectionReestablishmentTestCase());
AddTestCase (new RrcConnectionReestablishmentCompleteTestCase());
AddTestCase (new RrcConnectionRejectTestCase());
AddTestCase (new MeasurementReportTestCase());
AddTestCase (new RrcConnectionRequestTestCase ());
AddTestCase (new RrcConnectionSetupTestCase ());
AddTestCase (new RrcConnectionSetupCompleteTestCase ());
AddTestCase (new RrcConnectionReconfigurationCompleteTestCase ());
AddTestCase (new RrcConnectionReconfigurationTestCase ());
AddTestCase (new HandoverPreparationInfoTestCase ());
AddTestCase (new RrcConnectionReestablishmentRequestTestCase ());
AddTestCase (new RrcConnectionReestablishmentTestCase ());
AddTestCase (new RrcConnectionReestablishmentCompleteTestCase ());
AddTestCase (new RrcConnectionRejectTestCase ());
AddTestCase (new MeasurementReportTestCase ());
}
Asn1EncodingSuite asn1EncodingSuite;