A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
LengthTestCase Class Reference

Implements tests for the Length class. More...

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

Public Member Functions

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

Protected Member Functions

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

Private Member Functions

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

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum class  Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 
using instead = Duration
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto QUICK = Duration::QUICK
 
static constexpr auto TAKES_FOREVER
 

Detailed Description

Implements tests for the Length class.

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

Constructor & Destructor Documentation

◆ LengthTestCase()

LengthTestCase::LengthTestCase ( )
inline

Constructor.

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

◆ ~LengthTestCase()

LengthTestCase::~LengthTestCase ( )
overridedefault

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.

Referenced by TestIsEqualReturnsFalse(), TestIsEqualWithToleranceReturnsFalse(), TestIsGreaterReturnsFalse(), TestIsGreaterWithToleranceReturnsFalse(), TestIsLessReturnsFalse(), TestIsLessWithToleranceReturnsFalse(), TestIsNotEqualReturnsFalse(), TestIsNotEqualWithToleranceReturnsFalse(), TestOperatorEqualsReturnsFalse(), TestOperatorGreaterOrEqualReturnsFalse(), TestOperatorGreaterThanReturnsFalse(), TestOperatorLessOrEqualReturnsFalse(), TestOperatorLessThanReturnsFalse(), TestOperatorNotEqualsReturnsFalse(), and TestTryParseReturnsFalse().

+ Here is the caller graph for this function:

◆ 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.

Referenced by TestDivideLengthByLengthReturnsNaN(), TestIsEqualReturnsTrue(), TestIsEqualWithToleranceReturnsTrue(), TestIsGreaterReturnsTrue(), TestIsLessReturnsTrue(), TestIsNotEqualReturnsTrue(), TestIsNotEqualWithToleranceReturnsTrue(), TestOperatorEqualsReturnsTrue(), TestOperatorGreaterOrEqualReturnsTrue(), TestOperatorGreaterThanReturnsTrue(), TestOperatorLessOrEqualReturnsTrue(), TestOperatorLessThanReturnsTrue(), TestOperatorNotEqualsReturnsTrue(), and TestTryParseReturnsTrue().

+ Here is the caller graph for this function:

◆ DoRun()

void LengthTestCase::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

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

References TestAddingLengthAndQuantity(), TestAddingQuantityAndLength(), TestAddingTwoLengths(), TestBuilderFreeFunctions(), TestConstructLengthFromCentiMeterString(), TestConstructLengthFromFootString(), TestConstructLengthFromInchString(), TestConstructLengthFromKiloMeterString(), TestConstructLengthFromMeterString(), TestConstructLengthFromMicroMeterString(), TestConstructLengthFromMileString(), TestConstructLengthFromMilliMeterString(), TestConstructLengthFromNanoMeterString(), TestConstructLengthFromNauticalMileString(), TestConstructLengthFromQuantity(), TestConstructLengthFromSIUnits(), TestConstructLengthFromUSUnits(), TestConstructLengthFromYardString(), TestCopyAssignment(), TestDefaultLengthIsZero(), TestDivideLengthByLength(), TestDivideLengthByLengthReturnsNaN(), TestDivideLengthByScalar(), TestDivReturnsCorrectRemainder(), TestDivReturnsCorrectResult(), TestDivReturnsZeroRemainder(), TestIsEqualReturnsFalse(), TestIsEqualReturnsTrue(), TestIsEqualWithToleranceReturnsFalse(), TestIsEqualWithToleranceReturnsTrue(), TestIsGreaterReturnsFalse(), TestIsGreaterReturnsTrue(), TestIsGreaterWithToleranceReturnsFalse(), TestIsLessReturnsFalse(), TestIsLessReturnsTrue(), TestIsLessWithToleranceReturnsFalse(), TestIsNotEqualReturnsFalse(), TestIsNotEqualReturnsTrue(), TestIsNotEqualWithToleranceReturnsFalse(), TestIsNotEqualWithToleranceReturnsTrue(), TestLengthCopyConstructor(), TestLengthMoveConstructor(), TestModReturnsNonZero(), TestModReturnsZero(), TestMoveAssignment(), TestMultiplyLengthByScalar(), TestMultiplyScalarByLength(), TestOperatorEqualsReturnsFalse(), TestOperatorEqualsReturnsTrue(), TestOperatorGreaterOrEqualReturnsFalse(), TestOperatorGreaterOrEqualReturnsTrue(), TestOperatorGreaterThanReturnsFalse(), TestOperatorGreaterThanReturnsTrue(), TestOperatorLessOrEqualReturnsFalse(), TestOperatorLessOrEqualReturnsTrue(), TestOperatorLessThanReturnsFalse(), TestOperatorLessThanReturnsTrue(), TestOperatorNotEqualsReturnsFalse(), TestOperatorNotEqualsReturnsTrue(), TestOutputStreamOperator(), TestQuantityAssignment(), TestSerializeLengthWithUnit(), TestSubtractingLengthAndQuantity(), TestSubtractingQuantityAndLength(), TestSubtractingTwoLengths(), TestTryParseReturnsFalse(), and TestTryParseReturnsTrue().

