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
network-scheduler-test-suite.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 University of Padova
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Davide Magrin <magrinda@dei.unipd.it>
7
*/
8
9
// An essential include is test.h
10
#include "ns3/test.h"
11
12
// Include headers of classes to test
13
#include "ns3/network-scheduler.h"
14
15
using namespace
ns3
;
16
using namespace
lorawan
;
17
18
NS_LOG_COMPONENT_DEFINE
(
"NetworkSchedulerTestSuite"
);
19
20
/**
21
* @ingroup lorawan
22
*
23
* It tests the correct functionality of the NetworkScheduler component class of the network server
24
*/
25
class
NetworkSchedulerTest
:
public
TestCase
26
{
27
public
:
28
NetworkSchedulerTest
();
//!< Default constructor
29
~NetworkSchedulerTest
()
override
;
//!< Destructor
30
31
private
:
32
void
DoRun
()
override
;
33
};
34
35
// Add some help text to this case to describe what it is intended to test
36
NetworkSchedulerTest::NetworkSchedulerTest
()
37
:
TestCase
(
"Verify correct behavior of the NetworkScheduler object"
)
38
{
39
}
40
41
// Reminder that the test case should clean up after itself
42
NetworkSchedulerTest::~NetworkSchedulerTest
()
43
{
44
}
45
46
// This method is the pure virtual method from class TestCase that every
47
// TestCase must implement
48
void
49
NetworkSchedulerTest::DoRun
()
50
{
51
NS_LOG_DEBUG
(
"NetworkSchedulerTest"
);
52
53
// If a packet is received at the network server, a reply event should be
54
// scheduled to happen 1 second after the reception.
55
}
56
57
/**
58
* @ingroup lorawan
59
*
60
* The TestSuite class names the TestSuite, identifies what type of TestSuite, and enables the
61
* TestCases to be run. Typically, only the constructor for this class must be defined
62
*/
63
class
NetworkSchedulerTestSuite
:
public
TestSuite
64
{
65
public
:
66
NetworkSchedulerTestSuite
();
//!< Default constructor
67
};
68
69
NetworkSchedulerTestSuite::NetworkSchedulerTestSuite
()
70
:
TestSuite
(
"network-scheduler"
,
Type
::UNIT)
71
{
72
// LogComponentEnable("NetworkSchedulerTestSuite", LOG_LEVEL_DEBUG);
73
74
AddTestCase
(
new
NetworkSchedulerTest
,
Duration::QUICK
);
75
}
76
77
// Do not forget to allocate an instance of this TestSuite
78
static
NetworkSchedulerTestSuite
lorawanTestSuite
;
NetworkSchedulerTest
It tests the correct functionality of the NetworkScheduler component class of the network server.
Definition
network-scheduler-test-suite.cc:26
NetworkSchedulerTest::~NetworkSchedulerTest
~NetworkSchedulerTest() override
Destructor.
Definition
network-scheduler-test-suite.cc:42
NetworkSchedulerTest::NetworkSchedulerTest
NetworkSchedulerTest()
Default constructor.
Definition
network-scheduler-test-suite.cc:36
NetworkSchedulerTest::DoRun
void DoRun() override
Implementation to actually run this TestCase.
Definition
network-scheduler-test-suite.cc:49
NetworkSchedulerTestSuite
The TestSuite class names the TestSuite, identifies what type of TestSuite, and enables the TestCases...
Definition
network-scheduler-test-suite.cc:64
NetworkSchedulerTestSuite::NetworkSchedulerTestSuite
NetworkSchedulerTestSuite()
Default constructor.
Definition
network-scheduler-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::TestCase::TestCase
TestCase(const TestCase &)=delete
Caller graph was not generated because of its size.
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
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:194
NS_LOG_DEBUG
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition
log.h:260
lorawanTestSuite
static LorawanTestSuite lorawanTestSuite
Definition
lorawan-test-suite.cc:2261
ns3::lorawan
Definition
forwarder-helper.cc:19
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lorawan
test
network-scheduler-test-suite.cc
Generated on
for ns-3 by
1.15.0