Functions | Variables
brake_test_utils_test Namespace Reference

Functions

::testing::AssertionResult compareJointStateMessages (const JointStateConstPtr &msg1, const JointStateConstPtr &msg2)
 Checks for identical names and positions in joint state messages. More...
 
 TEST (BrakeTestUtilsTest, testExceptionDtor)
 Test increases function coverage by ensuring that all Dtor variants are called. More...
 
 TEST (BrakeTestUtilsTest, testCompareJointStatePositions)
 
 TEST (BrakeTestUtilsTest, testGetCurrentJointStates)
 
 TEST (BrakeTestUtilsTest, testDetectRobotMotion)
 

Variables

static const std::string JOINT_STATES_TOPIC_NAME { "/prbt/joint_states" }
 

Function Documentation

◆ compareJointStateMessages()

::testing::AssertionResult brake_test_utils_test::compareJointStateMessages ( const JointStateConstPtr &  msg1,
const JointStateConstPtr &  msg2 
)
static

Checks for identical names and positions in joint state messages.

Definition at line 47 of file unittest_brake_test_utils.cpp.

◆ TEST() [1/4]

brake_test_utils_test::TEST ( BrakeTestUtilsTest  ,
testExceptionDtor   
)

Test increases function coverage by ensuring that all Dtor variants are called.

Definition at line 75 of file unittest_brake_test_utils.cpp.

◆ TEST() [2/4]

brake_test_utils_test::TEST ( BrakeTestUtilsTest  ,
testCompareJointStatePositions   
)

Test the compareJointStatePositions utility function

Test Sequence:

  1. Compare two equal joint states
  2. Compare two joint states with a difference in all joints slightly below the tolerance
  3. Compare two joint_states with a difference in one joint slightly above the tolerance, repeat the test for all joints.

Expected Results:

  1. Returns true
  2. Returns true
  3. Always returns false

Definition at line 100 of file unittest_brake_test_utils.cpp.

◆ TEST() [3/4]

brake_test_utils_test::TEST ( BrakeTestUtilsTest  ,
testGetCurrentJointStates   
)

Test the getCurrentJointStates utility function

Test Sequence:

  1. Call getCurrentJointStates() without publishing to the joint_states topic
  2. Call getCurrentJointStates() and publish on the joint_states topic asynchronously

Expected Results:

  1. Exception is thrown
  2. Published message is obtained

Definition at line 152 of file unittest_brake_test_utils.cpp.

◆ TEST() [4/4]

brake_test_utils_test::TEST ( BrakeTestUtilsTest  ,
testDetectRobotMotion   
)

Test the detectRobotMotion utility function

Test Sequence:

  1. Publish fixed joint states and call detectRobotMotion()
  2. Publish changing joint states and call detectRobotMotion()

Expected Results:

  1. Returns false.
  2. Returns true.

Definition at line 194 of file unittest_brake_test_utils.cpp.

Variable Documentation

◆ JOINT_STATES_TOPIC_NAME

const std::string brake_test_utils_test::JOINT_STATES_TOPIC_NAME { "/prbt/joint_states" }
static

Definition at line 42 of file unittest_brake_test_utils.cpp.



prbt_hardware_support
Author(s):
autogenerated on Mon Feb 28 2022 23:14:34