+ Here is the call graph for this function:

◆ TestAddingLengthAndQuantity()

void LengthTestCase::TestAddingLengthAndQuantity ( )
private

Test arithmetic operations.

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

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestAddingQuantityAndLength()

void LengthTestCase::TestAddingQuantityAndLength ( )
private

Test arithmetic operations.

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

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestAddingTwoLengths()

void LengthTestCase::TestAddingTwoLengths ( )
private

Test arithmetic operations.

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

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestBuilderFreeFunctions()

void LengthTestCase::TestBuilderFreeFunctions ( )
private

Test constructing length objects using the builder free functions.

Definition at line 628 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().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestConstructLengthFromCentiMeterString()

void LengthTestCase::TestConstructLengthFromCentiMeterString ( )
private

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

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

References TestConstructLengthFromString().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestConstructLengthFromFootString()

void LengthTestCase::TestConstructLengthFromFootString ( )
private

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

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

References TestConstructLengthFromString().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestConstructLengthFromInchString()

void LengthTestCase::TestConstructLengthFromInchString ( )
private

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

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

References TestConstructLengthFromString().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestConstructLengthFromKiloMeterString()

void LengthTestCase::TestConstructLengthFromKiloMeterString ( )
private

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

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

References TestConstructLengthFromString().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestConstructLengthFromMeterString()

void LengthTestCase::TestConstructLengthFromMeterString ( )
private

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

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

References TestConstructLengthFromString().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestConstructLengthFromMicroMeterString()

void LengthTestCase::TestConstructLengthFromMicroMeterString ( )
private

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

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

References TestConstructLengthFromString().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestConstructLengthFromMileString()

void LengthTestCase::TestConstructLengthFromMileString ( )
private

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

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

References TestConstructLengthFromString().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestConstructLengthFromMilliMeterString()

void LengthTestCase::TestConstructLengthFromMilliMeterString ( )
private

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

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

References TestConstructLengthFromString().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestConstructLengthFromNanoMeterString()

void LengthTestCase::TestConstructLengthFromNanoMeterString ( )
private

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

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

References TestConstructLengthFromString().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestConstructLengthFromNauticalMileString()

void LengthTestCase::TestConstructLengthFromNauticalMileString ( )
private

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

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

References TestConstructLengthFromString().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestConstructLengthFromQuantity()

void LengthTestCase::TestConstructLengthFromQuantity ( )
private

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

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

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller 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.

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller 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 418 of file length-test-suite.cc.

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

Referenced by TestConstructLengthFromCentiMeterString(), TestConstructLengthFromFootString(), TestConstructLengthFromInchString(), TestConstructLengthFromKiloMeterString(), TestConstructLengthFromMeterString(), TestConstructLengthFromMicroMeterString(), TestConstructLengthFromMileString(), TestConstructLengthFromMilliMeterString(), TestConstructLengthFromNanoMeterString(), TestConstructLengthFromNauticalMileString(), and TestConstructLengthFromYardString().

+ Here is the call graph for this function:
+ Here is the caller 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.

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestConstructLengthFromYardString()

void LengthTestCase::TestConstructLengthFromYardString ( )
private

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

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

References TestConstructLengthFromString().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestCopyAssignment()

void LengthTestCase::TestCopyAssignment ( )
private

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

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

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestDefaultLengthIsZero()

