Skip to content

Commit

Permalink
clang-tidy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
henrygerardmoore committed Nov 5, 2024
1 parent 6394574 commit c45c11e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion fuse_variables/test/test_orientation_3d_stamped.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,17 @@ TEST(Orientation3DStamped, UUID)
}
}

namespace
{
template <typename T>
inline static void QuaternionInverse(const T in[4], T out[4])
inline void QuaternionInverse(const T in[4], T out[4])
{
out[0] = in[0];
out[1] = -in[1];
out[2] = -in[2];
out[3] = -in[3];
}
} // namespace

struct Orientation3DPlus
{
Expand Down Expand Up @@ -184,12 +187,14 @@ TEST(Orientation3DStamped, PlusJacobian)
auto* parameterization = Orientation3DStamped(rclcpp::Time(0, 0)).localParameterization();
auto reference = Orientation3DLocalParameterization();

// NOLINTBEGIN(clang-analyzer-security.FloatLoopCounter)
for (double qx = -0.5; qx < 0.5; qx += 0.1)
{
for (double qy = -0.5; qy < 0.5; qy += 0.1)
{
for (double qz = -0.5; qz < 0.5; qz += 0.1)
{
// NOLINTEND(clang-analyzer-security.FloatLoopCounter)
double const qw = std::sqrt(1.0 - qx * qx - qy * qy - qz * qz);

double x[4] = { qw, qx, qy, qz };
Expand Down Expand Up @@ -223,12 +228,14 @@ TEST(Orientation3DStamped, MinusJacobian)
auto* parameterization = Orientation3DStamped(rclcpp::Time(0, 0)).localParameterization();
auto reference = Orientation3DLocalParameterization();

// NOLINTBEGIN(clang-analyzer-security.FloatLoopCounter)
for (double qx = -0.5; qx < 0.5; qx += 0.1)
{
for (double qy = -0.5; qy < 0.5; qy += 0.1)
{
for (double qz = -0.5; qz < 0.5; qz += 0.1)
{
// NOLINTEND(clang-analyzer-security.FloatLoopCounter)
double const qw = std::sqrt(1.0 - qx * qx - qy * qy - qz * qz);

double x[4] = { qw, qx, qy, qz };
Expand Down Expand Up @@ -453,12 +460,14 @@ TEST(Orientation3DStamped, ManifoldPlusJacobian)
auto* manifold = Orientation3DStamped(rclcpp::Time(0, 0)).manifold();
auto reference = Orientation3DManifold();

// NOLINTBEGIN(clang-analyzer-security.FloatLoopCounter)
for (double qx = -0.5; qx < 0.5; qx += 0.1)
{
for (double qy = -0.5; qy < 0.5; qy += 0.1)
{
for (double qz = -0.5; qz < 0.5; qz += 0.1)
{
// NOLINTEND(clang-analyzer-security.FloatLoopCounter)
double const qw = std::sqrt(1.0 - qx * qx - qy * qy - qz * qz);

double x[4] = { qw, qx, qy, qz };
Expand Down Expand Up @@ -507,12 +516,14 @@ TEST(Orientation3DStamped, ManifoldMinusJacobian)
auto* manifold = Orientation3DStamped(rclcpp::Time(0, 0)).manifold();
auto reference = Orientation3DManifold();

// NOLINTBEGIN(clang-analyzer-security.FloatLoopCounter)
for (double qx = -0.5; qx < 0.5; qx += 0.1)
{
for (double qy = -0.5; qy < 0.5; qy += 0.1)
{
for (double qz = -0.5; qz < 0.5; qz += 0.1)
{
// NOLINTEND(clang-analyzer-security.FloatLoopCounter)
double const qw = std::sqrt(1.0 - qx * qx - qy * qy - qz * qz);

double x[4] = { qw, qx, qy, qz };
Expand Down

0 comments on commit c45c11e

Please sign in to comment.