A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
lr-wpan-traced-callback-typedef-test-suite.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 Lawrence Livermore National Laboratory
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Peter D. Barnes, Jr. <pdbarnes@llnl.gov>
7
*/
8
9
#include "ns3/lr-wpan-mac.h"
10
#include "ns3/lr-wpan-phy.h"
11
#include "ns3/traced-callback-typedef-test.h"
12
13
/**
14
* @file
15
* @ingroup lr-wpan-test
16
*
17
* Verify that the TracedCallback typedefs declared by the lr-wpan module are
18
* invoked with the right type and number of arguments.
19
*/
20
21
namespace
ns3
22
{
23
24
#ifndef DOXYGEN_SHOULD_SKIP_THIS
25
TRACED_CALLBACK_TYPENAME
(
lrwpan::LrWpanMac::SentTracedCallback
);
26
TRACED_CALLBACK_TYPENAME
(
lrwpan::LrWpanMac::StateTracedCallback
);
27
TRACED_CALLBACK_TYPENAME
(
lrwpan::LrWpanPhy::StateTracedCallback
);
28
#endif
// DOXYGEN_SHOULD_SKIP_THIS
29
30
/**
31
* @ingroup lr-wpan-test
32
*
33
* TracedCallback typedef Testcase for the lr-wpan module.
34
*/
35
class
LrWpanTracedCallbackTypedefTestCase
:
public
TracedCallbackTypedefTestCase
36
{
37
public
:
38
LrWpanTracedCallbackTypedefTestCase
();
39
40
private
:
41
void
DoRun
()
override
;
42
};
43
44
LrWpanTracedCallbackTypedefTestCase::LrWpanTracedCallbackTypedefTestCase
()
45
:
TracedCallbackTypedefTestCase
(
"Check lr-wpan TracedCallback typedefs"
)
46
{
47
}
48
49
void
50
LrWpanTracedCallbackTypedefTestCase::DoRun
()
51
{
52
TRACED_CALLBACK_CHECK
(
lrwpan::LrWpanMac::SentTracedCallback
,
53
Ptr<const Packet>
,
54
uint8_t,
55
uint8_t);
56
57
TRACED_CALLBACK_CHECK
(
lrwpan::LrWpanMac::StateTracedCallback
,
58
lrwpan::MacState
,
59
lrwpan::MacState
);
60
61
TRACED_CALLBACK_CHECK
(
lrwpan::LrWpanPhy::StateTracedCallback
,
62
Time
,
63
lrwpan::PhyEnumeration
,
64
lrwpan::PhyEnumeration
);
65
}
66
67
/**
68
* @ingroup lr-wpan-test
69
*
70
* @brief lr-wpan TracedCallback typedef TestSuite
71
*/
72
class
LrWpanTracedCallbackTypedefTestSuite
:
public
TestSuite
73
{
74
public
:
75
LrWpanTracedCallbackTypedefTestSuite
();
76
};
77
78
LrWpanTracedCallbackTypedefTestSuite::LrWpanTracedCallbackTypedefTestSuite
()
79
:
TestSuite
(
"lr-wpan-traced-callback-typedef"
,
Type
::UNIT)
80
{
81
AddTestCase
(
new
LrWpanTracedCallbackTypedefTestCase
,
TestCase::Duration::QUICK
);
82
}
83
84
/// Static variable for test initialization
85
static
LrWpanTracedCallbackTypedefTestSuite
g_lrWpanTracedCallbackTypedefTestSuite
;
86
87
}
// namespace ns3
ns3::LrWpanTracedCallbackTypedefTestCase
TracedCallback typedef Testcase for the lr-wpan module.
Definition
lr-wpan-traced-callback-typedef-test-suite.cc:36
ns3::LrWpanTracedCallbackTypedefTestCase::DoRun
void DoRun() override
Implementation to actually run this TestCase.
Definition
lr-wpan-traced-callback-typedef-test-suite.cc:50
ns3::LrWpanTracedCallbackTypedefTestCase::LrWpanTracedCallbackTypedefTestCase
LrWpanTracedCallbackTypedefTestCase()
Definition
lr-wpan-traced-callback-typedef-test-suite.cc:44
ns3::LrWpanTracedCallbackTypedefTestSuite
lr-wpan TracedCallback typedef TestSuite
Definition
lr-wpan-traced-callback-typedef-test-suite.cc:73
ns3::LrWpanTracedCallbackTypedefTestSuite::LrWpanTracedCallbackTypedefTestSuite
LrWpanTracedCallbackTypedefTestSuite()
Definition
lr-wpan-traced-callback-typedef-test-suite.cc:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:70
ns3::TestCase::AddTestCase
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition
test.cc:296
ns3::TestCase::Duration::QUICK
@ QUICK
Fast test.
Definition
test.h:1057
ns3::TestSuite::Type
Type
Type of test.
Definition
test.h:1271
ns3::TestSuite::TestSuite
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new test suite.
Definition
test.cc:494
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:95
ns3::TracedCallbackTypedefTestCase::TracedCallbackTypedefTestCase
TracedCallbackTypedefTestCase(std::string name)
Constructor.
Definition
traced-callback-typedef-test.h:117
ns3::lrwpan::LrWpanMac::StateTracedCallback
void(* StateTracedCallback)(MacState oldState, MacState newState)
TracedCallback signature for MacState change events.
Definition
lr-wpan-mac.h:735
ns3::lrwpan::LrWpanMac::SentTracedCallback
void(* SentTracedCallback)(Ptr< const Packet > packet, uint8_t retries, uint8_t backoffs)
TracedCallback signature for sent packets.
Definition
lr-wpan-mac.h:723
ns3::lrwpan::LrWpanPhy::StateTracedCallback
void(* StateTracedCallback)(Time time, PhyEnumeration oldState, PhyEnumeration newState)
TracedCallback signature for Trx state change events.
Definition
lr-wpan-phy.h:562
TRACED_CALLBACK_CHECK
#define TRACED_CALLBACK_CHECK(U,...)
Check the TracedCallback by calling its Invoke function.
Definition
traced-callback-typedef-test.h:179
TRACED_CALLBACK_TYPENAME
#define TRACED_CALLBACK_TYPENAME(T)
Declare the stringified name of a TracedCallback typedef.
Definition
traced-callback-typedef-test.h:72
ns3::lrwpan::MacState
MacState
MAC states.
Definition
lr-wpan-mac.h:65
ns3::lrwpan::PhyEnumeration
PhyEnumeration
IEEE802.15.4-2006 PHY Emumerations Table 18 in section 6.2.3.
Definition
lr-wpan-phy.h:104
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::g_lrWpanTracedCallbackTypedefTestSuite
static LrWpanTracedCallbackTypedefTestSuite g_lrWpanTracedCallbackTypedefTestSuite
Static variable for test initialization.
Definition
lr-wpan-traced-callback-typedef-test-suite.cc:85
src
lr-wpan
test
lr-wpan-traced-callback-typedef-test-suite.cc
Generated on
for ns-3 by
1.16.1