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 * 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
15using namespace ns3;
16using namespace lorawan;
17
18NS_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 */
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
37 : TestCase("Verify correct behavior of the NetworkScheduler object")
38{
39}
40
41// Reminder that the test case should clean up after itself
45
46// This method is the pure virtual method from class TestCase that every
47// TestCase must implement
48void
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 */
64{
65 public:
66 NetworkSchedulerTestSuite(); //!< Default constructor
67};
68
70 : TestSuite("network-scheduler", Type::UNIT)
71{
72 // LogComponentEnable("NetworkSchedulerTestSuite", LOG_LEVEL_DEBUG);
73
75}
76
77// 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.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition test.cc:296
@ QUICK
Fast test.
Definition test.h:1057
TestCase(const TestCase &)=delete
Caller graph was not generated because of its size.
Type
Type of test.
Definition test.h:1271
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new test suite.
Definition test.cc:494
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:194
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:260
static LorawanTestSuite lorawanTestSuite
Every class exported by the ns3 library is enclosed in the ns3 namespace.