Files
allwpilib/wpimath/src/test/native/cpp/controller/struct/DifferentialDriveFeedforwardStructTest.cpp
Gold856 35e8abedeb Don't force public variables to use Hungarian notation (#8774)
People generally have expressed a dislike for the Hungarian notation
used in member variables, especially in examples/templates, and our
styleguide shouldn't be forced on downstream consumers, so this removes
all Hungarian notation from the examples/templates.

There are _some_ benefits to Hungarian for private member variables
(like knowing what's a member vs. local in a PR review) so we'll keep
private member variables the same for now, but public variables should
no longer use Hungarian notation, since it looks much worse. A new PMD
XPath rule has been added to accomplish this goal. Some other
non-compliant variables were fixed for the new rule.
2026-04-25 11:32:08 -07:00

29 lines
1.1 KiB
C++

// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "../../StructTestBase.hpp"
#include "wpi/math/controller/DifferentialDriveFeedforward.hpp"
using namespace wpi::math;
struct DifferentialDriveFeedforwardStructTestData {
using Type = DifferentialDriveFeedforward;
inline static const Type kTestData{
decltype(1_V / 1_mps){0.174}, decltype(1_V / 1_mps_sq){0.229},
decltype(1_V / 1_mps){4.4}, decltype(1_V / 1_mps_sq){4.5}};
static void CheckEq(const Type& testData, const Type& data) {
EXPECT_EQ(testData.kVLinear.value(), data.kVLinear.value());
EXPECT_EQ(testData.kALinear.value(), data.kALinear.value());
EXPECT_EQ(testData.kVAngular.value(), data.kVAngular.value());
EXPECT_EQ(testData.kAAngular.value(), data.kAAngular.value());
}
};
INSTANTIATE_TYPED_TEST_SUITE_P(DifferentialDriveFeedforward, StructTest,
DifferentialDriveFeedforwardStructTestData);