A Discrete-Event Network Simulator
API
LengthTestCase Class Reference

Implements tests for the Length class. More...

+ Inheritance diagram for LengthTestCase:
+ Collaboration diagram for LengthTestCase:

Public Member Functions

 LengthTestCase ()
 Constructor. More...
 
virtual ~LengthTestCase ()=default
 Destructor. More...
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 
TestCaseoperator= (const TestCase &)=delete
 

Protected Member Functions

void AssertFalse (bool condition, std::string msg)
 Helper function to compare results with false. More...
 
void AssertTrue (bool condition, std::string msg)
 Helper function to compare results with true. More...
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor. More...
 
void AddTestCase (TestCase *testCase, TestDuration duration=QUICK)
 Add an individual child TestCase to this test suite. More...
 
TestCaseGetParent () const
 Get the parent of this TestCsse. More...
 
bool IsStatusFailure (void) const
 Check if any tests failed. More...
 
bool IsStatusSuccess (void) const
 Check if all tests passed. More...
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found. More...
 
void ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line)
 Log the failure of this TestCase. More...
 
bool MustAssertOnFailure (void) const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure (void) const
 Check if this run should continue on failure. More...
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory. More...
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory. More...
 

Private Member Functions

virtual void DoRun ()
 Implementation to actually run this TestCase. More...
 
void TestConstructLengthFromQuantity ()
 Test that a Length object can be constructed from a Quantity object. More...
 
void TestConstructLengthFromSIUnits ()
 Test that a Length object constructed from various SI units has the correct value in meters. More...
 
void TestConstructLengthFromString (double unitValue, double meterValue, double tolerance, const std::initializer_list< std::string > &symbols)
 Test that a length object can be constructed from a string. More...
 
void TestConstructLengthFromUSUnits ()
 Test that a Length object constructed from various US units has the correct value in meters. More...
 
void TestCopyAssignment ()
 Test that a length object can be updated by assignment from another length object. More...
 
void TestDefaultLengthIsZero ()
 Test that a default constructed Length object has a value of 0. More...
 
void TestInputStreamOperator ()
 Test reading length object from a stream produces the expected length value. More...
 
void TestLengthCopyConstructor ()
 Test that the value from one length is copied to another using the copy constructor. More...
 
void TestLengthMoveConstructor ()
 Test that the value from one length is copied to another using the move constructor. More...
 
template<class T >
void TestLengthSerialization (const Length &l, const T &unit, const std::string &expectedOutput, const std::string &context)
 Generic function for testing serialization of a Length object in various units. More...
 
void TestMoveAssignment ()
 Test that a length object can be updated by assignment from a moved length object. More...
 
void TestOutputStreamOperator ()
 Test writing length object to a stream produces the expected output. More...
 
void TestQuantityAssignment ()
 Test that a length object can be updated by assignment from a quantity. More...
 
void TestSerializeLengthWithUnit ()
 Test serializing a length object to all of the supported unit types. More...
 
void TestTryParseReturnsFalse ()
 Test the TryParse function returns false on bad input. More...
 
void TestTryParseReturnsTrue ()
 Test the TryParse function returns true on success. More...
 
void TestConstructLengthFromMeterString ()
 Test that a length object can be constructed from a string. More...
 
void TestConstructLengthFromNanoMeterString ()
 Test that a length object can be constructed from a string. More...
 
void TestConstructLengthFromMicroMeterString ()
 Test that a length object can be constructed from a string. More...
 
void TestConstructLengthFromMilliMeterString ()
 Test that a length object can be constructed from a string. More...
 
void TestConstructLengthFromCentiMeterString ()
 Test that a length object can be constructed from a string. More...
 
void TestConstructLengthFromKiloMeterString ()
 Test that a length object can be constructed from a string. More...
 
void TestConstructLengthFromNauticalMileString ()
 Test that a length object can be constructed from a string. More...
 
void TestConstructLengthFromInchString ()
 Test that a length object can be constructed from a string. More...
 
void TestConstructLengthFromFootString ()
 Test that a length object can be constructed from a string. More...
 
void TestConstructLengthFromYardString ()
 Test that a length object can be constructed from a string. More...
 
void TestConstructLengthFromMileString ()
 Test that a length object can be constructed from a string. More...
 
void TestBuilderFreeFunctions ()
 Test constructing length objects using the builder free functions. More...
 
