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
sixlowpan-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/sixlowpan-net-device.h"
10
#include "ns3/traced-callback-typedef-test.h"
11
12
/**
13
* @file
14
* @ingroup sixlowpan-tests
15
*
16
* Verify that the TracedCallback typedefs declared by the sixlowpan module are
17
* invoked with the right type and number of arguments.
18
*/
19
20
namespace
ns3
21
{
22
23
#ifndef DOXYGEN_SHOULD_SKIP_THIS
24
TRACED_CALLBACK_TYPENAME
(
SixLowPanNetDevice::DropTracedCallback
);
25
TRACED_CALLBACK_TYPENAME
(
SixLowPanNetDevice::RxTxTracedCallback
);
26
#endif
// DOXYGEN_SHOULD_SKIP_THIS
27
28
/**
29
* @ingroup sixlowpan-tests
30
*
31
* TracedCallback typedef Testcase for the sixlowpan module.
32
*/
33
class
SixLowPanTracedCallbackTypedefTestCase
:
public
TracedCallbackTypedefTestCase
34
{
35
public
:
36
SixLowPanTracedCallbackTypedefTestCase
();
37
38
private
:
39
void
DoRun
()
override
;
40
};
41
42
SixLowPanTracedCallbackTypedefTestCase::SixLowPanTracedCallbackTypedefTestCase
()
43
:
TracedCallbackTypedefTestCase
(
"Check sixlowpan TracedCallback typedefs"
)
44
{
45
}
46
47
void
48
SixLowPanTracedCallbackTypedefTestCase::DoRun
()
49
{
50
TRACED_CALLBACK_CHECK
(
SixLowPanNetDevice::DropTracedCallback
,
51
SixLowPanNetDevice::DropReason
,
52
Ptr<const Packet>
,
53
Ptr<SixLowPanNetDevice>
,
54
uint32_t
);
55
56
TRACED_CALLBACK_CHECK
(
SixLowPanNetDevice::RxTxTracedCallback
,
57
Ptr<const Packet>
,
58
Ptr<SixLowPanNetDevice>
,
59
uint32_t
);
60
}
61
62
/**
63
* @ingroup sixlowpan-tests
64
*
65
* @brief sixlowpan TracedCallback typedef TestSuite
66
*/
67
class
SixLowPanTracedCallbackTypedefTestSuite
:
public
TestSuite
68
{
69
public
:
70
SixLowPanTracedCallbackTypedefTestSuite
();
71
};
72
73
SixLowPanTracedCallbackTypedefTestSuite::SixLowPanTracedCallbackTypedefTestSuite
()
74
:
TestSuite
(
"sixlowpan-traced-callback-typedef"
,
Type
::UNIT)
75
{
76
AddTestCase
(
new
SixLowPanTracedCallbackTypedefTestCase
,
TestCase::Duration::QUICK
);
77
}
78
79
/// Static variable for test initialization
80
static
SixLowPanTracedCallbackTypedefTestSuite
g_sixLowPanTracedCallbackTypedefTestSuite
;
81
82
}
// namespace ns3
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:70
ns3::SixLowPanNetDevice::DropTracedCallback
void(* DropTracedCallback)(DropReason reason, Ptr< const Packet > packet, Ptr< SixLowPanNetDevice > sixNetDevice, uint32_t ifindex)
TracedCallback signature for packet drop events.
Definition
sixlowpan-net-device.h:215
ns3::SixLowPanNetDevice::DropReason
DropReason
Enumeration of the dropping reasons in SixLoWPAN.
Definition
sixlowpan-net-device.h:70
ns3::SixLowPanNetDevice::RxTxTracedCallback
void(* RxTxTracedCallback)(Ptr< const Packet > packet, Ptr< SixLowPanNetDevice > sixNetDevice, uint32_t ifindex)
TracedCallback signature for packet send/receive events.
Definition
sixlowpan-net-device.h:199
ns3::SixLowPanTracedCallbackTypedefTestCase
TracedCallback typedef Testcase for the sixlowpan module.
Definition
sixlowpan-traced-callback-typedef-test-suite.cc:34
ns3::SixLowPanTracedCallbackTypedefTestCase::DoRun
void DoRun() override
Implementation to actually run this TestCase.
Definition
sixlowpan-traced-callback-typedef-test-suite.cc:48
ns3::SixLowPanTracedCallbackTypedefTestCase::SixLowPanTracedCallbackTypedefTestCase
SixLowPanTracedCallbackTypedefTestCase()
Definition
sixlowpan-traced-callback-typedef-test-suite.cc:42
ns3::SixLowPanTracedCallbackTypedefTestSuite
sixlowpan TracedCallback typedef TestSuite
Definition
sixlowpan-traced-callback-typedef-test-suite.cc:68
ns3::SixLowPanTracedCallbackTypedefTestSuite::SixLowPanTracedCallbackTypedefTestSuite
SixLowPanTracedCallbackTypedefTestSuite()
Definition
sixlowpan-traced-callback-typedef-test-suite.cc:73
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::TracedCallbackTypedefTestCase::TracedCallbackTypedefTestCase
TracedCallbackTypedefTestCase(std::string name)
Constructor.
Definition
traced-callback-typedef-test.h:117
uint32_t
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
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::g_sixLowPanTracedCallbackTypedefTestSuite
static SixLowPanTracedCallbackTypedefTestSuite g_sixLowPanTracedCallbackTypedefTestSuite
Static variable for test initialization.
Definition
sixlowpan-traced-callback-typedef-test-suite.cc:80
src
sixlowpan
test
sixlowpan-traced-callback-typedef-test-suite.cc
Generated on
for ns-3 by
1.16.1