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
wifi-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/traced-callback-typedef-test.h"
10
#include "ns3/wifi-mac-header.h"
11
#include "ns3/wifi-phy-state-helper.h"
12
#include "ns3/wifi-remote-station-manager.h"
13
14
/**
15
* @file
16
* @ingroup wifi-test
17
*
18
* Verify that the TracedCallback typedefs declared by the wifi module are
19
* invoked with the right type and number of arguments.
20
*/
21
22
namespace
ns3
23
{
24
25
#ifndef DOXYGEN_SHOULD_SKIP_THIS
26
TRACED_CALLBACK_TYPENAME
(
WifiMacHeader::TracedCallback
);
27
TRACED_CALLBACK_TYPENAME
(
WifiPhyStateHelper::RxEndErrorTracedCallback
);
28
TRACED_CALLBACK_TYPENAME
(
WifiPhyStateHelper::RxOkTracedCallback
);
29
TRACED_CALLBACK_TYPENAME
(
WifiPhyStateHelper::StateTracedCallback
);
30
TRACED_CALLBACK_TYPENAME
(
WifiPhyStateHelper::TxTracedCallback
);
31
TRACED_CALLBACK_TYPENAME
(
WifiRemoteStationManager::PowerChangeTracedCallback
);
32
TRACED_CALLBACK_TYPENAME
(
WifiRemoteStationManager::RateChangeTracedCallback
);
33
#endif
// DOXYGEN_SHOULD_SKIP_THIS
34
35
/**
36
* @ingroup wifi-test
37
*
38
* TracedCallback typedef Testcase for the wifi module.
39
*/
40
class
WifiTracedCallbackTypedefTestCase
:
public
TracedCallbackTypedefTestCase
41
{
42
public
:
43
WifiTracedCallbackTypedefTestCase
();
44
45
private
:
46
void
DoRun
()
override
;
47
};
48
49
WifiTracedCallbackTypedefTestCase::WifiTracedCallbackTypedefTestCase
()
50
:
TracedCallbackTypedefTestCase
(
"Check wifi TracedCallback typedefs"
)
51
{
52
}
53
54
void
55
WifiTracedCallbackTypedefTestCase::DoRun
()
56
{
57
TRACED_CALLBACK_CHECK
(
WifiMacHeader::TracedCallback
,
const
WifiMacHeader
&);
58
59
TRACED_CALLBACK_CHECK
(
WifiPhyStateHelper::RxEndErrorTracedCallback
,
Ptr<const Packet>
,
double
);
60
61
TRACED_CALLBACK_CHECK
(
WifiPhyStateHelper::RxOkTracedCallback
,
62
Ptr<const Packet>
,
63
double
,
64
WifiMode
,
65
WifiPreamble
);
66
67
TRACED_CALLBACK_CHECK
(
WifiPhyStateHelper::StateTracedCallback
,
Time
,
Time
,
WifiPhyState
);
68
69
TRACED_CALLBACK_CHECK
(
WifiPhyStateHelper::TxTracedCallback
,
70
Ptr<const Packet>
,
71
WifiMode
,
72
WifiPreamble
,
73
uint8_t);
74
75
TRACED_CALLBACK_CHECK
(
WifiRemoteStationManager::PowerChangeTracedCallback
,
76
double
,
77
double
,
78
Mac48Address
);
79
80
TRACED_CALLBACK_CHECK
(
WifiRemoteStationManager::RateChangeTracedCallback
,
81
DataRate
,
82
DataRate
,
83
Mac48Address
);
84
}
85
86
/**
87
* @ingroup wifi-test
88
*
89
* @brief wifi TracedCallback typedef TestSuite
90
*/
91
class
WifiTracedCallbackTypedefTestSuite
:
public
TestSuite
92
{
93
public
:
94
WifiTracedCallbackTypedefTestSuite
();
95
};
96
97
WifiTracedCallbackTypedefTestSuite::WifiTracedCallbackTypedefTestSuite
()
98
:
TestSuite
(
"wifi-traced-callback-typedef"
,
Type
::UNIT)
99
{
100
AddTestCase
(
new
WifiTracedCallbackTypedefTestCase
,
TestCase::Duration::QUICK
);
101
}
102
103
/// Static variable for test initialization
104
static
WifiTracedCallbackTypedefTestSuite
g_wifiTracedCallbackTypedefTestSuite
;
105
106
}
// namespace ns3
ns3::DataRate
Class for representing data rates.
Definition
data-rate.h:78
ns3::Mac48Address
an EUI-48 address
Definition
mac48-address.h:37
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::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition
wifi-mac-header.h:88
ns3::WifiMacHeader::TracedCallback
void(* TracedCallback)(const WifiMacHeader &header)
TracedCallback signature for WifiMacHeader.
Definition
wifi-mac-header.h:641
ns3::WifiMode
represent a single transmission mode
Definition
wifi-mode.h:39
ns3::WifiPhyStateHelper::StateTracedCallback
void(* StateTracedCallback)(Time start, Time duration, WifiPhyState state)
TracedCallback signature for state changes.
Definition
wifi-phy-state-helper.h:296
ns3::WifiPhyStateHelper::RxEndErrorTracedCallback
void(* RxEndErrorTracedCallback)(Ptr< const Packet > packet, double snr)
TracedCallback signature for receive end error event.
Definition
wifi-phy-state-helper.h:333
ns3::WifiPhyStateHelper::RxOkTracedCallback
void(* RxOkTracedCallback)(Ptr< const Packet > packet, double snr, WifiMode mode, WifiPreamble preamble)
TracedCallback signature for receive end OK event.
Definition
wifi-phy-state-helper.h:306
ns3::WifiPhyStateHelper::TxTracedCallback
void(* TxTracedCallback)(Ptr< const Packet > packet, WifiMode mode, WifiPreamble preamble, uint8_t powerLevel)
TracedCallback signature for transmit event.
Definition
wifi-phy-state-helper.h:343
ns3::WifiRemoteStationManager::PowerChangeTracedCallback
void(* PowerChangeTracedCallback)(double oldPower, double newPower, Mac48Address remoteAddress)
TracedCallback signature for power change events.
Definition
wifi-remote-station-manager.h:1236
ns3::WifiRemoteStationManager::RateChangeTracedCallback
void(* RateChangeTracedCallback)(DataRate oldRate, DataRate newRate, Mac48Address remoteAddress)
TracedCallback signature for rate change events.
Definition
wifi-remote-station-manager.h:1247
ns3::WifiTracedCallbackTypedefTestCase
TracedCallback typedef Testcase for the wifi module.
Definition
wifi-traced-callback-typedef-test-suite.cc:41
ns3::WifiTracedCallbackTypedefTestCase::DoRun
void DoRun() override
Implementation to actually run this TestCase.
Definition
wifi-traced-callback-typedef-test-suite.cc:55
ns3::WifiTracedCallbackTypedefTestCase::WifiTracedCallbackTypedefTestCase
WifiTracedCallbackTypedefTestCase()
Definition
wifi-traced-callback-typedef-test-suite.cc:49
ns3::WifiTracedCallbackTypedefTestSuite
wifi TracedCallback typedef TestSuite
Definition
wifi-traced-callback-typedef-test-suite.cc:92
ns3::WifiTracedCallbackTypedefTestSuite::WifiTracedCallbackTypedefTestSuite
WifiTracedCallbackTypedefTestSuite()
Definition
wifi-traced-callback-typedef-test-suite.cc:97
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::WifiPreamble
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition
wifi-phy-common.h:484
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiPhyState
WifiPhyState
The state of the PHY layer.
Definition
wifi-phy-state.h:23
ns3::g_wifiTracedCallbackTypedefTestSuite
static WifiTracedCallbackTypedefTestSuite g_wifiTracedCallbackTypedefTestSuite
Static variable for test initialization.
Definition
wifi-traced-callback-typedef-test-suite.cc:104
src
wifi
test
wifi-traced-callback-typedef-test-suite.cc
Generated on
for ns-3 by
1.16.1