void TestIsEqualReturnsTrue ()
 Test member comparison operators. More...
 
void TestIsEqualReturnsFalse ()
 Test member comparison operators. More...
 
void TestIsEqualWithToleranceReturnsTrue ()
 Test member comparison operators. More...
 
void TestIsEqualWithToleranceReturnsFalse ()
 Test member comparison operators. More...
 
void TestIsNotEqualReturnsTrue ()
 Test member comparison operators. More...
 
void TestIsNotEqualReturnsFalse ()
 Test member comparison operators. More...
 
void TestIsNotEqualWithToleranceReturnsTrue ()
 Test member comparison operators. More...
 
void TestIsNotEqualWithToleranceReturnsFalse ()
 Test member comparison operators. More...
 
void TestIsLessReturnsTrue ()
 Test member comparison operators. More...
 
void TestIsLessReturnsFalse ()
 Test member comparison operators. More...
 
void TestIsLessWithToleranceReturnsFalse ()
 Test member comparison operators. More...
 
void TestIsGreaterReturnsTrue ()
 Test member comparison operators. More...
 
void TestIsGreaterReturnsFalse ()
 Test member comparison operators. More...
 
void TestIsGreaterWithToleranceReturnsFalse ()
 Test member comparison operators. More...
 
void TestOperatorEqualsReturnsTrue ()
 Test free function comparison operators. More...
 
void TestOperatorEqualsReturnsFalse ()
 Test free function comparison operators. More...
 
void TestOperatorNotEqualsReturnsTrue ()
 Test free function comparison operators. More...
 
void TestOperatorNotEqualsReturnsFalse ()
 Test free function comparison operators. More...
 
void TestOperatorLessThanReturnsTrue ()
 Test free function comparison operators. More...
 
void TestOperatorLessThanReturnsFalse ()
 Test free function comparison operators. More...
 
void TestOperatorLessOrEqualReturnsTrue ()
 Test free function comparison operators. More...
 
void TestOperatorLessOrEqualReturnsFalse ()
 Test free function comparison operators. More...
 
void TestOperatorGreaterThanReturnsTrue ()
 Test free function comparison operators. More...
 
void TestOperatorGreaterThanReturnsFalse ()
 Test free function comparison operators. More...
 
void TestOperatorGreaterOrEqualReturnsTrue ()
 Test free function comparison operators. More...
 
void TestOperatorGreaterOrEqualReturnsFalse ()
 Test free function comparison operators. More...
 
void TestAddingTwoLengths ()
 Test arithmetic operations. More...
 
void TestAddingLengthAndQuantity ()
 Test arithmetic operations. More...
 
void TestAddingQuantityAndLength ()
 Test arithmetic operations. More...
 
void TestSubtractingTwoLengths ()
 Test arithmetic operations. More...
 
void TestSubtractingLengthAndQuantity ()
 Test arithmetic operations. More...
 
void TestSubtractingQuantityAndLength ()
 Test arithmetic operations. More...
 
void TestMultiplyLengthByScalar ()
 Test arithmetic operations. More...
 
void TestMultiplyScalarByLength ()
 Test arithmetic operations. More...
 
void TestDivideLengthByScalar ()
 Test arithmetic operations. More...
 
void TestDivideLengthByLength ()
 Test arithmetic operations. More...
 
void TestDivideLengthByLengthReturnsNaN ()
 Test arithmetic operations. More...
 
void TestDivReturnsCorrectResult ()
 Test Div function. More...
 
void TestDivReturnsZeroRemainder ()
 Test Div function. More...
 
void TestDivReturnsCorrectRemainder ()
 Test Div function. More...
 
void TestModReturnsZero ()
 Test Mod function. More...
 
void TestModReturnsNonZero ()
 Test Mod function. More...
 

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum  TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 

Detailed Description

Implements tests for the Length class.

Definition at line 64 of file length-test-suite.cc.

Constructor & Destructor Documentation

◆ LengthTestCase()

LengthTestCase::LengthTestCase ( )
inline

Constructor.

Definition at line 70 of file length-test-suite.cc.

◆ ~LengthTestCase()

virtual LengthTestCase::~LengthTestCase ( )
virtualdefault

Destructor.

Member Function Documentation

◆ AssertFalse()

void LengthTestCase::AssertFalse ( bool  condition,
std::string  msg 
)
inlineprotected

