1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
3 * Copyright (c) 2022 Northeastern University
4 * Copyright (c) 2022 Sapienza, University of Rome
5 * Copyright (c) 2022 University of Padova
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation;
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * Author: Andrea Lacava <thecave003@gmail.com>
21 * Tommaso Zugno <tommasozugno@gmail.com>
22 * Michele Polese <michele.polese@gmail.com>
25 // Include a header file from your module to test.
26 #include "ns3/oran-interface.h"
28 // An essential include is test.h
31 // Do not put your test classes in namespace ns3. You may find it useful
32 // to use the using directive to access the ns3 namespace directly
35 // This is an example TestCase.
36 class OranInterfaceTestCase1 : public TestCase
39 OranInterfaceTestCase1 ();
40 virtual ~OranInterfaceTestCase1 ();
43 virtual void DoRun (void);
46 // Add some help text to this case to describe what it is intended to test
47 OranInterfaceTestCase1::OranInterfaceTestCase1 ()
48 : TestCase ("OranInterface test case (does nothing)")
52 // This destructor does nothing but we include it as a reminder that
53 // the test case should clean up after itself
54 OranInterfaceTestCase1::~OranInterfaceTestCase1 ()
59 // This method is the pure virtual method from class TestCase that every
60 // TestCase must implement
63 OranInterfaceTestCase1::DoRun (void)
65 // A wide variety of test macros are available in src/core/test.h
66 NS_TEST_ASSERT_MSG_EQ (true, true, "true doesn't equal true for some reason");
67 // Use this one for floating point comparisons
68 NS_TEST_ASSERT_MSG_EQ_TOL (0.01, 0.01, 0.001, "Numbers are not equal within tolerance");
71 // The TestSuite class names the TestSuite, identifies what type of TestSuite,
72 // and enables the TestCases to be run. Typically, only the constructor for
73 // this class must be defined
75 class OranInterfaceTestSuite : public TestSuite
78 OranInterfaceTestSuite ();
81 OranInterfaceTestSuite::OranInterfaceTestSuite ()
82 : TestSuite ("oran-interface", UNIT)
84 // TestDuration for TestCase can be QUICK, EXTENSIVE or TAKES_FOREVER
85 AddTestCase (new OranInterfaceTestCase1, TestCase::QUICK);
88 // Do not forget to allocate an instance of this TestSuite
89 static OranInterfaceTestSuite soranInterfaceTestSuite;