Classes | Functions | Variables
prbt_hardware_support_tests Namespace Reference

Classes

class  Stop1ExecutorForTests
 
class  Stop1ExecutorTest
 

Functions

 TEST_F (Stop1ExecutorTest, testDestructor)
 Test increases function coverage by ensuring that all Dtor variants are called. More...
 
 TEST_F (Stop1ExecutorTest, testEnable)
 
 TEST_F (Stop1ExecutorTest, testEnableStopEnable)
 
 TEST_F (Stop1ExecutorTest, testSpamEnablePlusStop)
 Test spaming enable plus subsequent stop. More...
 
 TEST_F (Stop1ExecutorTest, testSpamRunPermittedActivePlusEnable)
 Test spamming RUN_PERMITTED=false plus subsequent enable. More...
 
 TEST_F (Stop1ExecutorTest, testSkippingHoldPlusEnable)
 
 TEST_F (Stop1ExecutorTest, testEnableDuringHoldService)
 
 TEST_F (Stop1ExecutorTest, testEnableDuringHaltService)
 
 TEST_F (Stop1ExecutorTest, testEnableDisableDuringHaltService)
 
 TEST_F (Stop1ExecutorTest, testRecoverFailPlusRetry)
 
 TEST_F (Stop1ExecutorTest, testUnholdFail)
 
 TEST_F (Stop1ExecutorTest, testHoldFail)
 
 TEST_F (Stop1ExecutorTest, testHoldImmediatelyAfterUnhold)
 Test hold immediately when run_permitted changes to false during unhold. More...
 
 TEST_F (Stop1ExecutorTest, testExitInStateEnabling)
 Test stopping the state machine in state Enabling. More...
 
 TEST_F (Stop1ExecutorTest, testExitInStateStopping)
 Test stopping the state machine in state Stopping. More...
 
 TEST_F (Stop1ExecutorTest, testExitInStateStopRequestedDuringEnable)
 Test stopping the state machine in state StopRequestedDuringEnable. More...
 
 TEST_F (Stop1ExecutorTest, testExitInStateEnableRequestDuringStop)
 Test stopping the state machine in state EnableRequestDuringStop. More...
 

Variables

const std::string HALT_SRV_CALLED_EVENT { "halt_srv_called" }
 
const std::string HOLD_SRV_CALLED_EVENT { "hold_srv_called" }
 
const std::string RECOVER_SRV_CALLED_EVENT { "recover_srv_called" }
 
const std::string UNHOLD_SRV_CALLED_EVENT { "unhold_srv_called" }
 

Function Documentation

◆ TEST_F() [1/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testDestructor   
)

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

Definition at line 105 of file unittest_stop1_executor.cpp.

◆ TEST_F() [2/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testEnable   
)
  • Tests that driver is recovered and controller no longer holded in case of RUN_PERMITTED switch: false->true. (Spec)

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true)), let recover and unhold services return success

Expected Results:

  1. Recover and unhold services are called successively

Definition at line 133 of file unittest_stop1_executor.cpp.

◆ TEST_F() [3/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testEnableStopEnable   
)
  • Test enabling stopping and enabling again. (Spec)
  • Test enabling stopping and enabling again. (Spec)

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true)), let recover and unhold services return success
  2. Call updateRunPermitted(false)), let hold and halt services return success
  3. Call updateRunPermitted(true)) repeatedly, let recover and unhold service return success

Expected Results:

  1. Recover and unhold services are called successively
  2. Hold and halt services are called successively
  3. Recover and unhold services are called successively

Definition at line 169 of file unittest_stop1_executor.cpp.

◆ TEST_F() [4/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testSpamEnablePlusStop   
)

Test spaming enable plus subsequent stop.

  • Test spaming enable plus subsequent stop. (Spec)
  • Test spaming enable plus subsequent stop. (Spec)

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true)) repeatedly, let recover and unhold services return success
  2. Call updateRunPermitted(true) once more (this is certainly after unhold and needed for full coverage)
  3. Call updateRunPermitted(false)), let hold and halt services return success