Helper function to compare results with false.

Parameters
conditionThe boolean condition to test
msgThe message to print if the test fails

Definition at line 86 of file length-test-suite.cc.

References NS_TEST_ASSERT_MSG_EQ.

◆ AssertTrue()

void LengthTestCase::AssertTrue ( bool  condition,
std::string  msg 
)
inlineprotected

Helper function to compare results with true.

Parameters
conditionThe boolean condition to test
msgThe message to print if the test fails

Definition at line 97 of file length-test-suite.cc.

References NS_TEST_ASSERT_MSG_EQ.

◆ DoRun()

void LengthTestCase::DoRun ( )
privatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 1379 of file length-test-suite.cc.

◆ TestAddingLengthAndQuantity()

void LengthTestCase::TestAddingLengthAndQuantity ( )
private

Test arithmetic operations.

Definition at line 1132 of file length-test-suite.cc.

References ns3::Length::GetDouble(), NS_TEST_ASSERT_MSG_EQ, and test-ns3::result.

+ Here is the call graph for this function:

◆ TestAddingQuantityAndLength()

void LengthTestCase::TestAddingQuantityAndLength ( )
private

Test arithmetic operations.

Definition at line 1148 of file length-test-suite.cc.

References ns3::Length::GetDouble(), NS_TEST_ASSERT_MSG_EQ, and test-ns3::result.

+ Here is the call graph for this function:

◆ TestAddingTwoLengths()

void LengthTestCase::TestAddingTwoLengths ( )
private

Test arithmetic operations.

Definition at line 1113 of file length-test-suite.cc.

References ns3::Length::GetDouble(), NS_TEST_ASSERT_MSG_EQ, and test-ns3::result.

+ Here is the call graph for this function:

◆ TestBuilderFreeFunctions()

void LengthTestCase::TestBuilderFreeFunctions ( )
private

Test constructing length objects using the builder free functions.

Definition at line 618 of file length-test-suite.cc.

References ns3::CentiMeters(), ns3::Feet(), ns3::Inches(), ns3::KiloMeters(), ns3::Meters(), ns3::MicroMeters(), ns3::Miles(), ns3::MilliMeters(), ns3::NanoMeters(), ns3::NauticalMiles(), NS_TEST_ASSERT_MSG_EQ, and ns3::Yards().

+ Here is the call graph for this function:

◆ TestConstructLengthFromCentiMeterString()

void LengthTestCase::TestConstructLengthFromCentiMeterString ( )
private

Test that a length object can be constructed from a string.

Definition at line 485 of file length-test-suite.cc.

◆ TestConstructLengthFromFootString()

void LengthTestCase::TestConstructLengthFromFootString ( )
private

Test that a length object can be constructed from a string.

Definition at line 528 of file length-test-suite.cc.

◆ TestConstructLengthFromInchString()

void LengthTestCase::TestConstructLengthFromInchString ( )
private

Test that a length object can be constructed from a string.

Definition at line 517 of file length-test-suite.cc.

◆ TestConstructLengthFromKiloMeterString()

void LengthTestCase::TestConstructLengthFromKiloMeterString ( )
private

Test that a length object can be constructed from a string.

Definition at line 497 of file length-test-suite.cc.

◆ TestConstructLengthFromMeterString()

void LengthTestCase::TestConstructLengthFromMeterString ( )
private

Test that a length object can be constructed from a string.

Definition at line 441 of file length-test-suite.cc.

◆ TestConstructLengthFromMicroMeterString()

void LengthTestCase::TestConstructLengthFromMicroMeterString ( )
private

Test that a length object can be constructed from a string.

Definition at line 461 of file length-test-suite.cc.

◆ TestConstructLengthFromMileString()

void LengthTestCase::TestConstructLengthFromMileString ( )
private

Test that a length object can be constructed from a string.

Definition at line 550 of file length-test-suite.cc.

◆ TestConstructLengthFromMilliMeterString()

void LengthTestCase::TestConstructLengthFromMilliMeterString ( )
private

Test that a length object can be constructed from a string.

Definition at line 473 of file length-test-suite.cc.

◆ TestConstructLengthFromNanoMeterString()

void LengthTestCase::TestConstructLengthFromNanoMeterString ( )
private

Test that a length object can be constructed from a string.

Definition at line 450 of file length-test-suite.cc.

◆ TestConstructLengthFromNauticalMileString()

