Skip to content

Commit

Permalink
Changed IsActive to IsEngaged
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg68 committed Oct 9, 2024
1 parent a8f87bf commit aa84c77
Showing 1 changed file with 40 additions and 39 deletions.
79 changes: 40 additions & 39 deletions src/tests/testing/model/GOTestDrawStop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,48 +24,48 @@ void GOTestDrawStop::TestFunctions::run() {
sw23.AddControllingDrawstop(&sw2, 1, "sw3");
sw23.AddControllingDrawstop(&sw3, 2, "sw3");

GOAssert(!sw12.IsActive(), "false AND false");
GOAssert(!sw13.IsActive(), "false OR false");
GOAssert(!sw23.IsActive(), "false XOR false");
GOAssert(!sw12.IsEngaged(), "false AND false");
GOAssert(!sw13.IsEngaged(), "false OR false");
GOAssert(!sw23.IsEngaged(), "false XOR false");

sw1.SetButtonState(true);
GOAssert(!sw12.IsActive(), "true AND false");
GOAssert(sw13.IsActive(), "true OR false");
GOAssert(!sw23.IsActive(), "false XOR false");
GOAssert(!sw12.IsEngaged(), "true AND false");
GOAssert(sw13.IsEngaged(), "true OR false");
GOAssert(!sw23.IsEngaged(), "false XOR false");

sw1.SetButtonState(false);
sw2.SetButtonState(true);
GOAssert(!sw12.IsActive(), "false AND true");
GOAssert(!sw13.IsActive(), "false OR false");
GOAssert(sw23.IsActive(), "true XOR false");
GOAssert(!sw12.IsEngaged(), "false AND true");
GOAssert(!sw13.IsEngaged(), "false OR false");
GOAssert(sw23.IsEngaged(), "true XOR false");

sw1.SetButtonState(true);
GOAssert(sw12.IsActive(), "true AND true");
GOAssert(sw13.IsActive(), "true OR false");
GOAssert(sw23.IsActive(), "true XOR false");
GOAssert(sw12.IsEngaged(), "true AND true");
GOAssert(sw13.IsEngaged(), "true OR false");
GOAssert(sw23.IsEngaged(), "true XOR false");

sw1.SetButtonState(false);
sw2.SetButtonState(false);
sw3.SetButtonState(true);
GOAssert(!sw12.IsActive(), "false AND false");
GOAssert(sw13.IsActive(), "false OR true");
GOAssert(sw23.IsActive(), "false XOR true");
GOAssert(!sw12.IsEngaged(), "false AND false");
GOAssert(sw13.IsEngaged(), "false OR true");
GOAssert(sw23.IsEngaged(), "false XOR true");

sw1.SetButtonState(true);
GOAssert(!sw12.IsActive(), "true AND false");
GOAssert(sw13.IsActive(), "true OR true");
GOAssert(sw23.IsActive(), "false XOR true");
GOAssert(!sw12.IsEngaged(), "true AND false");
GOAssert(sw13.IsEngaged(), "true OR true");
GOAssert(sw23.IsEngaged(), "false XOR true");

sw1.SetButtonState(false);
sw2.SetButtonState(true);
GOAssert(!sw12.IsActive(), "false AND true");
GOAssert(sw13.IsActive(), "false OR true");
GOAssert(!sw23.IsActive(), "true XOR true");
GOAssert(!sw12.IsEngaged(), "false AND true");
GOAssert(sw13.IsEngaged(), "false OR true");
GOAssert(!sw23.IsEngaged(), "true XOR true");

sw1.SetButtonState(true);
GOAssert(sw12.IsActive(), "true AND true");
GOAssert(sw13.IsActive(), "true OR true");
GOAssert(!sw23.IsActive(), "true XOR true");
GOAssert(sw12.IsEngaged(), "true AND true");
GOAssert(sw13.IsEngaged(), "true OR true");
GOAssert(!sw23.IsEngaged(), "true XOR true");

sw23.ClearControllingDrawstops();
sw13.ClearControllingDrawstops();
Expand All @@ -81,49 +81,50 @@ static wxString WX_CRESCENDO_A = wxT("crescendo-a");
void GOTestDrawStop::TestInternalState::run() {
GOSwitch sw(*controller);

GOAssert(!sw.IsActive(), "After init");
GOAssert(!sw.IsEngaged(), "After init");

sw.SetButtonState(true);
GOAssert(sw.IsActive(), "After engaging");
GOAssert(sw.IsEngaged(), "After engaging");

sw.SetButtonState(false);
GOAssert(!sw.IsActive(), "After disengaging");
GOAssert(!sw.IsEngaged(), "After disengaging");

sw.SetCombinationState(true, WX_EMPTY);
GOAssert(sw.IsActive(), "After engaging from a combination");
GOAssert(sw.IsEngaged(), "After engaging from a combination");

sw.SetCombinationState(false, WX_EMPTY);
GOAssert(!sw.IsActive(), "After disengaging from a combination");
GOAssert(!sw.IsEngaged(), "After disengaging from a combination");

sw.SetCombinationState(true, WX_CRESCENDO_A);
GOAssert(sw.IsActive(), "After engaging from a crescendo");
GOAssert(sw.IsEngaged(), "After engaging from a crescendo");

sw.SetCombinationState(false, WX_CRESCENDO_A);
GOAssert(!sw.IsActive(), "After disengaging from a crescendo");
GOAssert(!sw.IsEngaged(), "After disengaging from a crescendo");

sw.SetButtonState(true);
GOAssert(sw.IsActive(), "After engaging");
GOAssert(sw.IsEngaged(), "After engaging");

sw.SetCombinationState(false, WX_EMPTY);
GOAssert(!sw.IsActive(), "After engaging and disengaging from a combination");
GOAssert(
!sw.IsEngaged(), "After engaging and disengaging from a combination");

sw.SetCombinationState(true, WX_CRESCENDO_A);
GOAssert(sw.IsActive(), "After engaging from a crescendo");
GOAssert(sw.IsEngaged(), "After engaging from a crescendo");

sw.SetButtonState(true);
GOAssert(sw.IsActive(), "After engaging manually and from a crescendo");
GOAssert(sw.IsEngaged(), "After engaging manually and from a crescendo");

sw.SetCombinationState(false, WX_CRESCENDO_A);
GOAssert(
sw.IsActive(), "After disengaging from a crescendo but engaded manually");
sw.IsEngaged(), "After disengaging from a crescendo but engaded manually");

sw.SetCombinationState(true, WX_CRESCENDO_A);
GOAssert(sw.IsActive(), "After engaging manually and from a crescendo");
GOAssert(sw.IsEngaged(), "After engaging manually and from a crescendo");

sw.SetButtonState(false);
GOAssert(
sw.IsActive(), "After engaging from a crescendo but disengaded manually");
sw.IsEngaged(), "After engaging from a crescendo but disengaded manually");

sw.SetCombinationState(false, WX_CRESCENDO_A);
GOAssert(!sw.IsActive(), "After disengaging from a crescendo and manually");
GOAssert(!sw.IsEngaged(), "After disengaging from a crescendo and manually");
}

0 comments on commit aa84c77

Please sign in to comment.