mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
[wpilib] Rename SysIdRoutineLog constants to all caps
This commit is contained in:
@@ -74,36 +74,36 @@ class SysIdRoutineTest {
|
||||
|
||||
var orderCheck = inOrder(m_mechanism);
|
||||
|
||||
orderCheck.verify(m_mechanism).recordState(SysIdRoutineLog.State.kQuasistaticForward);
|
||||
orderCheck.verify(m_mechanism).recordState(SysIdRoutineLog.State.QUASISTATIC_FORWARD);
|
||||
orderCheck.verify(m_mechanism).drive(any());
|
||||
orderCheck.verify(m_mechanism).log(any());
|
||||
orderCheck.verify(m_mechanism).recordState(SysIdRoutineLog.State.kNone);
|
||||
orderCheck.verify(m_mechanism).recordState(SysIdRoutineLog.State.NONE);
|
||||
orderCheck.verifyNoMoreInteractions();
|
||||
|
||||
clearInvocations(m_mechanism);
|
||||
orderCheck = inOrder(m_mechanism);
|
||||
runCommand(m_dynamicForward);
|
||||
|
||||
orderCheck.verify(m_mechanism).recordState(SysIdRoutineLog.State.kDynamicForward);
|
||||
orderCheck.verify(m_mechanism).recordState(SysIdRoutineLog.State.DYNAMIC_FORWARD);
|
||||
orderCheck.verify(m_mechanism).drive(any());
|
||||
orderCheck.verify(m_mechanism).log(any());
|
||||
orderCheck.verify(m_mechanism).recordState(SysIdRoutineLog.State.kNone);
|
||||
orderCheck.verify(m_mechanism).recordState(SysIdRoutineLog.State.NONE);
|
||||
orderCheck.verifyNoMoreInteractions();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testsDeclareCorrectState() {
|
||||
runCommand(m_quasistaticForward);
|
||||
verify(m_mechanism, atLeastOnce()).recordState(SysIdRoutineLog.State.kQuasistaticForward);
|
||||
verify(m_mechanism, atLeastOnce()).recordState(SysIdRoutineLog.State.QUASISTATIC_FORWARD);
|
||||
|
||||
runCommand(m_quasistaticReverse);
|
||||
verify(m_mechanism, atLeastOnce()).recordState(SysIdRoutineLog.State.kQuasistaticReverse);
|
||||
verify(m_mechanism, atLeastOnce()).recordState(SysIdRoutineLog.State.QUASISTATIC_REVERSE);
|
||||
|
||||
runCommand(m_dynamicForward);
|
||||
verify(m_mechanism, atLeastOnce()).recordState(SysIdRoutineLog.State.kDynamicForward);
|
||||
verify(m_mechanism, atLeastOnce()).recordState(SysIdRoutineLog.State.DYNAMIC_FORWARD);
|
||||
|
||||
runCommand(m_dynamicReverse);
|
||||
verify(m_mechanism, atLeastOnce()).recordState(SysIdRoutineLog.State.kDynamicReverse);
|
||||
verify(m_mechanism, atLeastOnce()).recordState(SysIdRoutineLog.State.DYNAMIC_REVERSE);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -38,19 +38,19 @@ class SysIdRoutineTest : public ::testing::Test {
|
||||
std::nullopt, std::nullopt, std::nullopt,
|
||||
[this](wpi::sysid::State state) {
|
||||
switch (state) {
|
||||
case wpi::sysid::State::kQuasistaticForward:
|
||||
case wpi::sysid::State::QUASISTATIC_FORWARD:
|
||||
currentStateList.emplace_back(StateTest::InRecordStateQf);
|
||||
break;
|
||||
case wpi::sysid::State::kQuasistaticReverse:
|
||||
case wpi::sysid::State::QUASISTATIC_REVERSE:
|
||||
currentStateList.emplace_back(StateTest::InRecordStateQr);
|
||||
break;
|
||||
case wpi::sysid::State::kDynamicForward:
|
||||
case wpi::sysid::State::DYNAMIC_FORWARD:
|
||||
currentStateList.emplace_back(StateTest::InRecordStateDf);
|
||||
break;
|
||||
case wpi::sysid::State::kDynamicReverse:
|
||||
case wpi::sysid::State::DYNAMIC_REVERSE:
|
||||
currentStateList.emplace_back(StateTest::InRecordStateDr);
|
||||
break;
|
||||
case wpi::sysid::State::kNone:
|
||||
case wpi::sysid::State::NONE:
|
||||
currentStateList.emplace_back(StateTest::DoneWithRecordState);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -75,9 +75,9 @@ def test_record_state_bookends_motor_logging(
|
||||
[
|
||||
call.drive(ANY),
|
||||
call.log(ANY),
|
||||
call.recordState(State.kQuasistaticForward),
|
||||
call.recordState(State.QUASISTATIC_FORWARD),
|
||||
call.drive(ANY),
|
||||
call.recordState(State.kNone),
|
||||
call.recordState(State.NONE),
|
||||
],
|
||||
any_order=False,
|
||||
)
|
||||
@@ -89,9 +89,9 @@ def test_record_state_bookends_motor_logging(
|
||||
[
|
||||
call.drive(ANY),
|
||||
call.log(ANY),
|
||||
call.recordState(State.kDynamicForward),
|
||||
call.recordState(State.DYNAMIC_FORWARD),
|
||||
call.drive(ANY),
|
||||
call.recordState(State.kNone),
|
||||
call.recordState(State.NONE),
|
||||
],
|
||||
any_order=False,
|
||||
)
|
||||
@@ -105,16 +105,16 @@ def test_tests_declare_correct_state(
|
||||
dynamic_reverse,
|
||||
):
|
||||
run_command(quasistatic_forward)
|
||||
mechanism.recordState.assert_any_call(State.kQuasistaticForward)
|
||||
mechanism.recordState.assert_any_call(State.QUASISTATIC_FORWARD)
|
||||
|
||||
run_command(quasistatic_reverse)
|
||||
mechanism.recordState.assert_any_call(State.kQuasistaticReverse)
|
||||
mechanism.recordState.assert_any_call(State.QUASISTATIC_REVERSE)
|
||||
|
||||
run_command(dynamic_forward)
|
||||
mechanism.recordState.assert_any_call(State.kDynamicForward)
|
||||
mechanism.recordState.assert_any_call(State.DYNAMIC_FORWARD)
|
||||
|
||||
run_command(dynamic_reverse)
|
||||
mechanism.recordState.assert_any_call(State.kDynamicReverse)
|
||||
mechanism.recordState.assert_any_call(State.DYNAMIC_REVERSE)
|
||||
|
||||
|
||||
def test_tests_output_correct_voltage(
|
||||
|
||||
Reference in New Issue
Block a user