void LengthTestCase::TestConstructLengthFromNauticalMileString ( )
private

Test that a length object can be constructed from a string.

Definition at line 508 of file length-test-suite.cc.

◆ TestConstructLengthFromQuantity()

void LengthTestCase::TestConstructLengthFromQuantity ( )
private

Test that a Length object can be constructed from a Quantity object.

Definition at line 330 of file length-test-suite.cc.

References ns3::Length::GetDouble(), NS_TEST_ASSERT_MSG_EQ, and ns3::Length::Quantity::Value().

+ Here is the call graph for this function:

◆ TestConstructLengthFromSIUnits()

void LengthTestCase::TestConstructLengthFromSIUnits ( )
private

Test that a Length object constructed from various SI units has the correct value in meters.

Definition at line 341 of file length-test-suite.cc.

References ns3::Length::GetDouble(), and NS_TEST_ASSERT_MSG_EQ.

+ Here is the call graph for this function:

◆ TestConstructLengthFromString()

void LengthTestCase::TestConstructLengthFromString ( double  unitValue,
double  meterValue,
double  tolerance,
const std::initializer_list< std::string > &  symbols 
)
private

Test that a length object can be constructed from a string.

Parameters
unitValue//!< Value to test.
meterValue//!< Reference value [m].
tolerance//!< Tolerance.
symbols//!< Unit symbols.

Definition at line 415 of file length-test-suite.cc.

References ns3::Length::GetDouble(), and NS_TEST_ASSERT_MSG_EQ_TOL.

+ Here is the call graph for this function:

◆ TestConstructLengthFromUSUnits()

void LengthTestCase::TestConstructLengthFromUSUnits ( )
private

Test that a Length object constructed from various US units has the correct value in meters.

Definition at line 366 of file length-test-suite.cc.

References ns3::Length::GetDouble(), and NS_TEST_ASSERT_MSG_EQ_TOL.

+ Here is the call graph for this function:

◆ TestConstructLengthFromYardString()

void LengthTestCase::TestConstructLengthFromYardString ( )
private

Test that a length object can be constructed from a string.

Definition at line 539 of file length-test-suite.cc.

◆ TestCopyAssignment()

void LengthTestCase::TestCopyAssignment ( )
private

Test that a length object can be updated by assignment from another length object.

Definition at line 689 of file length-test-suite.cc.

References ns3::Length::GetDouble(), and NS_TEST_ASSERT_MSG_EQ.

+ Here is the call graph for this function:

◆ TestDefaultLengthIsZero()

void LengthTestCase::TestDefaultLengthIsZero ( )
private

Test that a default constructed Length object has a value of 0.

Definition at line 322 of file length-test-suite.cc.

References ns3::Length::GetDouble(), and NS_TEST_ASSERT_MSG_EQ.

+ Here is the call graph for this function:

◆ TestDivideLengthByLength()

void LengthTestCase::TestDivideLengthByLength ( )
private

Test arithmetic operations.

Definition at line 1263 of file length-test-suite.cc.

References ns3::Length::GetDouble(), NS_TEST_ASSERT_MSG_EQ, and test-ns3::result.

+ Here is the call graph for this function:

◆ TestDivideLengthByLengthReturnsNaN()

void LengthTestCase::TestDivideLengthByLengthReturnsNaN ( )
private

Test arithmetic operations.

Definition at line 1284 of file length-test-suite.cc.

References test-ns3::result.

◆ TestDivideLengthByScalar()

void LengthTestCase::TestDivideLengthByScalar ( )
private

Test arithmetic operations.

Definition at line 1247 of file length-test-suite.cc.

References ns3::Length::GetDouble(), NS_TEST_ASSERT_MSG_EQ, and test-ns3::result.

+ Here is the call graph for this function:

◆ TestDivReturnsCorrectRemainder()

void LengthTestCase::TestDivReturnsCorrectRemainder ( )
private

Test Div function.

Definition at line 1334 of file length-test-suite.cc.

References ns3::Div(), ns3::Length::GetDouble(), NS_TEST_ASSERT_MSG_EQ, and test-ns3::result.

+ Here is the call graph for this function:

◆ TestDivReturnsCorrectResult()

void LengthTestCase::TestDivReturnsCorrectResult ( )
private

Test Div function.

Definition at line 1298 of file length-test-suite.cc.

