public static void TC_CrashDetectionWhileEngineOff() { // Initialize signals Report.TestStep("Initialize all signals..."); LockingTestLibrary.ResetLockingTestSignals(); // Set lock state to locked Report.TestStep("Set initial lock state to locked..."); LockRequest.Value = LockRequest.Request_lock; EngineRunning.Value = 0; Velocity.Value = 0; Execution.Wait(LockRequestWaitTime.GetValue()); // Simulate crash Report.TestStep("Simulate crash..."); CrashDetected.Value = 1; Execution.Wait(CrashDetectionWaitingTime.GetValue()); // Check lock state is locked Report.TestStep("Check expected lock state to be locked."); if (LockState.Value != LockState.Locked) { Report.TestStepFail("Lock state is 'unlocked'. Expected lock state is 'locked'."); } else { Report.TestStepPass("Lock state is 'locked' as expected."); } // Reset signals Report.TestStep("Rest all signals..."); LockingTestLibrary.ResetLockingTestSignals(); }
public static void TC_LockByIncreasingVelocity() { // Initialize the system Report.TestStep("Initialize the system..."); LockingTestLibrary.ResetLockingTestSignals(); // Ensure initial state unlocked Report.TestStep("Ensure initial state 'unlocked'..."); LockRequest.Value = LockRequest.Request_unlock; Execution.Wait(500); // Start engine Report.TestStep("Start engine..."); EngineRunning.Value = 1; // Do tests for locking by velocity Report.TestStep("Accelerate to velocity lower than the lock-velocity"); CaplTestFunctions.Utilities.AccelerateDecelerateToTargetSpeed(20); Execution.Wait(500); Report.TestStep("Check no automatic lock with velocity lower than the lock-velocity"); if (LockState.Value != LockState.Unlocked) { Report.TestStepFail("Lock state is 'locked'. Expected lock state is 'unlocked'."); } else { Report.TestStepPass("Lock state is 'unlocked' as expected."); } Report.TestStep("Accelerate to velocity higher than the lock-velocity"); CaplTestFunctions.Utilities.AccelerateDecelerateToTargetSpeed(60); Execution.Wait(500); Report.TestStep("Check automatic lock with velocity higher than the lock-velocity"); if (LockState.Value != LockState.Locked) { Report.TestStepFail("Lock state is 'unlocked'. Expected lock state is 'locked'."); } else { Report.TestStepPass("Lock state is 'locked' as expected."); } Report.TestStep("Decelerate until stopped"); CaplTestFunctions.Utilities.AccelerateDecelerateToTargetSpeed(0); // Reset all signals Report.TestStep("Reset all signals..."); LockingTestLibrary.ResetLockingTestSignals(); }
public static void TC_UnlockStatically() { // Intialize the system Report.TestStep("Initialize the system..."); LockingTestLibrary.ResetLockingTestSignals(); // Check unlock function when engine is not running Report.TestStep("Check lock function when engine is off..."); EngineRunning.Value = 0; LockRequest.Value = LockRequest.Request_unlock; Execution.Wait(SysPars.LockingTests.LockRequestWaitTime.GetValue()); if (LockState.Value != LockState.Unlocked) { Report.TestStepFail("Lock state is 'locked'. Expected lock state is 'unlocked'."); } else { Report.TestStepPass("Lock state is 'unlocked' as expected."); } // Check unlock function when engine is running Report.TestStep("Check lock function when engine is off..."); EngineRunning.Value = 1; LockRequest.Value = LockRequest.Request_unlock; Execution.Wait(SysPars.LockingTests.LockRequestWaitTime.GetValue()); if (LockState.Value != LockState.Unlocked) { Report.TestStepFail("Lock state is 'locked'. Expected lock state is 'unlocked'."); } else { Report.TestStepPass("Lock state is 'unlocked' as expected."); } // Reset the system LockingTestLibrary.ResetLockingTestSignals(); }
public static void TC_ApplyCrashWithDifferentVelocities(int engineRunning, int velocity) { // Initialize the system Report.TestStep("Initialize the system..."); LockingTestLibrary.ResetLockingTestSignals(); EngineRunning.Value = engineRunning; Report.TestStep("Set initial state 'locked'."); LockRequest.Value = LockRequest.Request_lock; Execution.Wait(500); Report.TestStep("Set velocity to execute test with..."); Velocity.Value = velocity; Execution.Wait(500); // Simulate crash Report.TestStep("Simulate crash..."); CrashDetected.Value = 1; Execution.Wait(CrashDetectionWaitingTime.GetValue()); // Check lock state is unlocked Report.TestStep("Check expected lock state to be unlocked."); if (LockState.Value != LockState.Unlocked) { Report.TestStepFail("Lock state is 'locked'. Expected lock state is 'unlocked'."); } else { Report.TestStepPass("Lock state is 'unlocked' as expected."); } // Reset signals Report.TestStep("Rest all signals..."); LockingTestLibrary.ResetLockingTestSignals(); }
public static void TC_OpenAndComfortClose() { // Initialize the system Report.TestStep("Initialize the system..."); LockingTestLibrary.ResetLockingTestSignals(); // Open the window Report.TestStep("Open the window..."); KeyDown.Value = 1; Execution.Wait(5000); // Release key Report.TestStep("Release key..."); KeyDown.Value = 0; Execution.Wait(100); // Try the comfort close and check if the window is really closing Report.TestStep("Try the comfort close and check if the window is really closing..."); LockRequest.Value = LockRequest.Comfort_lock; Execution.Wait(4000); if (WindowMotion.Value != WindowMotion.currently_closing) { string txt; if (WindowMotion.Value == WindowMotion.currently_opening) { txt = "Window motion is 'currently_opening'. Expected window motion is 'currently_closing'."; } else { txt = "Window motion is 'not_moving'. Expected window motion is 'currently_closing'."; } Report.TestStepFail(txt); } else { Report.TestStepPass("Window motion is 'currently_closing' as expected."); } // Check if the window stops moving when the car is opened again Report.TestStep("Check if the window stops moving when the car is opened again..."); LockRequest.Value = LockRequest.Request_unlock; Execution.Wait(100); if (WindowMotion.Value != WindowMotion.not_moving) { string txt; if (WindowMotion.Value == WindowMotion.currently_opening) { txt = "Window motion is 'currently_opening'. Expected window motion is 'not_moving'."; } else { txt = "Window motion is 'currently_closing'. Expected window motion is 'not_moving'."; } Report.TestStepFail(txt); } else { Report.TestStepPass("Window motion is 'not_moving' as expected."); } // Reset all signals Report.TestStep("Reset all signals..."); WindowMotion.Value = WindowMotion.not_moving; WindowPosition.Value = 0; LockingTestLibrary.ResetLockingTestSignals(); }