mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Clean up unit UDL usage (#6961)
This commit is contained in:
@@ -9,17 +9,10 @@
|
||||
|
||||
using namespace frc;
|
||||
|
||||
namespace {
|
||||
|
||||
using ProtoType = wpi::Protobuf<frc::DCMotor>;
|
||||
|
||||
const DCMotor kExpectedData = DCMotor{units::volt_t{1.91},
|
||||
units::newton_meter_t{19.1},
|
||||
units::ampere_t{1.74},
|
||||
units::ampere_t{2.29},
|
||||
units::radians_per_second_t{2.2},
|
||||
2};
|
||||
} // namespace
|
||||
inline constexpr DCMotor kExpectedData =
|
||||
DCMotor{1.91_V, 19.1_Nm, 1.74_A, 2.29_A, 2.2_rad_per_s, 2};
|
||||
|
||||
TEST(DCMotorProtoTest, Roundtrip) {
|
||||
google::protobuf::Arena arena;
|
||||
|
||||
@@ -8,16 +8,10 @@
|
||||
|
||||
using namespace frc;
|
||||
|
||||
namespace {
|
||||
|
||||
using StructType = wpi::Struct<frc::DCMotor>;
|
||||
const DCMotor kExpectedData = DCMotor{units::volt_t{1.91},
|
||||
units::newton_meter_t{19.1},
|
||||
units::ampere_t{1.74},
|
||||
units::ampere_t{2.29},
|
||||
units::radians_per_second_t{2.2},
|
||||
2};
|
||||
} // namespace
|
||||
|
||||
inline constexpr DCMotor kExpectedData =
|
||||
DCMotor{1.91_V, 19.1_Nm, 1.74_A, 2.29_A, 2.2_rad_per_s, 2};
|
||||
|
||||
TEST(DCMotorStructTest, Roundtrip) {
|
||||
uint8_t buffer[StructType::GetSize()];
|
||||
|
||||
Reference in New Issue
Block a user