References ns3::Div(), NS_TEST_ASSERT_MSG_EQ, and test-ns3::result.

+ Here is the call graph for this function:

◆ TestDivReturnsZeroRemainder()

void LengthTestCase::TestDivReturnsZeroRemainder ( )
private

Test Div function.

Definition at line 1314 of file length-test-suite.cc.

References ns3::Div(), ns3::Length::GetDouble(), NS_TEST_ASSERT_MSG_EQ, and test-ns3::result.

+ Here is the call graph for this function:

◆ TestInputStreamOperator()

void LengthTestCase::TestInputStreamOperator ( )
private

Test reading length object from a stream produces the expected length value.

Definition at line 906 of file length-test-suite.cc.

References ns3::Length::GetDouble(), and NS_TEST_ASSERT_MSG_EQ.

+ Here is the call graph for this function:

◆ TestIsEqualReturnsFalse()

void LengthTestCase::TestIsEqualReturnsFalse ( )
private

Test member comparison operators.

Definition at line 741 of file length-test-suite.cc.

References ns3::Length::IsEqual().

+ Here is the call graph for this function:

◆ TestIsEqualReturnsTrue()

void LengthTestCase::TestIsEqualReturnsTrue ( )
private

Test member comparison operators.

Definition at line 731 of file length-test-suite.cc.

References ns3::Length::IsEqual().

+ Here is the call graph for this function:

◆ TestIsEqualWithToleranceReturnsFalse()

void LengthTestCase::TestIsEqualWithToleranceReturnsFalse ( )
private

Test member comparison operators.

Definition at line 764 of file length-test-suite.cc.

References ns3::Length::IsEqual().

+ Here is the call graph for this function:

◆ TestIsEqualWithToleranceReturnsTrue()

void LengthTestCase::TestIsEqualWithToleranceReturnsTrue ( )
private

Test member comparison operators.

Definition at line 751 of file length-test-suite.cc.

References ns3::Length::IsEqual().

+ Here is the call graph for this function:

◆ TestIsGreaterReturnsFalse()

void LengthTestCase::TestIsGreaterReturnsFalse ( )
private

Test member comparison operators.

Definition at line 871 of file length-test-suite.cc.

References ns3::Length::IsGreater().

+ Here is the call graph for this function:

◆ TestIsGreaterReturnsTrue()

void LengthTestCase::TestIsGreaterReturnsTrue ( )
private

Test member comparison operators.

Definition at line 861 of file length-test-suite.cc.

References ns3::Length::IsGreater().

+ Here is the call graph for this function:

◆ TestIsGreaterWithToleranceReturnsFalse()

void LengthTestCase::TestIsGreaterWithToleranceReturnsFalse ( )
private

Test member comparison operators.

Definition at line 881 of file length-test-suite.cc.

References ns3::Length::IsGreater().

+ Here is the call graph for this function:

◆ TestIsLessReturnsFalse()

void LengthTestCase::TestIsLessReturnsFalse ( )
private

Test member comparison operators.

Definition at line 837 of file length-test-suite.cc.

References ns3::Length::IsLess().

+ Here is the call graph for this function:

◆ TestIsLessReturnsTrue()

void LengthTestCase::TestIsLessReturnsTrue ( )
private

Test member comparison operators.

Definition at line 825 of file length-test-suite.cc.

References ns3::Length::IsLess().

+ Here is the call graph for this function:

◆ TestIsLessWithToleranceReturnsFalse()

void LengthTestCase::TestIsLessWithToleranceReturnsFalse ( )
private

Test member comparison operators.

Definition at line 849 of file length-test-suite.cc.

References ns3::Length::IsLess().

+ Here is the call graph for this function:

◆ TestIsNotEqualReturnsFalse()

void LengthTestCase::TestIsNotEqualReturnsFalse ( )
private

Test member comparison operators.

Definition at line 789 of file length-test-suite.cc.

References ns3::Length::IsNotEqual().

+ Here is the call graph for this function:

◆ TestIsNotEqualReturnsTrue()

void LengthTestCase::TestIsNotEqualReturnsTrue ( )
private

Test member comparison operators.

Definition at line 777 of file length-test-suite.cc.

References ns3::Length::IsNotEqual().

+ Here is the call graph for this function:

◆ TestIsNotEqualWithToleranceReturnsFalse()

void LengthTestCase::TestIsNotEqualWithToleranceReturnsFalse ( )
private

