#include <list>
#include <string>
#include <utility>
#include <ostream>
Go to the source code of this file.
Classes | |
class | ns3::Test |
base class for new regressions tests More... | |
class | ns3::TestManager |
gather and run all regression tests More... | |
Namespaces | |
namespace | ns3 |
Every class exported by the ns3 library is enclosed in the ns3 namespace. | |
Defines | |
#define | NS_TEST_ASSERT_EQUAL_FILELINE(got, expected, file, line) |
#define | NS_TEST_ASSERT_UNEQUAL_FILELINE(got, expected, file, line) |
#define | NS_TEST_ASSERT_FILELINE(assertion, file, line) |
#define | NS_TEST_ASSERT_EQUAL(got, expected) NS_TEST_ASSERT_EQUAL_FILELINE(got,expected,__FILE__,__LINE__) |
#define | NS_TEST_ASSERT_UNEQUAL(got, expected) NS_TEST_ASSERT_UNEQUAL_FILELINE(got,expected,__FILE__,__LINE__) |
#define | NS_TEST_ASSERT(assertion) NS_TEST_ASSERT_FILELINE (assertion, __FILE__,__LINE__) |
#define NS_TEST_ASSERT | ( | assertion | ) | NS_TEST_ASSERT_FILELINE (assertion, __FILE__,__LINE__) |
Convenience macro to check an assertion is held during an unit test. Note: this macro assumes a 'bool result = true' declaration exists in the test function body, and that the function returns that value.
assertion | expression that must be true if the test did not fail |
Definition at line 179 of file test.h.
Referenced by ns3::PacketTest::DoCheck(), ns3::DcfManagerTest::EndTest(), ns3::DcfManagerTest::NotifyAccessGranted(), ns3::DcfManagerTest::NotifyCollision(), ns3::DcfManagerTest::NotifyInternalCollision(), ns3::SimulatorTests::RunOneTest(), ns3::WatchdogTests::RunTests(), ns3::TimerTests::RunTests(), ns3::TimeTests::RunTests(), ns3::SimulatorTests::RunTests(), ns3::olsr::OlsrRoutingTableTest::RunTests(), ns3::OlsrHeaderTest::RunTests(), ns3::DropTailQueueTest::RunTests(), ns3::TracedCallbackTest::RunTests(), ns3::AttributeTest::RunTests(), and ns3::BufferTest::RunTests().
#define NS_TEST_ASSERT_EQUAL | ( | got, | |||
expected | ) | NS_TEST_ASSERT_EQUAL_FILELINE(got,expected,__FILE__,__LINE__) |
Convenience macro to check that a value returned by a test is what is expected. Note: this macro assumes a 'bool result = true' declaration exists in the test function body, and that the function returns that value.
got | value obtained from the test | |
expected | value that the test is expected to return |
Definition at line 156 of file test.h.
Referenced by ns3::PacketTest::DoCheck(), ns3::WatchdogTests::Expire(), ns3::DcfManagerTest::NotifyAccessGranted(), ns3::DcfManagerTest::NotifyCollision(), ns3::DcfManagerTest::NotifyInternalCollision(), ns3::TimerTests::RunTests(), ns3::HighPrecision128Tests::RunTests(), ns3::olsr::OlsrRoutingTableTest::RunTests(), ns3::OlsrHeaderTest::RunTests(), ns3::Ipv4AddressGeneratorTest::RunTests(), ns3::DropTailQueueTest::RunTests(), ns3::UdpSocketImplTest::RunTests(), ns3::AddressHelperTest::RunTests(), ns3::TypeTraitsTest::RunTests(), ns3::RandomVariableTest::RunTests(), ns3::ObjectTest::RunTests(), ns3::GlobalValueTests::RunTests(), ns3::ConfigTest::RunTests(), CommandLineTest::RunTests(), ns3::AttributeTest::RunTests(), ns3::EventGarbageCollectorTests::RunTests(), ns3::PacketTest::RunTests(), and ns3::PacketMetadataTest::RunTests().
#define NS_TEST_ASSERT_EQUAL_FILELINE | ( | got, | |||
expected, | |||||
file, | |||||
line | ) |
do { \ if ((got) != (expected)) \ { \ Failure () << file << ":" <<line \ << ": expected " << (expected) \ << ", got " << (got) << std::endl; \ result = false; \ } \ } while (false)
Definition at line 111 of file test.h.
Referenced by ns3::PacketTest::DoCheck().
#define NS_TEST_ASSERT_FILELINE | ( | assertion, | |||
file, | |||||
line | ) |
#define NS_TEST_ASSERT_UNEQUAL | ( | got, | |||
expected | ) | NS_TEST_ASSERT_UNEQUAL_FILELINE(got,expected,__FILE__,__LINE__) |
Convenience macro to check that a value returned by a test is what is expected. Note: this macro assumes a 'bool result = true' declaration exists in the test function body, and that the function returns that value.
got | value obtained from the test | |
expected | value that the test is expected to return |
Definition at line 168 of file test.h.
Referenced by ns3::ObjectTest::RunTests(), and ns3::AttributeTest::RunTests().