First release
[sim/ns3-o-ran-e2.git] / test / oran-interface-test-suite.cc
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2022 Northeastern University
4  * Copyright (c) 2022 Sapienza, University of Rome
5  * Copyright (c) 2022 University of Padova
6  *
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;
10  *
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.
15  *
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
19  *
20  * Author: Andrea Lacava <thecave003@gmail.com>
21  *                 Tommaso Zugno <tommasozugno@gmail.com>
22  *                 Michele Polese <michele.polese@gmail.com>
23  */
24
25 // Include a header file from your module to test.
26 #include "ns3/oran-interface.h"
27
28 // An essential include is test.h
29 #include "ns3/test.h"
30
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
33 using namespace ns3;
34
35 // This is an example TestCase.
36 class OranInterfaceTestCase1 : public TestCase
37 {
38 public:
39   OranInterfaceTestCase1 ();
40   virtual ~OranInterfaceTestCase1 ();
41
42 private:
43   virtual void DoRun (void);
44 };
45
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)")
49 {
50 }
51
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 ()
55 {
56 }
57
58 //
59 // This method is the pure virtual method from class TestCase that every
60 // TestCase must implement
61 //
62 void
63 OranInterfaceTestCase1::DoRun (void)
64 {
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");
69 }
70
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
74 //
75 class OranInterfaceTestSuite : public TestSuite
76 {
77 public:
78   OranInterfaceTestSuite ();
79 };
80
81 OranInterfaceTestSuite::OranInterfaceTestSuite ()
82   : TestSuite ("oran-interface", UNIT)
83 {
84   // TestDuration for TestCase can be QUICK, EXTENSIVE or TAKES_FOREVER
85   AddTestCase (new OranInterfaceTestCase1, TestCase::QUICK);
86 }
87
88 // Do not forget to allocate an instance of this TestSuite
89 static OranInterfaceTestSuite soranInterfaceTestSuite;
90