Test member comparison operators.

Definition at line 813 of file length-test-suite.cc.

References ns3::Length::IsNotEqual().

+ Here is the call graph for this function:

◆ TestIsNotEqualWithToleranceReturnsTrue()

void LengthTestCase::TestIsNotEqualWithToleranceReturnsTrue ( )
private

Test member comparison operators.

Definition at line 801 of file length-test-suite.cc.

References ns3::Length::IsNotEqual().

+ Here is the call graph for this function:

◆ TestLengthCopyConstructor()

void LengthTestCase::TestLengthCopyConstructor ( )
private

Test that the value from one length is copied to another using the copy constructor.

Definition at line 391 of file length-test-suite.cc.

References ns3::Length::GetDouble(), and NS_TEST_ASSERT_MSG_EQ.

+ Here is the call graph for this function:

◆ TestLengthMoveConstructor()

void LengthTestCase::TestLengthMoveConstructor ( )
private

Test that the value from one length is copied to another using the move constructor.

Definition at line 403 of file length-test-suite.cc.

References ns3::Length::GetDouble(), and NS_TEST_ASSERT_MSG_EQ.

+ Here is the call graph for this function:

◆ TestLengthSerialization()

template<class T >
void LengthTestCase::TestLengthSerialization ( const Length l,
const T &  unit,
const std::string &  expectedOutput,
const std::string &  context 
)
private

Generic function for testing serialization of a Length object in various units.

Template Parameters
TType of the length unit that should be output during serialization
Parameters
lLength object to serialize
unitUnit that the length value will be converted to before serialization
expectedOutputExpected result of the serialization
contextIncluded in the error message if the test fails

Definition at line 924 of file length-test-suite.cc.

References ns3::Length::As(), and NS_TEST_ASSERT_MSG_EQ.

+ Here is the call graph for this function:

◆ TestModReturnsNonZero()

void LengthTestCase::TestModReturnsNonZero ( )
private

Test Mod function.

Definition at line 1366 of file length-test-suite.cc.

References ns3::Mod(), NS_TEST_ASSERT_MSG_EQ, and test-ns3::result.

+ Here is the call graph for this function:

◆ TestModReturnsZero()

void LengthTestCase::TestModReturnsZero ( )
private

Test Mod function.

Definition at line 1354 of file length-test-suite.cc.

References ns3::Mod(), NS_TEST_ASSERT_MSG_EQ, and test-ns3::result.

+ Here is the call graph for this function:

◆ TestMoveAssignment()

void LengthTestCase::TestMoveAssignment ( )
private

Test that a length object can be updated by assignment from a moved length object.

Definition at line 703 of file length-test-suite.cc.

References ns3::Length::GetDouble(), and NS_TEST_ASSERT_MSG_EQ.

+ Here is the call graph for this function:

◆ TestMultiplyLengthByScalar()

void LengthTestCase::TestMultiplyLengthByScalar ( )
private

Test arithmetic operations.

Definition at line 1215 of file length-test-suite.cc.

References ns3::Length::GetDouble(), NS_TEST_ASSERT_MSG_EQ, and test-ns3::result.

+ Here is the call graph for this function:

◆ TestMultiplyScalarByLength()

void LengthTestCase::TestMultiplyScalarByLength ( )
private

Test arithmetic operations.

Definition at line 1231 of file length-test-suite.cc.

References ns3::Length::GetDouble(), NS_TEST_ASSERT_MSG_EQ, and test-ns3::result.

+ Here is the call graph for this function:

◆ TestOperatorEqualsReturnsFalse()

void LengthTestCase::TestOperatorEqualsReturnsFalse ( )
private

Test free function comparison operators.

Definition at line 971 of file length-test-suite.cc.

◆ TestOperatorEqualsReturnsTrue()

void LengthTestCase::TestOperatorEqualsReturnsTrue ( )
private

Test free function comparison operators.

Definition at line 959 of file length-test-suite.cc.

◆ TestOperatorGreaterOrEqualReturnsFalse()

void LengthTestCase::TestOperatorGreaterOrEqualReturnsFalse ( )
private

Test free function comparison operators.

Definition at line 1101 of file length-test-suite.cc.

◆ TestOperatorGreaterOrEqualReturnsTrue()

void LengthTestCase::TestOperatorGreaterOrEqualReturnsTrue ( )
private

