1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2015 Lawrence Livermore National Laboratory
4  *
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
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  *
18  * Author:  Peter D. Barnes, Jr. <pdbarnes@llnl.gov>
19  */
20 
21 #include <iostream>
22 #include <sstream>
23 #include <set>
24 #include <string>
25 #include "ns3/test.h"
26 #include "ns3/core-module.h"
27 #include "ns3/dsr-module.h"       // DsrOPtionSRHeader
28 #include "ns3/internet-module.h"  // Ipv4, Ipv4L3Protocol, Ipv4PacketProbe
29                                   // Ipv6L3Protocol, Ipv6PacketProbe
30 #include "ns3/lr-wpan-mac.h"      // LrWpanMac
31 #include "ns3/lte-module.h"       // PhyReceptionStatParameters,
32                                   // PhyTransmissionStatParameters,
33                                   // LteUePowerControl
34 #include "ns3/mesh-module.h"      // PeerManagementProtocol
35 #include "ns3/mobility-module.h"  // MobilityModel
36 #include "ns3/network-module.h"   // Packet, PacketBurst
37 #include "ns3/olsr-module.h"      // olsr::RoutingProtocol
38 #include "ns3/sixlowpan-module.h" // SixLowPanNetDevice
39 #include "ns3/spectrum-module.h"  // SpectrumValue
40 #include "ns3/stats-module.h"     // TimeSeriesAdapter
41 #include "ns3/uan-module.h"       // UanPhy
42 #include "ns3/wifi-phy-state-helper.h"
43 
44 using namespace ns3;
45 
46 class TracedCallbackTypedefTestCase : public TestCase
47 {
48 public:
49   TracedCallbackTypedefTestCase ();
~TracedCallbackTypedefTestCase()50   virtual ~TracedCallbackTypedefTestCase ()
51   {
52   }
53 
54   /**
55    * Number of arguments passed to callback.
56    *
57    * Since the sink function is outside the invoking class we can't use
58    * the test macros directly.  Instead, we cache success
59    * in the \c m_nArgs public value, then inspect it
60    * in the CheckType() method.
61    */
62   static int m_nArgs;
63 
64 private:
65   /** Invoker boilerplate. */
66   template <typename T1, typename T2, typename T3, typename T4, typename T5>
67   class CheckerBase;
68 
69   /** Callback checkers. */
70   template <typename T1, typename T2, typename T3, typename T4, typename T5>
71   class Checker;
72 
73   template <typename T1, typename T2, typename T3, typename T4>
74   class Checker<T1, T2, T3, T4, empty>;
75 
76   template <typename T1, typename T2, typename T3>
77   class Checker<T1, T2, T3, empty, empty>;
78 
79 
80   template <typename T1, typename T2>
81   class Checker<T1, T2, empty, empty, empty>;
82 
83   template <typename T1>
84   class Checker<T1, empty, empty, empty, empty>;
85 
86   virtual void DoRun (void);
87 
88 };  // TracedCallbackTypedefTestCase
89 
90 /*
91   --------------------------------------------------------------------
92   Support functions and classes
93   --------------------------------------------------------------------
94 */
95 
96 namespace {
97 
98 /** Record typedefs which are identical to previously declared. */
99 std::set<std::string>
Duplicates(void)100 Duplicates (void)
101 {
102   std::set<std::string> dupes;
103 
104   dupes.insert ("LteRlc::NotifyTxTracedCallback");
105   dupes.insert ("LteRlc::ReceiveTracedCallback");
106   dupes.insert ("LteUeRrc::ImsiCidRntiTracedCallback");
107   dupes.insert ("LteUeRrc::MibSibHandoverTracedCallback");
108   dupes.insert ("WifiPhyStateHelper::RxEndErrorTracedCallback");
109 
110   return dupes;
111 }
112 
113 /**
114  * Container for duplicate types.
115  */
116 std::set<std::string> g_dupes = Duplicates ();
117 
118 
119 /**
120  * Stringify the known TracedCallback type names.
121  *
122  * \tparam T \explicit The typedef name.
123  * \param [in] N The number of arguments expected.
124  * \returns The \c TracedCallback type name.
125  */
126 template <typename T>
127 inline
TypeName(int N)128 std::string TypeName (int N)
129 {
130   return "unknown";
131 }
132 
133 #define TYPENAME(T)               \
134   template <> \
135   inline std::string  \
136   TypeName < T >     (int N)      \
137   {                               \
138     std::stringstream ss;         \
139     ss << # T << "(" << N << ")"; \
140     return ss.str ();             \
141   }
142 
143 /**
144  * \name Stringify known typename.
145  * @{
146  */
147 TYPENAME (dsr::DsrOptionSRHeader::TracedCallback);
148 TYPENAME (EpcUeNas::StateTracedCallback);
149 TYPENAME (Ipv4L3Protocol::DropTracedCallback);
150 TYPENAME (Ipv4L3Protocol::SentTracedCallback);
151 TYPENAME (Ipv4L3Protocol::TxRxTracedCallback);
152 TYPENAME (Ipv6L3Protocol::DropTracedCallback);
153 TYPENAME (Ipv6L3Protocol::SentTracedCallback);
154 TYPENAME (Ipv6L3Protocol::TxRxTracedCallback);
155 TYPENAME (LrWpanMac::SentTracedCallback);
156 TYPENAME (LrWpanMac::StateTracedCallback);
157 TYPENAME (LrWpanPhy::StateTracedCallback);
158 // TYPENAME (LteEnbMac::DlSchedulingTracedCallback);
159 TYPENAME (LteEnbMac::UlSchedulingTracedCallback);
160 TYPENAME (LteEnbPhy::ReportInterferenceTracedCallback);
161 TYPENAME (LteEnbPhy::ReportUeSinrTracedCallback);
162 TYPENAME (LteEnbRrc::ConnectionHandoverTracedCallback);
163 TYPENAME (LteEnbRrc::HandoverStartTracedCallback);
164 TYPENAME (LteEnbRrc::NewUeContextTracedCallback);
165 TYPENAME (LteEnbRrc::ReceiveReportTracedCallback);
166 TYPENAME (LtePdcp::PduRxTracedCallback);
167 TYPENAME (LtePdcp::PduTxTracedCallback);
168 TYPENAME (LteUePhy::StateTracedCallback);
169 TYPENAME (LteUePhy::RsrpSinrTracedCallback);
170 TYPENAME (LteUeRrc::CellSelectionTracedCallback);
171 TYPENAME (LteUeRrc::StateTracedCallback);
172 TYPENAME (Mac48Address::TracedCallback);
173 TYPENAME (MobilityModel::TracedCallback);
174 TYPENAME (olsr::RoutingProtocol::PacketTxRxTracedCallback);
175 TYPENAME (olsr::RoutingProtocol::TableChangeTracedCallback);
176 TYPENAME (Packet::AddressTracedCallback);
177 TYPENAME (Packet::Mac48AddressTracedCallback);
178 TYPENAME (Packet::SinrTracedCallback);
179 TYPENAME (Packet::SizeTracedCallback);
180 TYPENAME (Packet::TracedCallback);
181 TYPENAME (PacketBurst::TracedCallback);
182 TYPENAME (dot11s::PeerManagementProtocol::LinkOpenCloseTracedCallback);
183 TYPENAME (PhyReceptionStatParameters::TracedCallback);
184 TYPENAME (PhyTransmissionStatParameters::TracedCallback);
185 TYPENAME (SixLowPanNetDevice::DropTracedCallback);
186 TYPENAME (SixLowPanNetDevice::RxTxTracedCallback);
187 TYPENAME (SpectrumChannel::LossTracedCallback);
188 TYPENAME (SpectrumValue::TracedCallback);
189 TYPENAME (TimeSeriesAdaptor::OutputTracedCallback);
190 TYPENAME (UanMac::PacketModeTracedCallback);
191 TYPENAME (UanMacCw::QueueTracedCallback);
192 TYPENAME (UanMacRc::QueueTracedCallback);
193 TYPENAME (UanNetDevice::RxTxTracedCallback);
194 TYPENAME (UanPhy::TracedCallback);
195 TYPENAME (UeManager::StateTracedCallback);
196 TYPENAME (WifiMacHeader::TracedCallback);
197 TYPENAME (WifiPhyStateHelper::RxOkTracedCallback);
198 TYPENAME (WifiPhyStateHelper::StateTracedCallback);
199 TYPENAME (WifiPhyStateHelper::TxTracedCallback);
200 TYPENAME (WifiRemoteStationManager::PowerChangeTracedCallback);
201 TYPENAME (WifiRemoteStationManager::RateChangeTracedCallback);
202 /** @} */
203 #undef TYPENAME
204 
205 
206 /**
207  * Log that a callback was invoked.
208  *
209  * We can't actually do anything with any of the arguments,
210  * but the fact we got called is what's important.
211  *
212  * \param [in] N The number of arguments passed to the callback.
213  */
SinkIt(unsigned int N)214 void SinkIt (unsigned int N)
215 {
216   std::cout << "with " << N << " args." << std::endl;
217   TracedCallbackTypedefTestCase::m_nArgs = N;
218 }
219 
220 /**
221  * Sink functions.
222  * @{
223  */
224 template <typename T1, typename T2, typename T3, typename T4, typename T5>
225 class TracedCbSink
226 {
227 public:
Sink(T1 a1,T2 a2,T3 a3,T4 a4,T5 a5)228   static void Sink (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
229   {
230     SinkIt (5);
231   }
232 };
233 
234 template <typename T1, typename T2, typename T3, typename T4>
235 class TracedCbSink<T1, T2, T3, T4, empty>
236 {
237 public:
Sink(T1 a1,T2 a2,T3 a3,T4 a4)238   static void Sink (T1 a1, T2 a2, T3 a3, T4 a4)
239   {
240     SinkIt (4);
241   }
242 };
243 
244 template <typename T1, typename T2, typename T3>
245 class TracedCbSink<T1, T2, T3, empty, empty>
246 {
247 public:
Sink(T1 a1,T2 a2,T3 a3)248   static void Sink (T1 a1, T2 a2, T3 a3)
249   {
250     SinkIt (3);
251   }
252 };
253 
254 template <typename T1, typename T2>
255 class TracedCbSink<T1, T2, empty, empty, empty>
256 {
257 public:
Sink(T1 a1,T2 a2)258   static void Sink (T1 a1, T2 a2)
259   {
260     SinkIt (2);
261   }
262 };
263 
264 template <typename T1>
265 class TracedCbSink< T1, empty, empty, empty, empty>
266 {
267 public:
Sink(T1 a1)268   static void Sink (T1 a1)
269   {
270     SinkIt (1);
271   }
272 };
273 /** @} */
274 
275 
276 }  // unnamed namespace
277 
278 
279 /*
280   --------------------------------------------------------------------
281   Class TracedCallbackTypedefTestCase implementation
282 
283   We put the template implementations here to break a dependency cycle
284   from the Checkers() to TracedCbSink<> to SinkIt()
285   --------------------------------------------------------------------
286 */
287 
288 int TracedCallbackTypedefTestCase::m_nArgs = 0;
289 
290 template <typename T1, typename T2, typename T3, typename T4, typename T5>
291 class TracedCallbackTypedefTestCase::CheckerBase : public Object
292 {
293 public:
294   typename TypeTraits<T1>::BaseType m1;
295   typename TypeTraits<T2>::BaseType m2;
296   typename TypeTraits<T3>::BaseType m3;
297   typename TypeTraits<T4>::BaseType m4;
298   typename TypeTraits<T5>::BaseType m5;
299 
Cleanup(int N)300   void Cleanup (int N)
301   {
302     if (m_nArgs == 0)
303       {
304         std::cout << std::endl;
305       }
306     NS_ASSERT_MSG (m_nArgs && m_nArgs == N, "failed.");
307     m_nArgs = 0;
308   }
309 };  // TracedCallbackTypedefTestCase::CheckerBase
310 
311 template <typename T1, typename T2, typename T3, typename T4, typename T5>
312 class TracedCallbackTypedefTestCase::Checker : public CheckerBase<T1, T2, T3, T4, T5>
313 {
314   TracedCallback<T1, T2, T3, T4, T5> m_cb;
315 
316 public:
317   template <typename U>
Invoke(void)318   void Invoke (void)
319   {
320     const int N = 5;
321     U sink = TracedCbSink<T1, T2, T3, T4, T5>::Sink;
322     Callback<void, T1, T2, T3, T4, T5> cb = MakeCallback (sink);
323 
324     std::cout << TypeName<U> (N) << " invoked ";
325     m_cb.ConnectWithoutContext (cb);
326     m_cb (this->m1, this->m2, this->m3, this->m4, this->m5);
327     this->Cleanup (N);
328   }
329 };  // Checker<5>
330 
331 template <typename T1, typename T2, typename T3, typename T4>
332 class TracedCallbackTypedefTestCase::Checker<T1, T2, T3, T4, empty>
333   : public CheckerBase<T1, T2, T3, T4, empty>
334 {
335   TracedCallback<T1, T2, T3, T4> m_cb;
336 
337 public:
338   template <typename U>
Invoke(void)339   void Invoke (void)
340   {
341     const int N = 4;
342     U sink = TracedCbSink<T1, T2, T3, T4, empty>::Sink;
343     Callback<void, T1, T2, T3, T4> cb = MakeCallback (sink);
344 
345     std::cout << TypeName<U> (N) << " invoked ";
346     m_cb.ConnectWithoutContext (cb);
347     m_cb (this->m1, this->m2, this->m3, this->m4);
348     this->Cleanup (N);
349   }
350 };  // Checker <4>
351 
352 template <typename T1, typename T2, typename T3>
353 class TracedCallbackTypedefTestCase::Checker<T1, T2, T3, empty, empty>
354   : public CheckerBase<T1, T2, T3, empty, empty>
355 {
356   TracedCallback<T1, T2, T3> m_cb;
357 
358 public:
359   template <typename U>
Invoke(void)360   void Invoke (void)
361   {
362     const int N = 3;
363     U sink = TracedCbSink<T1, T2, T3, empty, empty>::Sink;
364     Callback<void, T1, T2, T3> cb = MakeCallback (sink);
365 
366     std::cout << TypeName<U> (N) << " invoked ";
367     m_cb.ConnectWithoutContext (cb);
368     m_cb (this->m1, this->m2, this->m3);
369     this->Cleanup (N);
370   }
371 };  // Checker<3>
372 
373 template <typename T1, typename T2>
374 class TracedCallbackTypedefTestCase::Checker<T1, T2, empty, empty, empty>
375   : public CheckerBase<T1, T2, empty, empty, empty>
376 {
377   TracedCallback<T1, T2> m_cb;
378 
379 public:
380   template <typename U>
Invoke(void)381   void Invoke (void)
382   {
383     const int N = 2;
384     U sink = TracedCbSink<T1, T2, empty, empty, empty>::Sink;
385     Callback<void, T1, T2> cb = MakeCallback (sink);
386 
387     std::cout << TypeName<U> (N) << " invoked ";
388     m_cb.ConnectWithoutContext (cb);
389     m_cb (this->m1, this->m2);
390     this->Cleanup (N);
391   }
392 };  // Checker<2>
393 
394 template <typename T1>
395 class TracedCallbackTypedefTestCase::Checker<T1, empty, empty, empty, empty>
396   : public CheckerBase<T1, empty, empty, empty, empty>
397 {
398   TracedCallback<T1> m_cb;
399 
400 public:
401   template <typename U>
Invoke(void)402   void Invoke (void)
403   {
404     const int N = 1;
405     U sink = TracedCbSink<T1, empty, empty, empty, empty>::Sink;
406     Callback<void, T1> cb = MakeCallback (sink);
407 
408     std::cout << TypeName<U> (N) << " invoked ";
409     m_cb.ConnectWithoutContext (cb);
410     m_cb (this->m1);
411     this->Cleanup (N);
412   }
413 };  // Checker<1>
414 
TracedCallbackTypedefTestCase()415 TracedCallbackTypedefTestCase::TracedCallbackTypedefTestCase ()
416   : TestCase ("Check basic TracedCallback operation")
417 {
418 }
419 
420 void
DoRun(void)421 TracedCallbackTypedefTestCase::DoRun (void)
422 {
423 
424 #define DUPE(U, T1)                                                     \
425   if (g_dupes.find ( # U ) == g_dupes.end ()) {                           \
426       NS_TEST_ASSERT_MSG_NE (0, 1,                                        \
427                              "expected to find " <<  # U << " in dupes."); }  \
428   if (TypeName<U> (0) == TypeName<T1> (0)) {                              \
429       std::cout << # U << " matches " << # T1  << std::endl; }              \
430   else                                                                  \
431     NS_TEST_ASSERT_MSG_EQ                                               \
432       (TypeName<U> (0), TypeName<T1> (0),                               \
433       "the typedef " << # U <<                                         \
434       " used to match the typedef " << # T1 <<                         \
435       " but no longer does.  Please add a new CHECK call.")
436 
437 #define CHECK(U, T1, T2, T3, T4, T5)                                    \
438   CreateObject< Checker<T1, T2, T3, T4, T5> > ()->Invoke<U> ()
439 
440   CHECK (dsr::DsrOptionSRHeader::TracedCallback,
441          const dsr::DsrOptionSRHeader &,
442          empty, empty, empty, empty);
443 
444   CHECK (EpcUeNas::StateTracedCallback,
445          EpcUeNas::State, EpcUeNas::State,
446          empty, empty, empty);
447 
448   CHECK (Ipv4L3Protocol::DropTracedCallback,
449          const Ipv4Header &, Ptr<const Packet>,
450          Ipv4L3Protocol::DropReason, Ptr<Ipv4>, uint32_t );
451 
452   CHECK (Ipv4L3Protocol::SentTracedCallback,
453          const Ipv4Header &, Ptr<const Packet>, uint32_t,
454          empty, empty);
455 
456   CHECK (Ipv4L3Protocol::TxRxTracedCallback,
457          Ptr<const Packet>, Ptr<Ipv4>, uint32_t,
458          empty, empty);
459 
460   CHECK (Ipv6L3Protocol::DropTracedCallback,
461          const Ipv6Header &, Ptr<const Packet>,
462          Ipv6L3Protocol::DropReason, Ptr<Ipv6>, uint32_t
463          );
464 
465   CHECK (Ipv6L3Protocol::SentTracedCallback,
466          const Ipv6Header &, Ptr<const Packet>, uint32_t,
467          empty, empty);
468 
469   CHECK (Ipv6L3Protocol::TxRxTracedCallback,
470          Ptr<const Packet>, Ptr<Ipv6>, uint32_t,
471          empty, empty);
472 
473   CHECK (LrWpanMac::SentTracedCallback,
474          Ptr<const Packet>, uint8_t, uint8_t,
475          empty, empty);
476 
477   CHECK (LrWpanMac::StateTracedCallback,
478          LrWpanMacState, LrWpanMacState,
479          empty, empty, empty);
480 
481   CHECK (LrWpanPhy::StateTracedCallback,
482          Time, LrWpanPhyEnumeration, LrWpanPhyEnumeration,
483          empty, empty);
484 
485 
486   /*  Too many args :(
487   CHECK (LteEnbMac::DlSchedulingTracedCallback,
488          uint32_t, uint32_t, uint16_t,
489          uint8_t, uint16_t, uint8_t, uint16_t);
490   */
491 
492   CHECK (LteEnbMac::UlSchedulingTracedCallback,
493          uint32_t, uint32_t, uint16_t, uint8_t, uint16_t);
494 
495   CHECK (LteEnbPhy::ReportUeSinrTracedCallback,
496          uint16_t, uint16_t, double, uint8_t,
497          empty);
498 
499   CHECK (LteEnbPhy::ReportInterferenceTracedCallback,
500          uint16_t, Ptr<SpectrumValue>,
501          empty, empty, empty);
502 
503   CHECK (LteEnbRrc::ConnectionHandoverTracedCallback,
504          uint64_t, uint16_t, uint16_t,
505          empty, empty);
506 
507   CHECK (LteEnbRrc::HandoverStartTracedCallback,
508          uint64_t, uint16_t, uint16_t, uint16_t,
509          empty);
510 
511   CHECK (LteEnbRrc::NewUeContextTracedCallback,
512          uint16_t, uint16_t,
513          empty, empty, empty);
514 
515   CHECK (LteEnbRrc::ReceiveReportTracedCallback,
516          uint64_t, uint16_t, uint16_t, LteRrcSap::MeasurementReport,
517          empty);
518 
519   CHECK (LtePdcp::PduRxTracedCallback,
520          uint16_t, uint8_t, uint32_t, uint64_t,
521          empty);
522 
523   CHECK (LtePdcp::PduTxTracedCallback,
524          uint16_t, uint8_t, uint32_t,
525          empty, empty);
526 
527   DUPE  (LteRlc::NotifyTxTracedCallback, LtePdcp::PduTxTracedCallback);
528 
529   DUPE  (LteRlc::ReceiveTracedCallback, LtePdcp::PduRxTracedCallback);
530 
531   CHECK (LteUePhy::RsrpSinrTracedCallback,
532          uint16_t, uint16_t, double, double, uint8_t);
533 
534   CHECK (LteUePhy::StateTracedCallback,
535          uint16_t, uint16_t, LteUePhy::State, LteUePhy::State,
536          empty);
537 
538   CHECK (LteUeRrc::CellSelectionTracedCallback,
539          uint64_t, uint16_t,
540          empty, empty, empty);
541 
542   DUPE  (LteUeRrc::ImsiCidRntiTracedCallback, LteEnbRrc::ConnectionHandoverTracedCallback);
543 
544   DUPE   (LteUeRrc::MibSibHandoverTracedCallback, LteEnbRrc::HandoverStartTracedCallback);
545 
546   CHECK (LteUeRrc::StateTracedCallback,
547          uint64_t, uint16_t, uint16_t, LteUeRrc::State, LteUeRrc::State);
548 
549   CHECK (Mac48Address::TracedCallback,
550          Mac48Address,
551          empty, empty, empty, empty);
552 
553   CHECK (MobilityModel::TracedCallback,
554          Ptr<const MobilityModel>,
555          empty, empty, empty, empty);
556 
557   CHECK (olsr::RoutingProtocol::PacketTxRxTracedCallback,
558          const olsr::PacketHeader &, const olsr::MessageList &,
559          empty, empty, empty);
560 
561   CHECK (olsr::RoutingProtocol::TableChangeTracedCallback,
562          uint32_t,
563          empty, empty, empty, empty);
564 
565   CHECK (Packet::AddressTracedCallback,
566          Ptr<const Packet>, const Address &,
567          empty, empty, empty);
568 
569   CHECK (Packet::Mac48AddressTracedCallback,
570          Ptr<const Packet>, Mac48Address,
571          empty, empty, empty);
572 
573   CHECK (Packet::SinrTracedCallback,
574          Ptr<const Packet>, double,
575          empty, empty, empty);
576 
577   CHECK (Packet::SizeTracedCallback,
578          uint32_t, uint32_t,
579          empty, empty, empty);
580 
581   CHECK (Packet::TracedCallback,
582          Ptr<const Packet>,
583          empty, empty, empty, empty);
584 
585   CHECK (PacketBurst::TracedCallback,
586          Ptr<const PacketBurst>,
587          empty, empty, empty, empty);
588 
589   CHECK (dot11s::PeerManagementProtocol::LinkOpenCloseTracedCallback,
590          Mac48Address, Mac48Address,
591          empty, empty, empty);
592 
593   CHECK (PhyReceptionStatParameters::TracedCallback,
594          PhyReceptionStatParameters,
595          empty, empty, empty, empty);
596 
597   CHECK (PhyTransmissionStatParameters::TracedCallback,
598          PhyTransmissionStatParameters,
599          empty, empty, empty, empty);
600 
601   CHECK (SixLowPanNetDevice::DropTracedCallback,
602          SixLowPanNetDevice::DropReason, Ptr<const Packet>,
603          Ptr<SixLowPanNetDevice>, uint32_t,
604          empty);
605 
606   CHECK (SixLowPanNetDevice::RxTxTracedCallback,
607          Ptr<const Packet>, Ptr<SixLowPanNetDevice>, uint32_t,
608          empty, empty);
609 
610   CHECK (SpectrumChannel::LossTracedCallback,
611          Ptr<const SpectrumPhy>, Ptr<const SpectrumPhy>, double,
612          empty, empty);
613 
614   CHECK (SpectrumValue::TracedCallback,
615          Ptr<SpectrumValue>,
616          empty, empty, empty, empty);
617 
618   CHECK (TimeSeriesAdaptor::OutputTracedCallback,
619          double, double,
620          empty, empty, empty);
621 
622   CHECK (UanMac::PacketModeTracedCallback,
623          Ptr<const Packet>, UanTxMode,
624          empty, empty, empty);
625 
626   CHECK (UanMacCw::QueueTracedCallback,
627          Ptr<const Packet>, uint16_t,
628          empty, empty, empty);
629 
630   CHECK (UanMacRc::QueueTracedCallback,
631          Ptr<const Packet>, uint32_t,
632          empty, empty, empty);
633 
634   CHECK (UanNetDevice::RxTxTracedCallback,
635          Ptr<const Packet>, Mac8Address,
636          empty, empty, empty);
637 
638   CHECK (UanPhy::TracedCallback,
639          Ptr<const Packet>, double, UanTxMode,
640          empty, empty);
641 
642   CHECK (UeManager::StateTracedCallback,
643          uint64_t, uint16_t, uint16_t, UeManager::State, UeManager::State);
644 
645   CHECK (WifiMacHeader::TracedCallback,
646          const WifiMacHeader &,
647          empty, empty, empty, empty);
648 
649   CHECK (WifiPhyStateHelper::RxEndErrorTracedCallback,
650          Ptr<const Packet>, double,
651          empty, empty, empty);
652 
653   CHECK (WifiPhyStateHelper::RxOkTracedCallback,
654          Ptr<const Packet>, double, WifiMode, WifiPreamble,
655          empty);
656 
657   CHECK (WifiPhyStateHelper::StateTracedCallback,
658          Time, Time, WifiPhyState,
659          empty, empty);
660 
661   CHECK (WifiPhyStateHelper::TxTracedCallback,
662          Ptr<const Packet>, WifiMode, WifiPreamble, uint8_t,
663          empty);
664 
665   CHECK (WifiRemoteStationManager::PowerChangeTracedCallback,
666          double, double, Mac48Address,
667          empty, empty);
668 
669   CHECK (WifiRemoteStationManager::RateChangeTracedCallback,
670          DataRate, DataRate, Mac48Address,
671          empty, empty);
672 }
673 
674 class TracedCallbackTypedefTestSuite : public TestSuite
675 {
676 public:
677   TracedCallbackTypedefTestSuite ();
678 };
679 
TracedCallbackTypedefTestSuite()680 TracedCallbackTypedefTestSuite::TracedCallbackTypedefTestSuite ()
681   : TestSuite ("traced-callback-typedef", SYSTEM)
682 {
683   AddTestCase (new TracedCallbackTypedefTestCase, TestCase::QUICK);
684 }
685 
686 static TracedCallbackTypedefTestSuite tracedCallbackTypedefTestSuite;
687