void LengthTestCase::TestDefaultLengthIsZero ( )
private

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

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

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestDivideLengthByLength()

void LengthTestCase::TestDivideLengthByLength ( )
private

Test arithmetic operations.

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

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestDivideLengthByLengthReturnsNaN()

void LengthTestCase::TestDivideLengthByLengthReturnsNaN ( )
private

Test arithmetic operations.

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

References AssertTrue().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestDivideLengthByScalar()

void LengthTestCase::TestDivideLengthByScalar ( )
private

Test arithmetic operations.

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

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestDivReturnsCorrectRemainder()

void LengthTestCase::TestDivReturnsCorrectRemainder ( )
private

Test Div function.

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

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestDivReturnsCorrectResult()

void LengthTestCase::TestDivReturnsCorrectResult ( )
private

Test Div function.

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

References ns3::Div(), and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestDivReturnsZeroRemainder()

void LengthTestCase::TestDivReturnsZeroRemainder ( )
private

Test Div function.

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

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestInputStreamOperator()

void LengthTestCase::TestInputStreamOperator ( )
private

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

Definition at line 903 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 749 of file length-test-suite.cc.

References AssertFalse(), and ns3::Length::IsEqual().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestIsEqualReturnsTrue()

void LengthTestCase::TestIsEqualReturnsTrue ( )
private

Test member comparison operators.

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

References AssertTrue(), and ns3::Length::IsEqual().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestIsEqualWithToleranceReturnsFalse()

void LengthTestCase::TestIsEqualWithToleranceReturnsFalse ( )
private

Test member comparison operators.

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

References AssertFalse(), and ns3::Length::IsEqual().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestIsEqualWithToleranceReturnsTrue()

void LengthTestCase::TestIsEqualWithToleranceReturnsTrue ( )
private

Test member comparison operators.

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

References AssertTrue(), and ns3::Length::IsEqual().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestIsGreaterReturnsFalse()

void LengthTestCase::TestIsGreaterReturnsFalse ( )
private

Test member comparison operators.

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

References AssertFalse().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestIsGreaterReturnsTrue()

void LengthTestCase::TestIsGreaterReturnsTrue ( )
private

Test member comparison operators.

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

References AssertTrue(), and ns3::Length::IsGreater().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestIsGreaterWithToleranceReturnsFalse()

void LengthTestCase::TestIsGreaterWithToleranceReturnsFalse ( )
private

Test member comparison operators.

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

References AssertFalse().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestIsLessReturnsFalse()

void LengthTestCase::TestIsLessReturnsFalse ( )
private

Test member comparison operators.

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

References AssertFalse(), and ns3::Length::IsLess().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestIsLessReturnsTrue()

void LengthTestCase::TestIsLessReturnsTrue ( )
private

Test member comparison operators.

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

References AssertTrue(), and ns3::Length::IsLess().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestIsLessWithToleranceReturnsFalse()

void LengthTestCase::TestIsLessWithToleranceReturnsFalse ( )
private

Test member comparison operators.

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

References AssertFalse(), and ns3::Length::IsLess().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestIsNotEqualReturnsFalse()

void LengthTestCase::TestIsNotEqualReturnsFalse ( )
private

Test member comparison operators.

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

References AssertFalse(), and ns3::Length::IsNotEqual().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestIsNotEqualReturnsTrue()

void LengthTestCase::TestIsNotEqualReturnsTrue ( )
private

Test member comparison operators.

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

References AssertTrue(), and ns3::Length::IsNotEqual().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestIsNotEqualWithToleranceReturnsFalse()

void LengthTestCase::TestIsNotEqualWithToleranceReturnsFalse ( )
private

Test member comparison operators.

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

References AssertFalse(), and ns3::Length::IsNotEqual().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestIsNotEqualWithToleranceReturnsTrue()

void LengthTestCase::TestIsNotEqualWithToleranceReturnsTrue ( )
private

Test member comparison operators.

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

References AssertTrue(), and ns3::Length::IsNotEqual().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller 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 394 of file length-test-suite.cc.

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller 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 407 of file length-test-suite.cc.

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller 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 920 of file length-test-suite.cc.

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

Referenced by TestSerializeLengthWithUnit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestModReturnsNonZero()

