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) 2016 Universita' degli Studi di Napoli Federico II | 3 * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II |
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "ns3/packet-sink-helper.h" | 42 #include "ns3/packet-sink-helper.h" |
43 #include "ns3/on-off-helper.h" | 43 #include "ns3/on-off-helper.h" |
44 #include "ns3/traffic-control-helper.h" | 44 #include "ns3/traffic-control-helper.h" |
45 #include "ns3/traffic-control-layer.h" | 45 #include "ns3/traffic-control-layer.h" |
46 #include "ns3/llc-snap-header.h" | 46 #include "ns3/llc-snap-header.h" |
47 | 47 |
48 using namespace ns3; | 48 using namespace ns3; |
49 | 49 |
50 NS_LOG_COMPONENT_DEFINE ("WifiAcMappingTest"); | 50 NS_LOG_COMPONENT_DEFINE ("WifiAcMappingTest"); |
51 | 51 |
| 52 /** |
| 53 * \ingroup ns3wifi-test |
| 54 * \defgroup ns3wifi-test ns3wifi module tests |
| 55 */ |
| 56 |
| 57 |
| 58 /** |
| 59 * \ingroup ns3wifi-test |
| 60 * \ingroup tests |
| 61 * |
| 62 * \brief Wifi Ac Mapping Test |
| 63 */ |
52 class WifiAcMappingTest : public TestCase | 64 class WifiAcMappingTest : public TestCase |
53 { | 65 { |
54 public: | 66 public: |
| 67 /** |
| 68 * Contructor |
| 69 * |
| 70 * \param tos TOS |
| 71 * \param expectedQueue expected queue |
| 72 */ |
55 WifiAcMappingTest (uint8_t tos, uint8_t expectedQueue); | 73 WifiAcMappingTest (uint8_t tos, uint8_t expectedQueue); |
56 virtual void DoRun (void); | 74 virtual void DoRun (void); |
57 | 75 |
58 private: | 76 private: |
| 77 /** |
| 78 * \brief Packet enqueued in queue function |
| 79 * |
| 80 * \param tos TOS |
| 81 * \param count |
| 82 * \param item |
| 83 */ |
59 static void PacketEnqueuedInQueueDisc (uint8_t tos, uint8_t* count, Ptr<const
QueueDiscItem> item); | 84 static void PacketEnqueuedInQueueDisc (uint8_t tos, uint8_t* count, Ptr<const
QueueDiscItem> item); |
| 85 /** |
| 86 * \brief Packet enqueued in qifi mac queue function |
| 87 * |
| 88 * \param tos TOS |
| 89 * \param count |
| 90 * \param item |
| 91 */ |
60 static void PacketEnqueuedInWifiMacQueue (uint8_t tos, uint8_t* count, Ptr<con
st WifiMacQueueItem> item); | 92 static void PacketEnqueuedInWifiMacQueue (uint8_t tos, uint8_t* count, Ptr<con
st WifiMacQueueItem> item); |
61 uint8_t m_tos; | 93 uint8_t m_tos; ///< the TOS |
62 uint8_t m_expectedQueue; | 94 uint8_t m_expectedQueue; ///< the expected queue |
63 uint8_t m_QueueDiscCount[4]; | 95 uint8_t m_QueueDiscCount[4]; ///< the queue disc count |
64 uint8_t m_WifiMacQueueCount[4]; | 96 uint8_t m_WifiMacQueueCount[4]; ///< the qifi mac queue count |
65 }; | 97 }; |
66 | 98 |
67 WifiAcMappingTest::WifiAcMappingTest (uint8_t tos, uint8_t expectedQueue) | 99 WifiAcMappingTest::WifiAcMappingTest (uint8_t tos, uint8_t expectedQueue) |
68 : TestCase ("User priority to Access Category mapping test. Checks that packet
s are" | 100 : TestCase ("User priority to Access Category mapping test. Checks that packet
s are" |
69 "enqueued in the correct child queue disc of the mq root queue dis
c and" | 101 "enqueued in the correct child queue disc of the mq root queue dis
c and" |
70 "in the correct wifi MAC queue"), | 102 "in the correct wifi MAC queue"), |
71 m_tos (tos), | 103 m_tos (tos), |
72 m_expectedQueue (expectedQueue) | 104 m_expectedQueue (expectedQueue) |
73 { | 105 { |
74 for (uint8_t i = 0; i < 4; i++) | 106 for (uint8_t i = 0; i < 4; i++) |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 uint32_t totalOctetsThrough = | 280 uint32_t totalOctetsThrough = |
249 DynamicCast<PacketSink> (sinkApp.Get (0))->GetTotalRx (); | 281 DynamicCast<PacketSink> (sinkApp.Get (0))->GetTotalRx (); |
250 | 282 |
251 // Check that the three packets have been received | 283 // Check that the three packets have been received |
252 NS_TEST_ASSERT_MSG_EQ (totalOctetsThrough, 1500, "Three packets should have be
en received"); | 284 NS_TEST_ASSERT_MSG_EQ (totalOctetsThrough, 1500, "Three packets should have be
en received"); |
253 | 285 |
254 Simulator::Destroy (); | 286 Simulator::Destroy (); |
255 } | 287 } |
256 | 288 |
257 | 289 |
| 290 /// Wifi AC mapping test suite |
258 class WifiAcMappingTestSuite : public TestSuite | 291 class WifiAcMappingTestSuite : public TestSuite |
259 { | 292 { |
260 public: | 293 public: |
261 WifiAcMappingTestSuite (); | 294 WifiAcMappingTestSuite (); |
262 }; | 295 }; |
263 | 296 |
264 WifiAcMappingTestSuite::WifiAcMappingTestSuite () | 297 WifiAcMappingTestSuite::WifiAcMappingTestSuite () |
265 : TestSuite ("ns3-wifi-ac-mapping", SYSTEM) | 298 : TestSuite ("ns3-wifi-ac-mapping", SYSTEM) |
266 { | 299 { |
267 AddTestCase (new WifiAcMappingTest (0xb8, 2), TestCase::QUICK); // EF in AC_VI | 300 AddTestCase (new WifiAcMappingTest (0xb8, 2), TestCase::QUICK); // EF in AC_VI |
268 AddTestCase (new WifiAcMappingTest (0x28, 1), TestCase::QUICK); // AF11 in AC_
BK | 301 AddTestCase (new WifiAcMappingTest (0x28, 1), TestCase::QUICK); // AF11 in AC_
BK |
269 AddTestCase (new WifiAcMappingTest (0x70, 0), TestCase::QUICK); // AF32 in AC_
BE | 302 AddTestCase (new WifiAcMappingTest (0x70, 0), TestCase::QUICK); // AF32 in AC_
BE |
270 AddTestCase (new WifiAcMappingTest (0xc0, 3), TestCase::QUICK); // CS7 in AC_V
O | 303 AddTestCase (new WifiAcMappingTest (0xc0, 3), TestCase::QUICK); // CS7 in AC_V
O |
271 } | 304 } |
272 | 305 |
273 static WifiAcMappingTestSuite wifiAcMappingTestSuite; | 306 static WifiAcMappingTestSuite wifiAcMappingTestSuite; |
OLD | NEW |