OLD | NEW |
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 LteTestDlSchedulingCallback (LteCqiGenerationTestCase *testcase, std::string pat
h, DlSchedulingCallbackInfo dlInfo) | 45 LteTestDlSchedulingCallback (LteCqiGenerationTestCase *testcase, std::string pat
h, DlSchedulingCallbackInfo dlInfo) |
46 { | 46 { |
47 testcase->DlScheduling (dlInfo); | 47 testcase->DlScheduling (dlInfo); |
48 } | 48 } |
49 | 49 |
50 void | 50 void |
51 LteTestUlSchedulingCallback (LteCqiGenerationTestCase *testcase, std::string pat
h, | 51 LteTestUlSchedulingCallback (LteCqiGenerationTestCase *testcase, std::string pat
h, |
52 uint32_t frameNo, uint32_t subframeNo, uint16_t rnt
i, | 52 uint32_t frameNo, uint32_t subframeNo, uint16_t rnt
i, |
53 uint8_t mcs, uint16_t sizeTb, uint8_t ccId) | 53 uint8_t mcs, uint16_t sizeTb, uint8_t ccId) |
54 { | 54 { |
| 55 NS_UNUSED(ccId); |
55 testcase->UlScheduling (frameNo, subframeNo, rnti, mcs, sizeTb); | 56 testcase->UlScheduling (frameNo, subframeNo, rnti, mcs, sizeTb); |
56 } | 57 } |
57 | 58 |
58 void | 59 void |
59 LteTestDlSchedulingCallback2 (LteCqiGenerationDlPowerControlTestCase *testcase,
std::string path, | 60 LteTestDlSchedulingCallback2 (LteCqiGenerationDlPowerControlTestCase *testcase,
std::string path, |
60 DlSchedulingCallbackInfo dlInfo) | 61 DlSchedulingCallbackInfo dlInfo) |
61 { | 62 { |
62 testcase->DlScheduling (dlInfo); | 63 testcase->DlScheduling (dlInfo); |
63 } | 64 } |
64 | 65 |
65 void | 66 void |
66 LteTestUlSchedulingCallback2 (LteCqiGenerationDlPowerControlTestCase *testcase,
std::string path, | 67 LteTestUlSchedulingCallback2 (LteCqiGenerationDlPowerControlTestCase *testcase,
std::string path, |
67 uint32_t frameNo, uint32_t subframeNo, uint16_t rn
ti, | 68 uint32_t frameNo, uint32_t subframeNo, uint16_t rn
ti, |
68 uint8_t mcs, uint16_t sizeTb, uint8_t componentCar
rierId) | 69 uint8_t mcs, uint16_t sizeTb, uint8_t componentCar
rierId) |
69 { | 70 { |
| 71 NS_UNUSED(componentCarrierId); |
70 testcase->UlScheduling (frameNo, subframeNo, rnti, mcs, sizeTb); | 72 testcase->UlScheduling (frameNo, subframeNo, rnti, mcs, sizeTb); |
71 } | 73 } |
72 | 74 |
73 | 75 |
74 /** | 76 /** |
75 * TestSuite | 77 * TestSuite |
76 */ | 78 */ |
77 | 79 |
78 LteCqiGenerationTestSuite::LteCqiGenerationTestSuite () | 80 LteCqiGenerationTestSuite::LteCqiGenerationTestSuite () |
79 : TestSuite ("lte-cqi-generation", SYSTEM) | 81 : TestSuite ("lte-cqi-generation", SYSTEM) |
80 { | 82 { |
81 // LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL
_DEBUG); | 83 #if 0 |
82 // LogComponentEnable ("LteCqiGenerationTest", logLevel); | 84 LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_D
EBUG); |
| 85 LogComponentEnable ("LteCqiGenerationTest", logLevel); |
| 86 #endif |
| 87 |
83 NS_LOG_INFO ("Creating LteCqiGenerationTestSuite"); | 88 NS_LOG_INFO ("Creating LteCqiGenerationTestSuite"); |
84 | 89 |
85 AddTestCase (new LteCqiGenerationTestCase ("UsePdcchForCqiGeneration", false,
4, 2), TestCase::QUICK); | 90 AddTestCase (new LteCqiGenerationTestCase ("UsePdcchForCqiGeneration", false,
4, 2), TestCase::QUICK); |
86 AddTestCase (new LteCqiGenerationTestCase ("UsePdschForCqiGeneration", true, 2
8, 2), TestCase::QUICK); | 91 AddTestCase (new LteCqiGenerationTestCase ("UsePdschForCqiGeneration", true, 2
8, 2), TestCase::QUICK); |
87 | 92 |
88 AddTestCase (new LteCqiGenerationDlPowerControlTestCase ("CqiGenerationWithDlP
owerControl", | 93 AddTestCase (new LteCqiGenerationDlPowerControlTestCase ("CqiGenerationWithDlP
owerControl", |
89 LteRrcSap::PdschConfi
gDedicated::dB0, LteRrcSap::PdschConfigDedicated::dB0, 4, 2), TestCase::QUICK); | 94 LteRrcSap::PdschConfi
gDedicated::dB0, LteRrcSap::PdschConfigDedicated::dB0, 4, 2), TestCase::QUICK); |
90 AddTestCase (new LteCqiGenerationDlPowerControlTestCase ("CqiGenerationWithDlP
owerControl", | 95 AddTestCase (new LteCqiGenerationDlPowerControlTestCase ("CqiGenerationWithDlP
owerControl", |
91 LteRrcSap::PdschConfi
gDedicated::dB0, LteRrcSap::PdschConfigDedicated::dB_3, 8, 2), TestCase::QUICK); | 96 LteRrcSap::PdschConfi
gDedicated::dB0, LteRrcSap::PdschConfigDedicated::dB_3, 8, 2), TestCase::QUICK); |
92 AddTestCase (new LteCqiGenerationDlPowerControlTestCase ("CqiGenerationWithDlP
owerControl", | 97 AddTestCase (new LteCqiGenerationDlPowerControlTestCase ("CqiGenerationWithDlP
owerControl", |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 { | 131 { |
127 // NS_LOG_UNCOND("DL MSC: " << (uint32_t)mcsTb1 << " expected DL MCS: " <
< (uint32_t)m_dlMcs); | 132 // NS_LOG_UNCOND("DL MSC: " << (uint32_t)mcsTb1 << " expected DL MCS: " <
< (uint32_t)m_dlMcs); |
128 NS_TEST_ASSERT_MSG_EQ ((uint32_t)dlInfo.mcsTb1, (uint32_t)m_dlMcs, "Wrong
DL MCS "); | 133 NS_TEST_ASSERT_MSG_EQ ((uint32_t)dlInfo.mcsTb1, (uint32_t)m_dlMcs, "Wrong
DL MCS "); |
129 } | 134 } |
130 } | 135 } |
131 | 136 |
132 void | 137 void |
133 LteCqiGenerationTestCase::UlScheduling (uint32_t frameNo, uint32_t subframeNo, u
int16_t rnti, | 138 LteCqiGenerationTestCase::UlScheduling (uint32_t frameNo, uint32_t subframeNo, u
int16_t rnti, |
134 uint8_t mcs, uint16_t sizeTb) | 139 uint8_t mcs, uint16_t sizeTb) |
135 { | 140 { |
| 141 NS_UNUSED(frameNo); |
| 142 NS_UNUSED(subframeNo); |
| 143 NS_UNUSED(rnti); |
| 144 NS_UNUSED(sizeTb); |
136 // need to allow for RRC connection establishment + SRS transmission | 145 // need to allow for RRC connection establishment + SRS transmission |
137 if (Simulator::Now () > MilliSeconds (50)) | 146 if (Simulator::Now () > MilliSeconds (50)) |
138 { | 147 { |
139 // NS_LOG_UNCOND("UL MSC: " << (uint32_t)mcs << " expected UL MCS: " << (
uint32_t)m_ulMcs); | 148 // NS_LOG_UNCOND("UL MSC: " << (uint32_t)mcs << " expected UL MCS: " << (
uint32_t)m_ulMcs); |
140 NS_TEST_ASSERT_MSG_EQ ((uint32_t)mcs, (uint32_t)m_ulMcs, "Wrong UL MCS"); | 149 NS_TEST_ASSERT_MSG_EQ ((uint32_t)mcs, (uint32_t)m_ulMcs, "Wrong UL MCS"); |
141 } | 150 } |
142 } | 151 } |
143 | 152 |
144 void | 153 void |
145 LteCqiGenerationTestCase::DoRun (void) | 154 LteCqiGenerationTestCase::DoRun (void) |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 { | 268 { |
260 // NS_LOG_UNCOND("DL MSC: " << (uint32_t)mcsTb1 << " expected DL MCS: " <
< (uint32_t)m_dlMcs); | 269 // NS_LOG_UNCOND("DL MSC: " << (uint32_t)mcsTb1 << " expected DL MCS: " <
< (uint32_t)m_dlMcs); |
261 NS_TEST_ASSERT_MSG_EQ ((uint32_t)dlInfo.mcsTb1, (uint32_t)m_dlMcs, "Wrong
DL MCS "); | 270 NS_TEST_ASSERT_MSG_EQ ((uint32_t)dlInfo.mcsTb1, (uint32_t)m_dlMcs, "Wrong
DL MCS "); |
262 } | 271 } |
263 } | 272 } |
264 | 273 |
265 void | 274 void |
266 LteCqiGenerationDlPowerControlTestCase::UlScheduling (uint32_t frameNo, uint32_t
subframeNo, uint16_t rnti, | 275 LteCqiGenerationDlPowerControlTestCase::UlScheduling (uint32_t frameNo, uint32_t
subframeNo, uint16_t rnti, |
267 uint8_t mcs, uint16_t size
Tb) | 276 uint8_t mcs, uint16_t size
Tb) |
268 { | 277 { |
| 278 NS_UNUSED(frameNo); |
| 279 NS_UNUSED(subframeNo); |
| 280 NS_UNUSED(rnti); |
| 281 NS_UNUSED(sizeTb); |
269 // need to allow for RRC connection establishment + SRS transmission | 282 // need to allow for RRC connection establishment + SRS transmission |
270 if (Simulator::Now () > MilliSeconds (500)) | 283 if (Simulator::Now () > MilliSeconds (500)) |
271 { | 284 { |
272 // NS_LOG_UNCOND("UL MSC: " << (uint32_t)mcs << " expected UL MCS: " << (
uint32_t)m_ulMcs); | 285 // NS_LOG_UNCOND("UL MSC: " << (uint32_t)mcs << " expected UL MCS: " << (
uint32_t)m_ulMcs); |
273 NS_TEST_ASSERT_MSG_EQ ((uint32_t)mcs, (uint32_t)m_ulMcs, "Wrong UL MCS"); | 286 NS_TEST_ASSERT_MSG_EQ ((uint32_t)mcs, (uint32_t)m_ulMcs, "Wrong UL MCS"); |
274 } | 287 } |
275 } | 288 } |
276 | 289 |
277 void | 290 void |
278 LteCqiGenerationDlPowerControlTestCase::DoRun (void) | 291 LteCqiGenerationDlPowerControlTestCase::DoRun (void) |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 376 |
364 Config::Connect ("/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlS
cheduling", | 377 Config::Connect ("/NodeList/0/DeviceList/0/ComponentCarrierMap/*/LteEnbMac/UlS
cheduling", |
365 MakeBoundCallback (&LteTestUlSchedulingCallback2, this)); | 378 MakeBoundCallback (&LteTestUlSchedulingCallback2, this)); |
366 | 379 |
367 Simulator::Stop (Seconds (1.100)); | 380 Simulator::Stop (Seconds (1.100)); |
368 Simulator::Run (); | 381 Simulator::Run (); |
369 | 382 |
370 Simulator::Destroy (); | 383 Simulator::Destroy (); |
371 } | 384 } |
372 | 385 |
OLD | NEW |