Expected Results:

  1. Recover and unhold services are called successively
  2. -
  3. Hold and halt services are called successively

Definition at line 245 of file unittest_stop1_executor.cpp.

◆ TEST_F() [5/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testSpamRunPermittedActivePlusEnable   
)

Test spamming RUN_PERMITTED=false plus subsequent enable.

  • Test spamming RUN_PERMITTED=false plus subsequent enable. (Spec)
  • Test spamming RUN_PERMITTED=false plus subsequent enable. (Spec)

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true)), let recover and unhold services return success
  2. Call updateRunPermitted(false)) repeatedly, let hold and halt services return success
  3. Call updateRunPermitted(true)) repeatedly, let recover and unhold services return success

Expected Results:

  1. Recover and unhold services are called successively
  2. Hold and halt services are called successively
  3. Recover and unhold services are called successively

Definition at line 315 of file unittest_stop1_executor.cpp.

◆ TEST_F() [6/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testSkippingHoldPlusEnable   
)
  • Test skipping hold when run_permitted changes to false during recover. (Spec)
  • Test skipping hold when run_permitted changes to false during recover. (Spec)
  • Test skipping hold when run_permitted changes to false during recover. (Spec)

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true)), call updateRunPermitted(false)) during recover service call and return success, let halt service return success
  2. Call updateRunPermitted(true)), let recover and unhold services return success

Expected Results:

  1. Recover and halt services are called successively
  2. Recover and unhold services are called successively

Definition at line 401 of file unittest_stop1_executor.cpp.

◆ TEST_F() [7/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testEnableDuringHoldService   
)
  • Test sending run_permitted change to true while hold call is still pending. (Spec)
  • Test sending run_permitted change to true while hold call is still pending. (Spec)

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true), let recover and unhold service return success.
  2. Call updateRunPermitted(false) and updateRunPermitted(true) during hold service call, let hold, halt, recover and unhold service return success.

Expected Results:

  1. Recover and unhold services are called successively.
  2. Hold, halt, recover and unhold services are called successively.

Definition at line 474 of file unittest_stop1_executor.cpp.

◆ TEST_F() [8/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testEnableDuringHaltService   
)
  • Test sending run_permitted change to true while halt call is still pending. (Spec)
  • Test sending run_permitted change to true while halt call is still pending. (Spec)

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true)), call updateRunPermitted(false)) during recover service call and return success. Before returning success on halt service call updateRunPermitted(true)

Expected Results:

  1. Recover and halt services are called successively. Afterwards recover and unhold are called.

Definition at line 531 of file unittest_stop1_executor.cpp.

◆ TEST_F() [9/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testEnableDisableDuringHaltService   
)
  • Test sending run_permitted change to true and back to false while halt call is still pending. (Spec)
  • Test sending run_permitted change to true and back to false while halt call is still pending. (Spec)

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true)). Call updateRunPermitted(false)) during recover service call and return success. (This is not essential for the test) Before returning success on halt service call updateRunPermitted(true) and update(false).

Expected Results:

  1. Recover and halt services are called successively. Afterwards recover and unhold are called once.

Definition at line 596 of file unittest_stop1_executor.cpp.

◆ TEST_F() [10/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testRecoverFailPlusRetry   
)
  • Test enabling with failing recover service and retry (stop plus enable). (Spec)
  • Test enabling with failing recover service and retry (stop plus enable). (Spec)
  • Test enabling with failing recover service and retry (stop plus enable). (Spec)

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true)), let recover service fail repeatedly, let unhold service return success
  2. Call updateRunPermitted(false)), let hold and halt service return success
  3. Call updateRunPermitted(true)) repeatedly, recover and unhold service return success

Expected Results:

  1. Recover service is called at least once
  2. Halt service is called
  1. Recover and unhold services are called successively

Definition at line 655 of file unittest_stop1_executor.cpp.

◆ TEST_F() [11/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testUnholdFail   
)
  • Test if a stop is possible after unhold failed. (Spec)

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true)), let recover service return success and unhold service fail repeatedly
  2. Call updateRunPermitted(false)), let hold and halt services return success