Test free function comparison operators.

Definition at line 1085 of file length-test-suite.cc.

◆ TestOperatorGreaterThanReturnsFalse()

void LengthTestCase::TestOperatorGreaterThanReturnsFalse ( )
private

Test free function comparison operators.

Definition at line 1073 of file length-test-suite.cc.

◆ TestOperatorGreaterThanReturnsTrue()

void LengthTestCase::TestOperatorGreaterThanReturnsTrue ( )
private

Test free function comparison operators.

Definition at line 1061 of file length-test-suite.cc.

◆ TestOperatorLessOrEqualReturnsFalse()

void LengthTestCase::TestOperatorLessOrEqualReturnsFalse ( )
private

Test free function comparison operators.

Definition at line 1049 of file length-test-suite.cc.

◆ TestOperatorLessOrEqualReturnsTrue()

void LengthTestCase::TestOperatorLessOrEqualReturnsTrue ( )
private

Test free function comparison operators.

Definition at line 1033 of file length-test-suite.cc.

◆ TestOperatorLessThanReturnsFalse()

void LengthTestCase::TestOperatorLessThanReturnsFalse ( )
private

Test free function comparison operators.

Definition at line 1021 of file length-test-suite.cc.

◆ TestOperatorLessThanReturnsTrue()

void LengthTestCase::TestOperatorLessThanReturnsTrue ( )
private

Test free function comparison operators.

Definition at line 1009 of file length-test-suite.cc.

◆ TestOperatorNotEqualsReturnsFalse()

void LengthTestCase::TestOperatorNotEqualsReturnsFalse ( )
private

Test free function comparison operators.

Definition at line 996 of file length-test-suite.cc.

◆ TestOperatorNotEqualsReturnsTrue()

void LengthTestCase::TestOperatorNotEqualsReturnsTrue ( )
private

Test free function comparison operators.

Definition at line 983 of file length-test-suite.cc.

◆ TestOutputStreamOperator()

void LengthTestCase::TestOutputStreamOperator ( )
private

Test writing length object to a stream produces the expected output.

Definition at line 893 of file length-test-suite.cc.

References NS_TEST_ASSERT_MSG_EQ.

◆ TestQuantityAssignment()

void LengthTestCase::TestQuantityAssignment ( )
private

Test that a length object can be updated by assignment from a quantity.

Definition at line 717 of file length-test-suite.cc.

References NS_TEST_ASSERT_MSG_EQ.

◆ TestSerializeLengthWithUnit()

void LengthTestCase::TestSerializeLengthWithUnit ( )
private

Test serializing a length object to all of the supported unit types.

Definition at line 941 of file length-test-suite.cc.

◆ TestSubtractingLengthAndQuantity()

void LengthTestCase::TestSubtractingLengthAndQuantity ( )
private

Test arithmetic operations.

Definition at line 1183 of file length-test-suite.cc.

References ns3::Length::GetDouble(), NS_TEST_ASSERT_MSG_EQ, and test-ns3::result.

+ Here is the call graph for this function:

◆ TestSubtractingQuantityAndLength()

void LengthTestCase::TestSubtractingQuantityAndLength ( )
private

Test arithmetic operations.

Definition at line 1199 of file length-test-suite.cc.

References ns3::Length::GetDouble(), NS_TEST_ASSERT_MSG_EQ, and test-ns3::result.

+ Here is the call graph for this function:

◆ TestSubtractingTwoLengths()

void LengthTestCase::TestSubtractingTwoLengths ( )
private

Test arithmetic operations.

Definition at line 1164 of file length-test-suite.cc.

References ns3::Length::GetDouble(), NS_TEST_ASSERT_MSG_EQ, and test-ns3::result.

+ Here is the call graph for this function:

◆ TestTryParseReturnsFalse()

void LengthTestCase::TestTryParseReturnsFalse ( )
private

Test the TryParse function returns false on bad input.

Definition at line 651 of file length-test-suite.cc.

References ns3::Length::TryParse().

+ Here is the call graph for this function:

◆ TestTryParseReturnsTrue()

void LengthTestCase::TestTryParseReturnsTrue ( )
private

Test the TryParse function returns true on success.

Definition at line 659 of file length-test-suite.cc.

References NS_TEST_ASSERT_MSG_EQ_TOL, test-ns3::tests, and ns3::Length::TryParse().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: