Skip to content

Commit

Permalink
some updates to the unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JMoore5353 committed Nov 26, 2024
1 parent 9d85c98 commit be8a43a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions test/command_manager_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class CommandManagerTest : public ::testing::Test
for (int i = 0; i < 8; i++) { rc_values[i] = 1500; }
rc_values[2] = 1000;

// TODO: Fix this unit test. There is no passthrough mixer
rf.params_.set_param_int(PARAM_MIXER, Mixer::PASSTHROUGH);
rf.params_.set_param_float(PARAM_FAILSAFE_THROTTLE, 0.0);
max_roll = rf.params_.get_param_float(PARAM_RC_MAX_ROLL);
Expand Down
2 changes: 1 addition & 1 deletion test/parameters_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ TEST(Parameters, DefaultParameters)
EXPECT_PARAM_EQ_FLOAT(PARAM_RC_OVERRIDE_DEVIATION, 0.1f);
EXPECT_PARAM_EQ_INT(PARAM_RC_OVERRIDE_TAKE_MIN_THROTTLE, 1);
EXPECT_PARAM_EQ_INT(PARAM_RC_ATTITUDE_MODE, 1);
EXPECT_PARAM_EQ_INT(PARAM_MIXER, Mixer::INVALID_MIXER);
EXPECT_PARAM_EQ_INT(PARAM_PRIMARY_MIXER, Mixer::INVALID_MIXER);
EXPECT_PARAM_EQ_INT(PARAM_FIXED_WING, 0);
EXPECT_PARAM_EQ_INT(PARAM_AILERON_REVERSE, 0);
EXPECT_PARAM_EQ_INT(PARAM_ELEVATOR_REVERSE, 0);
Expand Down
4 changes: 2 additions & 2 deletions test/state_machine_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class StateMachineTest : public ::testing::Test
rf.init();
rf.state_manager_.clear_error(
rf.state_manager_.state().error_codes); // Clear All Errors to Start
rf.params_.set_param_int(PARAM_MIXER, 10);
rf.params_.set_param_int(PARAM_PRIMARY_MIXER, 10);
rf.params_.set_param_int(PARAM_CALIBRATE_GYRO_ON_ARM, false); // default to turning this off
rf.params_.set_param_float(PARAM_FAILSAFE_THROTTLE, 0.0f);

Expand Down Expand Up @@ -515,4 +515,4 @@ TEST_F(StateMachineTest, ArmAfterCorrectFailsafe)
EXPECT_EQ(rf.state_manager_.state().armed, true);
EXPECT_EQ(rf.state_manager_.state().error_codes, 0);
EXPECT_EQ(rf.state_manager_.state().error, false);
}
}

0 comments on commit be8a43a

Please sign in to comment.