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// Include headers of classes to test
10#include "ns3/log.h"
11#include "ns3/network-scheduler.h"
12
13// An essential include is test.h
14#include "ns3/test.h"
15
16using namespace ns3;
17using namespace lorawan;
18
19NS_LOG_COMPONENT_DEFINE("NetworkSchedulerTestSuite");
20
21/**
22 * \ingroup lorawan
23 *
24 * It tests the correct functionality of the NetworkScheduler component class of the network server
25 */
27{
28 public:
29 NetworkSchedulerTest(); //!< Default constructor
30 ~NetworkSchedulerTest() override; //!< Destructor
31
32 private:
33 void DoRun() override;
34};
35
36// Add some help text to this case to describe what it is intended to test
38 : TestCase("Verify correct behavior of the NetworkScheduler object")
39{
40}
41
42// Reminder that the test case should clean up after itself
46
47// This method is the pure virtual method from class TestCase that every
48// TestCase must implement
49void
51{
52 NS_LOG_DEBUG("NetworkSchedulerTest");
53
54 // If a packet is received at the network server, a reply event should be
55 // scheduled to happen 1 second after the reception.
56}
57
58/**
59 * \ingroup lorawan
60 *
61 * The TestSuite class names the TestSuite, identifies what type of TestSuite, and enables the
62 * TestCases to be run. Typically, only the constructor for this class must be defined
63 */
65{
66 public:
67 NetworkSchedulerTestSuite(); //!< Default constructor
68};
69
71 : TestSuite("network-scheduler", Type::UNIT)
72{
73 LogComponentEnable("NetworkSchedulerTestSuite", LOG_LEVEL_DEBUG);
74 // TestDuration for TestCase can be QUICK, EXTENSIVE or TAKES_FOREVER
76}
77
78// 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:1050
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition test.cc:292
A suite of tests to run.
Definition test.h:1267
Type
Type of test.
Definition test.h:1274
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:257
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:291
@ LOG_LEVEL_DEBUG
LOG_DEBUG and above.
Definition log.h:102
static NetworkSchedulerTestSuite lorawanTestSuite