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
olsr-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/olsr-header.h"
10
#include "ns3/olsr-routing-protocol.h"
11
#include "ns3/traced-callback-typedef-test.h"
12
13
/**
14
* @file
15
* @ingroup olsr-test
16
*
17
* Verify that the TracedCallback typedefs declared by the olsr 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
(
olsr::RoutingProtocol::PacketTxRxTracedCallback
);
26
TRACED_CALLBACK_TYPENAME
(
olsr::RoutingProtocol::TableChangeTracedCallback
);
27
#endif
// DOXYGEN_SHOULD_SKIP_THIS
28
29
/**
30
* @ingroup olsr-test
31
*
32
* TracedCallback typedef Testcase for the olsr module.
33
*/
34
class
OlsrTracedCallbackTypedefTestCase
:
public
TracedCallbackTypedefTestCase
35
{
36
public
:
37
OlsrTracedCallbackTypedefTestCase
();
38
39
private
:
40
void
DoRun
()
override
;
41
};
42
43
OlsrTracedCallbackTypedefTestCase::OlsrTracedCallbackTypedefTestCase
()
44
:
TracedCallbackTypedefTestCase
(
"Check olsr TracedCallback typedefs"
)
45
{
46
}
47
48
void
49
OlsrTracedCallbackTypedefTestCase::DoRun
()
50
{
51
TRACED_CALLBACK_CHECK
(
olsr::RoutingProtocol::PacketTxRxTracedCallback
,
52
const
olsr::PacketHeader
&,
53
const
olsr::MessageList
&);
54
55
TRACED_CALLBACK_CHECK
(
olsr::RoutingProtocol::TableChangeTracedCallback
,
uint32_t
);
56
}
57
58
/**
59
* @ingroup olsr-test
60
*
61
* @brief olsr TracedCallback typedef TestSuite
62
*/
63
class
OlsrTracedCallbackTypedefTestSuite
:
public
TestSuite
64
{
65
public
:
66
OlsrTracedCallbackTypedefTestSuite
();
67
};
68
69
OlsrTracedCallbackTypedefTestSuite::OlsrTracedCallbackTypedefTestSuite
()
70
:
TestSuite
(
"olsr-traced-callback-typedef"
,
Type
::UNIT)
71
{
72
AddTestCase
(
new
OlsrTracedCallbackTypedefTestCase
,
TestCase::Duration::QUICK
);
73
}
74
75
/// Static variable for test initialization
76
static
OlsrTracedCallbackTypedefTestSuite
g_olsrTracedCallbackTypedefTestSuite
;
77
78
}
// namespace ns3
ns3::OlsrTracedCallbackTypedefTestCase
TracedCallback typedef Testcase for the olsr module.
Definition
olsr-traced-callback-typedef-test-suite.cc:35
ns3::OlsrTracedCallbackTypedefTestCase::OlsrTracedCallbackTypedefTestCase
OlsrTracedCallbackTypedefTestCase()
Definition
olsr-traced-callback-typedef-test-suite.cc:43
ns3::OlsrTracedCallbackTypedefTestCase::DoRun
void DoRun() override
Implementation to actually run this TestCase.
Definition
olsr-traced-callback-typedef-test-suite.cc:49
ns3::OlsrTracedCallbackTypedefTestSuite
olsr TracedCallback typedef TestSuite
Definition
olsr-traced-callback-typedef-test-suite.cc:64
ns3::OlsrTracedCallbackTypedefTestSuite::OlsrTracedCallbackTypedefTestSuite
OlsrTracedCallbackTypedefTestSuite()
Definition
olsr-traced-callback-typedef-test-suite.cc:69
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
ns3::olsr::PacketHeader
The basic layout of any packet in OLSR is as follows (omitting IP and UDP headers):
Definition
olsr-header.h:68
ns3::olsr::RoutingProtocol::PacketTxRxTracedCallback
void(* PacketTxRxTracedCallback)(const PacketHeader &header, const MessageList &messages)
TracedCallback signature for Packet transmit and receive events.
Definition
olsr-routing-protocol.h:164
ns3::olsr::RoutingProtocol::TableChangeTracedCallback
void(* TableChangeTracedCallback)(uint32_t size)
TracedCallback signature for routing table computation.
Definition
olsr-routing-protocol.h:172
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::olsr::MessageList
std::vector< MessageHeader > MessageList
Definition
olsr-header.h:692
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::g_olsrTracedCallbackTypedefTestSuite
static OlsrTracedCallbackTypedefTestSuite g_olsrTracedCallbackTypedefTestSuite
Static variable for test initialization.
Definition
olsr-traced-callback-typedef-test-suite.cc:76
src
olsr
test
olsr-traced-callback-typedef-test-suite.cc
Generated on
for ns-3 by
1.16.1