mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 20:33:33 +08:00
clang-tidy modernize-redundant-void-arg
This commit is contained in:
@@ -15,20 +15,20 @@
|
||||
class AutoDeclinationTest : public UnitTest
|
||||
{
|
||||
public:
|
||||
virtual bool run_tests(void);
|
||||
virtual bool run_tests();
|
||||
|
||||
private:
|
||||
bool autodeclination_check();
|
||||
};
|
||||
|
||||
bool AutoDeclinationTest::autodeclination_check(void)
|
||||
bool AutoDeclinationTest::autodeclination_check()
|
||||
{
|
||||
ut_assert("declination differs more than 1 degree", get_mag_declination(47.0, 8.0) - 0.6f < 0.5f);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AutoDeclinationTest::run_tests(void)
|
||||
bool AutoDeclinationTest::run_tests()
|
||||
{
|
||||
ut_run_test(autodeclination_check);
|
||||
|
||||
|
||||
@@ -22,14 +22,14 @@ typedef union {
|
||||
class FloatTest : public UnitTest
|
||||
{
|
||||
public:
|
||||
virtual bool run_tests(void);
|
||||
virtual bool run_tests();
|
||||
|
||||
private:
|
||||
bool singlePrecisionTests();
|
||||
bool doublePrecisionTests();
|
||||
};
|
||||
|
||||
bool FloatTest::singlePrecisionTests(void)
|
||||
bool FloatTest::singlePrecisionTests()
|
||||
{
|
||||
float sinf_zero = sinf(0.0f);
|
||||
float sinf_one = sinf(1.0f);
|
||||
@@ -83,7 +83,7 @@ bool FloatTest::singlePrecisionTests(void)
|
||||
}
|
||||
|
||||
|
||||
bool FloatTest::doublePrecisionTests(void)
|
||||
bool FloatTest::doublePrecisionTests()
|
||||
{
|
||||
float f1 = 1.55f;
|
||||
|
||||
@@ -138,7 +138,7 @@ bool FloatTest::doublePrecisionTests(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FloatTest::run_tests(void)
|
||||
bool FloatTest::run_tests()
|
||||
{
|
||||
ut_run_test(singlePrecisionTests);
|
||||
ut_run_test(doublePrecisionTests);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
class HysteresisTest : public UnitTest
|
||||
{
|
||||
public:
|
||||
virtual bool run_tests(void);
|
||||
virtual bool run_tests();
|
||||
|
||||
private:
|
||||
bool _init_false();
|
||||
|
||||
@@ -20,14 +20,14 @@ typedef union {
|
||||
class IntTest : public UnitTest
|
||||
{
|
||||
public:
|
||||
virtual bool run_tests(void);
|
||||
virtual bool run_tests();
|
||||
|
||||
private:
|
||||
bool math64bitTests();
|
||||
bool math3264MixedMathTests();
|
||||
};
|
||||
|
||||
bool IntTest::math64bitTests(void)
|
||||
bool IntTest::math64bitTests()
|
||||
{
|
||||
int64_t large = 354156329598;
|
||||
int64_t calc = large * 5;
|
||||
@@ -37,7 +37,7 @@ bool IntTest::math64bitTests(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IntTest::math3264MixedMathTests(void)
|
||||
bool IntTest::math3264MixedMathTests()
|
||||
{
|
||||
int32_t small = 50;
|
||||
int32_t large_int = 2147483647; // MAX INT value
|
||||
@@ -50,7 +50,7 @@ bool IntTest::math3264MixedMathTests(void)
|
||||
}
|
||||
|
||||
|
||||
bool IntTest::run_tests(void)
|
||||
bool IntTest::run_tests()
|
||||
{
|
||||
ut_run_test(math64bitTests);
|
||||
ut_run_test(math3264MixedMathTests);
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
class MathlibTest : public UnitTest
|
||||
{
|
||||
public:
|
||||
virtual bool run_tests(void);
|
||||
virtual bool run_tests();
|
||||
|
||||
private:
|
||||
bool testVector2();
|
||||
@@ -79,7 +79,7 @@ private:
|
||||
|
||||
using namespace math;
|
||||
|
||||
bool MathlibTest::testVector2(void)
|
||||
bool MathlibTest::testVector2()
|
||||
{
|
||||
{
|
||||
Vector<2> v;
|
||||
@@ -101,7 +101,7 @@ bool MathlibTest::testVector2(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MathlibTest::testVector3(void)
|
||||
bool MathlibTest::testVector3()
|
||||
{
|
||||
|
||||
{
|
||||
@@ -139,7 +139,7 @@ bool MathlibTest::testVector3(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MathlibTest::testVector4(void)
|
||||
bool MathlibTest::testVector4()
|
||||
{
|
||||
{
|
||||
Vector<4> v;
|
||||
@@ -160,7 +160,7 @@ bool MathlibTest::testVector4(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MathlibTest::testVector10(void)
|
||||
bool MathlibTest::testVector10()
|
||||
{
|
||||
{
|
||||
Vector<10> v1;
|
||||
@@ -173,7 +173,7 @@ bool MathlibTest::testVector10(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MathlibTest::testMatrix3x3(void)
|
||||
bool MathlibTest::testMatrix3x3()
|
||||
{
|
||||
{
|
||||
Matrix<3, 3> m1;
|
||||
@@ -188,7 +188,7 @@ bool MathlibTest::testMatrix3x3(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MathlibTest::testMatrix10x10(void)
|
||||
bool MathlibTest::testMatrix10x10()
|
||||
{
|
||||
{
|
||||
Matrix<10, 10> m1;
|
||||
@@ -204,7 +204,7 @@ bool MathlibTest::testMatrix10x10(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MathlibTest::testMatrixNonsymmetric(void)
|
||||
bool MathlibTest::testMatrixNonsymmetric()
|
||||
{
|
||||
int rc = true;
|
||||
{
|
||||
@@ -268,7 +268,7 @@ bool MathlibTest::testMatrixNonsymmetric(void)
|
||||
return rc;
|
||||
}
|
||||
|
||||
bool MathlibTest::testRotationMatrixQuaternion(void)
|
||||
bool MathlibTest::testRotationMatrixQuaternion()
|
||||
{
|
||||
// test conversion rotation matrix to quaternion and back
|
||||
math::Matrix<3, 3> R_orig;
|
||||
@@ -299,7 +299,7 @@ bool MathlibTest::testRotationMatrixQuaternion(void)
|
||||
}
|
||||
|
||||
|
||||
bool MathlibTest::testQuaternionfrom_dcm(void)
|
||||
bool MathlibTest::testQuaternionfrom_dcm()
|
||||
{
|
||||
// test against some known values
|
||||
float tol = 0.0001f;
|
||||
@@ -318,7 +318,7 @@ bool MathlibTest::testQuaternionfrom_dcm(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MathlibTest::testQuaternionfrom_euler(void)
|
||||
bool MathlibTest::testQuaternionfrom_euler()
|
||||
{
|
||||
float tol = 0.0001f;
|
||||
math::Quaternion q_true = {1.0f, 0.0f, 0.0f, 0.0f};
|
||||
@@ -353,7 +353,7 @@ bool MathlibTest::testQuaternionfrom_euler(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MathlibTest::testQuaternionRotate(void)
|
||||
bool MathlibTest::testQuaternionRotate()
|
||||
{
|
||||
// test quaternion method "rotate" (rotate vector by quaternion)
|
||||
Vector<3> vector = {1.0f, 1.0f, 1.0f};
|
||||
@@ -419,7 +419,7 @@ bool MathlibTest::testQuaternionRotate(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MathlibTest::run_tests(void)
|
||||
bool MathlibTest::run_tests()
|
||||
{
|
||||
ut_run_test(testVector2);
|
||||
ut_run_test(testVector3);
|
||||
|
||||
@@ -10,7 +10,7 @@ using namespace matrix;
|
||||
class MatrixTest : public UnitTest
|
||||
{
|
||||
public:
|
||||
virtual bool run_tests(void);
|
||||
virtual bool run_tests();
|
||||
|
||||
private:
|
||||
bool attitudeTests();
|
||||
@@ -32,7 +32,7 @@ private:
|
||||
bool dcmRenormTests();
|
||||
};
|
||||
|
||||
bool MatrixTest::run_tests(void)
|
||||
bool MatrixTest::run_tests()
|
||||
{
|
||||
ut_run_test(attitudeTests);
|
||||
ut_run_test(filterTests);
|
||||
@@ -63,7 +63,7 @@ template class matrix::Quaternion<float>;
|
||||
template class matrix::Euler<float>;
|
||||
template class matrix::Dcm<float>;
|
||||
|
||||
bool MatrixTest::attitudeTests(void)
|
||||
bool MatrixTest::attitudeTests()
|
||||
{
|
||||
double eps = 1e-6;
|
||||
|
||||
@@ -292,7 +292,7 @@ bool MatrixTest::attitudeTests(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MatrixTest::filterTests(void)
|
||||
bool MatrixTest::filterTests()
|
||||
{
|
||||
const size_t n_x = 6;
|
||||
const size_t n_y = 5;
|
||||
@@ -315,7 +315,7 @@ bool MatrixTest::filterTests(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MatrixTest::helperTests(void)
|
||||
bool MatrixTest::helperTests()
|
||||
{
|
||||
ut_test(fabs(wrap_pi(4.0) - (4.0 - 2 * M_PI)) < 1e-5);
|
||||
ut_test(fabs(wrap_pi(-4.0) - (-4.0 + 2 * M_PI)) < 1e-5);
|
||||
@@ -338,7 +338,7 @@ Vector<float, 6> f(float t, const Matrix<float, 6, 1> &y, const Matrix<float, 3,
|
||||
return v * ones<float, 6, 1>();
|
||||
}
|
||||
|
||||
bool MatrixTest::integrationTests(void)
|
||||
bool MatrixTest::integrationTests()
|
||||
{
|
||||
Vector<float, 6> y = ones<float, 6, 1>();
|
||||
Vector<float, 3> u = ones<float, 3, 1>();
|
||||
@@ -354,7 +354,7 @@ bool MatrixTest::integrationTests(void)
|
||||
|
||||
template class matrix::SquareMatrix<float, 3>;
|
||||
|
||||
bool MatrixTest::inverseTests(void)
|
||||
bool MatrixTest::inverseTests()
|
||||
{
|
||||
float data[9] = {0, 2, 3,
|
||||
4, 5, 6,
|
||||
@@ -380,7 +380,7 @@ bool MatrixTest::inverseTests(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MatrixTest::matrixAssignmentTests(void)
|
||||
bool MatrixTest::matrixAssignmentTests()
|
||||
{
|
||||
Matrix3f m;
|
||||
m.setZero();
|
||||
@@ -461,7 +461,7 @@ bool MatrixTest::matrixAssignmentTests(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MatrixTest::matrixMultTests(void)
|
||||
bool MatrixTest::matrixMultTests()
|
||||
{
|
||||
float data[9] = {1, 0, 0, 0, 1, 0, 1, 0, 1};
|
||||
Matrix3f A(data);
|
||||
@@ -485,7 +485,7 @@ bool MatrixTest::matrixMultTests(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MatrixTest::matrixScalarMultTests(void)
|
||||
bool MatrixTest::matrixScalarMultTests()
|
||||
{
|
||||
float data[9] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
Matrix3f A(data);
|
||||
@@ -500,7 +500,7 @@ bool MatrixTest::matrixScalarMultTests(void)
|
||||
|
||||
template class matrix::Matrix<float, 3, 3>;
|
||||
|
||||
bool MatrixTest::setIdentityTests(void)
|
||||
bool MatrixTest::setIdentityTests()
|
||||
{
|
||||
Matrix3f A;
|
||||
A.setIdentity();
|
||||
@@ -519,7 +519,7 @@ bool MatrixTest::setIdentityTests(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MatrixTest::sliceTests(void)
|
||||
bool MatrixTest::sliceTests()
|
||||
{
|
||||
float data[9] = {0, 2, 3,
|
||||
4, 5, 6,
|
||||
@@ -554,7 +554,7 @@ bool MatrixTest::sliceTests(void)
|
||||
}
|
||||
|
||||
|
||||
bool MatrixTest::squareMatrixTests(void)
|
||||
bool MatrixTest::squareMatrixTests()
|
||||
{
|
||||
float data[9] = {1, 2, 3,
|
||||
4, 5, 6,
|
||||
@@ -581,7 +581,7 @@ bool MatrixTest::squareMatrixTests(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MatrixTest::transposeTests(void)
|
||||
bool MatrixTest::transposeTests()
|
||||
{
|
||||
float data[6] = {1, 2, 3, 4, 5, 6};
|
||||
Matrix<float, 2, 3> A(data);
|
||||
@@ -593,7 +593,7 @@ bool MatrixTest::transposeTests(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MatrixTest::vectorTests(void)
|
||||
bool MatrixTest::vectorTests()
|
||||
{
|
||||
float data1[] = {1, 2, 3, 4, 5};
|
||||
float data2[] = {6, 7, 8, 9, 10};
|
||||
@@ -611,7 +611,7 @@ bool MatrixTest::vectorTests(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MatrixTest::vector2Tests(void)
|
||||
bool MatrixTest::vector2Tests()
|
||||
{
|
||||
Vector2f a(1, 0);
|
||||
Vector2f b(0, 1);
|
||||
@@ -636,7 +636,7 @@ bool MatrixTest::vector2Tests(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MatrixTest::vector3Tests(void)
|
||||
bool MatrixTest::vector3Tests()
|
||||
{
|
||||
Vector3f a(1, 0, 0);
|
||||
Vector3f b(0, 1, 0);
|
||||
@@ -653,7 +653,7 @@ bool MatrixTest::vector3Tests(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MatrixTest::vectorAssignmentTests(void)
|
||||
bool MatrixTest::vectorAssignmentTests()
|
||||
{
|
||||
Vector3f v;
|
||||
v(0) = 1;
|
||||
@@ -680,7 +680,7 @@ bool MatrixTest::vectorAssignmentTests(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MatrixTest::dcmRenormTests(void)
|
||||
bool MatrixTest::dcmRenormTests()
|
||||
{
|
||||
bool verbose = true;
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ static bool should_prearm = false;
|
||||
class MixerTest : public UnitTest
|
||||
{
|
||||
public:
|
||||
virtual bool run_tests(void);
|
||||
virtual bool run_tests();
|
||||
MixerTest();
|
||||
|
||||
private:
|
||||
@@ -128,7 +128,7 @@ MixerTest::MixerTest() : UnitTest(),
|
||||
{
|
||||
}
|
||||
|
||||
bool MixerTest::run_tests(void)
|
||||
bool MixerTest::run_tests()
|
||||
{
|
||||
ut_run_test(loadIOPass);
|
||||
ut_run_test(loadQuadTest);
|
||||
|
||||
Reference in New Issue
Block a user