A Discrete-Event Network Simulator
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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Davide Magrin <magrinda@dei.unipd.it>
18 */
19
20// Include headers of classes to test
21#include "ns3/log.h"
22#include "ns3/network-scheduler.h"
23
24// An essential include is test.h
25#include "ns3/test.h"
26
27using namespace ns3;
28using namespace lorawan;
29
30NS_LOG_COMPONENT_DEFINE("NetworkSchedulerTestSuite");
31
32/**
33 * \ingroup lorawan
34 *
35 * It tests the correct functionality of the NetworkScheduler component class of the network server
36 */
38{
39 public:
40 NetworkSchedulerTest(); //!< Default constructor
41 ~NetworkSchedulerTest() override; //!< Destructor
42
43 private:
44 void DoRun() override;
45};
46
47// Add some help text to this case to describe what it is intended to test
49 : TestCase("Verify correct behavior of the NetworkScheduler object")
50{
51}
52
53// Reminder that the test case should clean up after itself
55{
56}
57
58// This method is the pure virtual method from class TestCase that every
59// TestCase must implement
60void
62{
63 NS_LOG_DEBUG("NetworkSchedulerTest");
64
65 // If a packet is received at the network server, a reply event should be
66 // scheduled to happen 1 second after the reception.
67}
68
69/**
70 * \ingroup lorawan
71 *
72 * The TestSuite class names the TestSuite, identifies what type of TestSuite, and enables the
73 * TestCases to be run. Typically, only the constructor for this class must be defined
74 */
76{
77 public:
78 NetworkSchedulerTestSuite(); //!< Default constructor
79};
80
82 : TestSuite("network-scheduler", Type::UNIT)
83{
84 LogComponentEnable("NetworkSchedulerTestSuite", LOG_LEVEL_DEBUG);
85 // TestDuration for TestCase can be QUICK, EXTENSIVE or TAKES_FOREVER
87}
88
89// Do not forget to allocate an instance of this TestSuite
It tests the correct functionality of the NetworkScheduler component class of the network server.
~NetworkSchedulerTest() override
Destructor.
NetworkSchedulerTest()
Default constructor.
void DoRun() override
Implementation to actually run this TestCase.
The TestSuite class names the TestSuite, identifies what type of TestSuite, and enables the TestCases...
NetworkSchedulerTestSuite()
Default constructor.
encapsulates test code
Definition: test.h:1061
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:302
A suite of tests to run.
Definition: test.h:1273
Type
Type of test.
Definition: test.h:1280
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:268
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void LogComponentEnable(const std::string &name, LogLevel level)
Enable the logging output associated with that log component.
Definition: log.cc:302
@ LOG_LEVEL_DEBUG
LOG_DEBUG and above.
Definition: log.h:113
static NetworkSchedulerTestSuite lorawanTestSuite