Expected Results:

  1. Recover and unhold services are called successively, the latter one at least once
  2. Hold and halt services are called successively.

Definition at line 728 of file unittest_stop1_executor.cpp.

◆ TEST_F() [12/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testHoldFail   
)
  • Test if stop is continued properly despite failing hold service. (Spec)

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true)), let recover and unhold services return success
  2. Call updateRunPermitted(false)), let hold service fail, let is_executing service return "not executing", let halt service fail (for full coverage)

Expected Results:

  1. Recover and unhold services are called successively
  2. Hold, is_executing and halt services are called successively

Definition at line 779 of file unittest_stop1_executor.cpp.

◆ TEST_F() [13/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testHoldImmediatelyAfterUnhold   
)

Test hold immediately when run_permitted changes to false during unhold.

Note
This test exists mainly for full function coverage.

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true)), call updateRunPermitted(false)) during unhold service call and return success, let hold and halt services return success

Expected Results:

  1. Recover, unhold, hold and halt services are called successively

Definition at line 829 of file unittest_stop1_executor.cpp.

◆ TEST_F() [14/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testExitInStateEnabling   
)

Test stopping the state machine in state Enabling.

Note
This test exists mainly for full function coverage.

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true), call stopStateMachine() during recover service call and return success, let unhold service return success

Expected Results:

  1. Recover service is called

Definition at line 872 of file unittest_stop1_executor.cpp.

◆ TEST_F() [15/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testExitInStateStopping   
)

Test stopping the state machine in state Stopping.

Note
This test exists mainly for full function coverage.

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true), let recover and unhold services return success.
  2. Call updateRunPermitted(false) and call stopStateMachine() during hold service call, let hold and halt services return success.

Expected Results:

  1. Recover and unhold services are called
  2. Hold service is called

Definition at line 912 of file unittest_stop1_executor.cpp.

◆ TEST_F() [16/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testExitInStateStopRequestedDuringEnable   
)

Test stopping the state machine in state StopRequestedDuringEnable.

Note
This test exists mainly for full function coverage.

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true)), call updateRunPermitted(false)) and stopStateMachine() during recover service call, let recover and halt services return success.

Expected Results:

  1. Recover is called.

Definition at line 967 of file unittest_stop1_executor.cpp.

◆ TEST_F() [17/17]

prbt_hardware_support_tests::TEST_F ( Stop1ExecutorTest  ,
testExitInStateEnableRequestDuringStop   
)

Test stopping the state machine in state EnableRequestDuringStop.

Note
This test exists mainly for full function coverage.

Test Sequence:

  1. Run the run_permitted adapter and call updateRunPermitted(true), let recover and unhold services return success
  2. Call updateRunPermitted(false), call updateRunPermitted(true) and stopStateMachine() during hold service call and return success, let halt, recover and unhold services also return success

Expected Results:

  1. Recover and unhold services are called successively
  2. Hold service is called

Definition at line 1012 of file unittest_stop1_executor.cpp.

Variable Documentation

◆ HALT_SRV_CALLED_EVENT

const std::string prbt_hardware_support_tests::HALT_SRV_CALLED_EVENT { "halt_srv_called" }

Definition at line 61 of file unittest_stop1_executor.cpp.

◆ HOLD_SRV_CALLED_EVENT

const std::string prbt_hardware_support_tests::HOLD_SRV_CALLED_EVENT { "hold_srv_called" }

Definition at line 60 of file unittest_stop1_executor.cpp.

◆ RECOVER_SRV_CALLED_EVENT

const std::string prbt_hardware_support_tests::RECOVER_SRV_CALLED_EVENT { "recover_srv_called" }

Definition at line 58 of file unittest_stop1_executor.cpp.

◆ UNHOLD_SRV_CALLED_EVENT

const std::string prbt_hardware_support_tests::UNHOLD_SRV_CALLED_EVENT { "unhold_srv_called" }

Definition at line 59 of file unittest_stop1_executor.cpp.



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