void LengthTestCase::TestModReturnsNonZero ( )
private

Test Mod function.

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

References ns3::Mod(), and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestModReturnsZero()

void LengthTestCase::TestModReturnsZero ( )
private

Test Mod function.

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

References ns3::Mod(), and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller 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 713 of file length-test-suite.cc.

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestMultiplyLengthByScalar()

void LengthTestCase::TestMultiplyLengthByScalar ( )
private

Test arithmetic operations.

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

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestMultiplyScalarByLength()

void LengthTestCase::TestMultiplyScalarByLength ( )
private

Test arithmetic operations.

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

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestOperatorEqualsReturnsFalse()

void LengthTestCase::TestOperatorEqualsReturnsFalse ( )
private

Test free function comparison operators.

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

References AssertFalse().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestOperatorEqualsReturnsTrue()

void LengthTestCase::TestOperatorEqualsReturnsTrue ( )
private

Test free function comparison operators.

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

References AssertTrue().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestOperatorGreaterOrEqualReturnsFalse()

void LengthTestCase::TestOperatorGreaterOrEqualReturnsFalse ( )
private

Test free function comparison operators.

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

References AssertFalse().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestOperatorGreaterOrEqualReturnsTrue()

void LengthTestCase::TestOperatorGreaterOrEqualReturnsTrue ( )
private

Test free function comparison operators.

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

References AssertTrue().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestOperatorGreaterThanReturnsFalse()

void LengthTestCase::TestOperatorGreaterThanReturnsFalse ( )
private

Test free function comparison operators.

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

References AssertFalse().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestOperatorGreaterThanReturnsTrue()

void LengthTestCase::TestOperatorGreaterThanReturnsTrue ( )
private

Test free function comparison operators.

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

References AssertTrue().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestOperatorLessOrEqualReturnsFalse()

void LengthTestCase::TestOperatorLessOrEqualReturnsFalse ( )
private

Test free function comparison operators.

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

References AssertFalse().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestOperatorLessOrEqualReturnsTrue()

void LengthTestCase::TestOperatorLessOrEqualReturnsTrue ( )
private

Test free function comparison operators.

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

References AssertTrue().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestOperatorLessThanReturnsFalse()

void LengthTestCase::TestOperatorLessThanReturnsFalse ( )
private

Test free function comparison operators.

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

References AssertFalse().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestOperatorLessThanReturnsTrue()

void LengthTestCase::TestOperatorLessThanReturnsTrue ( )
private

Test free function comparison operators.

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

References AssertTrue().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestOperatorNotEqualsReturnsFalse()

void LengthTestCase::TestOperatorNotEqualsReturnsFalse ( )
private

Test free function comparison operators.

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

References AssertFalse().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestOperatorNotEqualsReturnsTrue()

void LengthTestCase::TestOperatorNotEqualsReturnsTrue ( )
private

Test free function comparison operators.

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

References AssertTrue().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestOutputStreamOperator()

void LengthTestCase::TestOutputStreamOperator ( )
private

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

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

References NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ TestQuantityAssignment()

void LengthTestCase::TestQuantityAssignment ( )
private

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

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

References NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ TestSerializeLengthWithUnit()

void LengthTestCase::TestSerializeLengthWithUnit ( )
private

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

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

References TestLengthSerialization().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestSubtractingLengthAndQuantity()

void LengthTestCase::TestSubtractingLengthAndQuantity ( )
private

Test arithmetic operations.

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

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestSubtractingQuantityAndLength()

void LengthTestCase::TestSubtractingQuantityAndLength ( )
private

Test arithmetic operations.

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

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestSubtractingTwoLengths()

void LengthTestCase::TestSubtractingTwoLengths ( )
private

Test arithmetic operations.

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

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

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestTryParseReturnsFalse()

void LengthTestCase::TestTryParseReturnsFalse ( )
private

Test the TryParse function returns false on bad input.

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

References AssertFalse(), and ns3::Length::TryParse().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TestTryParseReturnsTrue()

void LengthTestCase::TestTryParseReturnsTrue ( )
private

Test the TryParse function returns true on success.

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

References AssertTrue(), NS_TEST_ASSERT_MSG_EQ_TOL, and ns3::Length::TryParse().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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