mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 06:23:33 +08:00
clang-tidy modernize-redundant-void-arg
This commit is contained in:
@@ -793,7 +793,7 @@ calibrate_return calibrate_from_orientation(orb_advert_t *mavlink_log_pub,
|
||||
return result;
|
||||
}
|
||||
|
||||
int calibrate_cancel_subscribe(void)
|
||||
int calibrate_cancel_subscribe()
|
||||
{
|
||||
return orb_subscribe(ORB_ID(vehicle_command));
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
StateMachineHelperTest();
|
||||
virtual ~StateMachineHelperTest();
|
||||
|
||||
virtual bool run_tests(void);
|
||||
virtual bool run_tests();
|
||||
|
||||
private:
|
||||
bool armingStateTransitionTest();
|
||||
@@ -63,7 +63,7 @@ StateMachineHelperTest::StateMachineHelperTest() {
|
||||
StateMachineHelperTest::~StateMachineHelperTest() {
|
||||
}
|
||||
|
||||
bool StateMachineHelperTest::armingStateTransitionTest(void)
|
||||
bool StateMachineHelperTest::armingStateTransitionTest()
|
||||
{
|
||||
// These are the critical values from vehicle_status_s and actuator_armed_s which must be primed
|
||||
// to simulate machine state prior to testing an arming state transition. This structure is also
|
||||
@@ -311,7 +311,7 @@ bool StateMachineHelperTest::armingStateTransitionTest(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool StateMachineHelperTest::mainStateTransitionTest(void)
|
||||
bool StateMachineHelperTest::mainStateTransitionTest()
|
||||
{
|
||||
// This structure represent a single test case for testing Main State transitions.
|
||||
typedef struct {
|
||||
@@ -475,7 +475,7 @@ bool StateMachineHelperTest::mainStateTransitionTest(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool StateMachineHelperTest::isSafeTest(void)
|
||||
bool StateMachineHelperTest::isSafeTest()
|
||||
{
|
||||
struct vehicle_status_s current_state = {};
|
||||
struct safety_s safety = {};
|
||||
@@ -514,7 +514,7 @@ bool StateMachineHelperTest::isSafeTest(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool StateMachineHelperTest::run_tests(void)
|
||||
bool StateMachineHelperTest::run_tests()
|
||||
{
|
||||
ut_run_test(armingStateTransitionTest);
|
||||
ut_run_test(mainStateTransitionTest);
|
||||
|
||||
@@ -64,19 +64,19 @@ MavlinkFTP::~MavlinkFTP()
|
||||
}
|
||||
|
||||
const char *
|
||||
MavlinkFTP::get_name(void) const
|
||||
MavlinkFTP::get_name() const
|
||||
{
|
||||
return "MAVLINK_FTP";
|
||||
}
|
||||
|
||||
uint16_t
|
||||
MavlinkFTP::get_id(void)
|
||||
MavlinkFTP::get_id()
|
||||
{
|
||||
return MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL;
|
||||
}
|
||||
|
||||
unsigned
|
||||
MavlinkFTP::get_size(void)
|
||||
MavlinkFTP::get_size()
|
||||
{
|
||||
if (_session_info.stream_download) {
|
||||
return MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES;
|
||||
@@ -102,7 +102,7 @@ MavlinkFTP::set_unittest_worker(ReceiveMessageFunc_t rcvMsgFunc, void *worker_da
|
||||
#endif
|
||||
|
||||
uint8_t
|
||||
MavlinkFTP::_getServerSystemId(void)
|
||||
MavlinkFTP::_getServerSystemId()
|
||||
{
|
||||
#ifdef MAVLINK_FTP_UNIT_TEST
|
||||
// We use fake ids when unit testing
|
||||
@@ -114,7 +114,7 @@ MavlinkFTP::_getServerSystemId(void)
|
||||
}
|
||||
|
||||
uint8_t
|
||||
MavlinkFTP::_getServerComponentId(void)
|
||||
MavlinkFTP::_getServerComponentId()
|
||||
{
|
||||
#ifdef MAVLINK_FTP_UNIT_TEST
|
||||
// We use fake ids when unit testing
|
||||
@@ -126,7 +126,7 @@ MavlinkFTP::_getServerComponentId(void)
|
||||
}
|
||||
|
||||
uint8_t
|
||||
MavlinkFTP::_getServerChannel(void)
|
||||
MavlinkFTP::_getServerChannel()
|
||||
{
|
||||
#ifdef MAVLINK_FTP_UNIT_TEST
|
||||
// We use fake ids when unit testing
|
||||
|
||||
@@ -119,21 +119,21 @@ MavlinkLogHandler::handle_message(const mavlink_message_t *msg)
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
const char *
|
||||
MavlinkLogHandler::get_name(void) const
|
||||
MavlinkLogHandler::get_name() const
|
||||
{
|
||||
return "MAVLINK_LOG_HANDLER";
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
uint16_t
|
||||
MavlinkLogHandler::get_id(void)
|
||||
MavlinkLogHandler::get_id()
|
||||
{
|
||||
return MAVLINK_MSG_ID_LOG_ENTRY;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
unsigned
|
||||
MavlinkLogHandler::get_size(void)
|
||||
MavlinkLogHandler::get_size()
|
||||
{
|
||||
//-- Sending Log Entries
|
||||
if (_pLogHandlerHelper && _pLogHandlerHelper->current_status == LogListHelper::LOG_HANDLER_LISTING) {
|
||||
|
||||
@@ -170,7 +170,7 @@ mavlink_message_t *mavlink_get_channel_buffer(uint8_t channel)
|
||||
}
|
||||
}
|
||||
|
||||
static void usage(void);
|
||||
static void usage();
|
||||
|
||||
bool Mavlink::_boot_complete = false;
|
||||
bool Mavlink::_config_link_on = false;
|
||||
@@ -553,7 +553,7 @@ Mavlink::get_channel()
|
||||
return _channel;
|
||||
}
|
||||
|
||||
void Mavlink::mavlink_update_system(void)
|
||||
void Mavlink::mavlink_update_system()
|
||||
{
|
||||
if (!_param_initialized) {
|
||||
_param_system_id = param_find("MAV_SYS_ID");
|
||||
|
||||
@@ -1154,7 +1154,7 @@ MavlinkMissionManager::format_mavlink_mission_item(const struct mission_item_s *
|
||||
}
|
||||
|
||||
|
||||
void MavlinkMissionManager::check_active_mission(void)
|
||||
void MavlinkMissionManager::check_active_mission()
|
||||
{
|
||||
if (!(_my_dataman_id == _dataman_id)) {
|
||||
if (_verbose) { warnx("WPM: New mission detected (possibly over different Mavlink instance) Updating"); }
|
||||
|
||||
@@ -71,7 +71,7 @@ MavlinkFtpTest::~MavlinkFtpTest()
|
||||
}
|
||||
|
||||
/// @brief Called before every test to initialize the FTP Server.
|
||||
void MavlinkFtpTest::_init(void)
|
||||
void MavlinkFtpTest::_init()
|
||||
{
|
||||
_expected_seq_number = 0;
|
||||
_ftp_server = new MavlinkFTP(nullptr);
|
||||
@@ -81,7 +81,7 @@ void MavlinkFtpTest::_init(void)
|
||||
}
|
||||
|
||||
/// @brief Called after every test to take down the FTP Server.
|
||||
void MavlinkFtpTest::_cleanup(void)
|
||||
void MavlinkFtpTest::_cleanup()
|
||||
{
|
||||
delete _ftp_server;
|
||||
|
||||
@@ -89,7 +89,7 @@ void MavlinkFtpTest::_cleanup(void)
|
||||
}
|
||||
|
||||
/// @brief Tests for correct behavior of an Ack response.
|
||||
bool MavlinkFtpTest::_ack_test(void)
|
||||
bool MavlinkFtpTest::_ack_test()
|
||||
{
|
||||
MavlinkFTP::PayloadHeader payload;
|
||||
const MavlinkFTP::PayloadHeader *reply;
|
||||
@@ -112,7 +112,7 @@ bool MavlinkFtpTest::_ack_test(void)
|
||||
}
|
||||
|
||||
/// @brief Tests for correct response to an invalid opcpde.
|
||||
bool MavlinkFtpTest::_bad_opcode_test(void)
|
||||
bool MavlinkFtpTest::_bad_opcode_test()
|
||||
{
|
||||
MavlinkFTP::PayloadHeader payload;
|
||||
const MavlinkFTP::PayloadHeader *reply;
|
||||
@@ -136,7 +136,7 @@ bool MavlinkFtpTest::_bad_opcode_test(void)
|
||||
}
|
||||
|
||||
/// @brief Tests for correct reponse to a payload which an invalid data size field.
|
||||
bool MavlinkFtpTest::_bad_datasize_test(void)
|
||||
bool MavlinkFtpTest::_bad_datasize_test()
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
MavlinkFTP::PayloadHeader payload;
|
||||
@@ -163,7 +163,7 @@ bool MavlinkFtpTest::_bad_datasize_test(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MavlinkFtpTest::_list_test(void)
|
||||
bool MavlinkFtpTest::_list_test()
|
||||
{
|
||||
MavlinkFTP::PayloadHeader payload;
|
||||
const MavlinkFTP::PayloadHeader *reply;
|
||||
@@ -244,7 +244,7 @@ bool MavlinkFtpTest::_list_test(void)
|
||||
|
||||
/// @brief Tests for correct response to a List command on a valid directory, but with an offset that
|
||||
/// is beyond the last directory entry.
|
||||
bool MavlinkFtpTest::_list_eof_test(void)
|
||||
bool MavlinkFtpTest::_list_eof_test()
|
||||
{
|
||||
MavlinkFTP::PayloadHeader payload;
|
||||
const MavlinkFTP::PayloadHeader *reply;
|
||||
@@ -270,7 +270,7 @@ bool MavlinkFtpTest::_list_eof_test(void)
|
||||
}
|
||||
|
||||
/// @brief Tests for correct response to an Open command on a file which does not exist.
|
||||
bool MavlinkFtpTest::_open_badfile_test(void)
|
||||
bool MavlinkFtpTest::_open_badfile_test()
|
||||
{
|
||||
MavlinkFTP::PayloadHeader payload;
|
||||
const MavlinkFTP::PayloadHeader *reply;
|
||||
@@ -296,7 +296,7 @@ bool MavlinkFtpTest::_open_badfile_test(void)
|
||||
}
|
||||
|
||||
/// @brief Tests for correct reponse to an Open command on a file, followed by Terminate
|
||||
bool MavlinkFtpTest::_open_terminate_test(void)
|
||||
bool MavlinkFtpTest::_open_terminate_test()
|
||||
{
|
||||
MavlinkFTP::PayloadHeader payload;
|
||||
const MavlinkFTP::PayloadHeader *reply;
|
||||
@@ -345,7 +345,7 @@ bool MavlinkFtpTest::_open_terminate_test(void)
|
||||
}
|
||||
|
||||
/// @brief Tests for correct reponse to a Terminate command on an invalid session.
|
||||
bool MavlinkFtpTest::_terminate_badsession_test(void)
|
||||
bool MavlinkFtpTest::_terminate_badsession_test()
|
||||
{
|
||||
MavlinkFTP::PayloadHeader payload;
|
||||
const MavlinkFTP::PayloadHeader *reply;
|
||||
@@ -386,7 +386,7 @@ bool MavlinkFtpTest::_terminate_badsession_test(void)
|
||||
}
|
||||
|
||||
/// @brief Tests for correct reponse to a Read command on an open session.
|
||||
bool MavlinkFtpTest::_read_test(void)
|
||||
bool MavlinkFtpTest::_read_test()
|
||||
{
|
||||
MavlinkFTP::PayloadHeader payload;
|
||||
const MavlinkFTP::PayloadHeader *reply;
|
||||
@@ -497,7 +497,7 @@ bool MavlinkFtpTest::_read_test(void)
|
||||
}
|
||||
|
||||
/// @brief Tests for correct reponse to a Read command on an open session.
|
||||
bool MavlinkFtpTest::_burst_test(void)
|
||||
bool MavlinkFtpTest::_burst_test()
|
||||
{
|
||||
MavlinkFTP::PayloadHeader payload;
|
||||
const MavlinkFTP::PayloadHeader *reply;
|
||||
@@ -584,7 +584,7 @@ bool MavlinkFtpTest::_burst_test(void)
|
||||
}
|
||||
|
||||
/// @brief Tests for correct reponse to a Read command on an invalid session.
|
||||
bool MavlinkFtpTest::_read_badsession_test(void)
|
||||
bool MavlinkFtpTest::_read_badsession_test()
|
||||
{
|
||||
MavlinkFTP::PayloadHeader payload;
|
||||
const MavlinkFTP::PayloadHeader *reply;
|
||||
@@ -624,7 +624,7 @@ bool MavlinkFtpTest::_read_badsession_test(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MavlinkFtpTest::_removedirectory_test(void)
|
||||
bool MavlinkFtpTest::_removedirectory_test()
|
||||
{
|
||||
MavlinkFTP::PayloadHeader payload;
|
||||
const MavlinkFTP::PayloadHeader *reply;
|
||||
@@ -680,7 +680,7 @@ bool MavlinkFtpTest::_removedirectory_test(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MavlinkFtpTest::_createdirectory_test(void)
|
||||
bool MavlinkFtpTest::_createdirectory_test()
|
||||
{
|
||||
MavlinkFTP::PayloadHeader payload;
|
||||
const MavlinkFTP::PayloadHeader *reply;
|
||||
@@ -725,7 +725,7 @@ bool MavlinkFtpTest::_createdirectory_test(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MavlinkFtpTest::_removefile_test(void)
|
||||
bool MavlinkFtpTest::_removefile_test()
|
||||
{
|
||||
MavlinkFTP::PayloadHeader payload;
|
||||
const MavlinkFTP::PayloadHeader *reply;
|
||||
@@ -916,14 +916,14 @@ bool MavlinkFtpTest::_send_receive_msg(MavlinkFTP::PayloadHeader *payload_header
|
||||
}
|
||||
|
||||
/// @brief Cleans up an files created on microsd during testing
|
||||
void MavlinkFtpTest::_cleanup_microsd(void)
|
||||
void MavlinkFtpTest::_cleanup_microsd()
|
||||
{
|
||||
::unlink(_unittest_microsd_file);
|
||||
::rmdir(_unittest_microsd_dir);
|
||||
}
|
||||
|
||||
/// @brief Runs all the unit tests
|
||||
bool MavlinkFtpTest::run_tests(void)
|
||||
bool MavlinkFtpTest::run_tests()
|
||||
{
|
||||
ut_run_test(_ack_test);
|
||||
ut_run_test(_bad_opcode_test);
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
extern "C" __EXPORT int mc_pos_control_tests_main(int argc, char *argv[]);
|
||||
|
||||
bool mcPosControlTests(void);
|
||||
bool mcPosControlTests();
|
||||
|
||||
//#include "../mc_pos_control_main.cpp"
|
||||
class MulticopterPositionControl
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
McPosControlTests();
|
||||
virtual ~McPosControlTests();
|
||||
|
||||
virtual bool run_tests(void);
|
||||
virtual bool run_tests();
|
||||
|
||||
private:
|
||||
bool cross_sphere_line_test();
|
||||
@@ -75,7 +75,7 @@ McPosControlTests::~McPosControlTests()
|
||||
{
|
||||
}
|
||||
|
||||
bool McPosControlTests::cross_sphere_line_test(void)
|
||||
bool McPosControlTests::cross_sphere_line_test()
|
||||
{
|
||||
MulticopterPositionControl *control = {};
|
||||
|
||||
@@ -182,7 +182,7 @@ bool McPosControlTests::cross_sphere_line_test(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool McPosControlTests::run_tests(void)
|
||||
bool McPosControlTests::run_tests()
|
||||
{
|
||||
ut_run_test(cross_sphere_line_test);
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ int baro_init();
|
||||
|
||||
|
||||
int
|
||||
sensors_init(void)
|
||||
sensors_init()
|
||||
{
|
||||
int ret;
|
||||
int ret_combined = 0;
|
||||
|
||||
@@ -435,7 +435,7 @@ void uORB::Manager::set_uorb_communicator(uORBCommunicator::IChannel *channel)
|
||||
}
|
||||
}
|
||||
|
||||
uORBCommunicator::IChannel *uORB::Manager::get_uorb_communicator(void)
|
||||
uORBCommunicator::IChannel *uORB::Manager::get_uorb_communicator()
|
||||
{
|
||||
return _comm_channel;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ uORBTest::UnitTest &uORBTest::UnitTest::instance()
|
||||
return t;
|
||||
}
|
||||
|
||||
int uORBTest::UnitTest::pubsublatency_main(void)
|
||||
int uORBTest::UnitTest::pubsublatency_main()
|
||||
{
|
||||
/* poll on test topic and output latency */
|
||||
float latency_integral = 0.0f;
|
||||
|
||||
@@ -48,7 +48,7 @@ UnitTest::~UnitTest()
|
||||
{
|
||||
}
|
||||
|
||||
void UnitTest::print_results(void)
|
||||
void UnitTest::print_results()
|
||||
{
|
||||
if (_tests_failed) {
|
||||
PX4_ERR("SOME TESTS FAILED");
|
||||
|
||||
Reference in New Issue
Block a user