mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Fix C++ floating point literal formatting (#2114)
Found formatting errors with this regex "([^a-z0-9\.]\.[0-9]|[^a-z0-9\.][0-9]\.[^a-z0-9\.])" and ignored false positives. Fixes #2112.
This commit is contained in:
committed by
Peter Johnson
parent
3d1ca856b2
commit
ffa4b907c0
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -49,7 +49,7 @@ TEST(MotorEncoderConnectorTest, TestWithoutDistancePerPulseRealisitcUpdate) {
|
||||
frc::sim::lowfi::MotorEncoderConnector connector(motorSim, encoderSim);
|
||||
|
||||
talon.Set(0.5);
|
||||
motorSim.Update(.02);
|
||||
motorSim.Update(0.02);
|
||||
connector.Update();
|
||||
|
||||
// Position
|
||||
@@ -64,7 +64,7 @@ TEST(MotorEncoderConnectorTest, TestWithoutDistancePerPulseRealisitcUpdate) {
|
||||
TEST(MotorEncoderConnectorTest, TestWithDistancePerPulseFullSpeed) {
|
||||
frc::Talon talon{3};
|
||||
frc::Encoder encoder{3, 1};
|
||||
encoder.SetDistancePerPulse(.001);
|
||||
encoder.SetDistancePerPulse(0.001);
|
||||
|
||||
frc::sim::lowfi::SimpleMotorModel motorModelSim(6000);
|
||||
frc::sim::lowfi::WpiMotorSim motorSim(3, motorModelSim);
|
||||
@@ -88,7 +88,7 @@ TEST(MotorEncoderConnectorTest, TestWithDistancePerPulseFullSpeed) {
|
||||
TEST(MotorEncoderConnectorTest, TestWithDistancePerPulseRealistic) {
|
||||
frc::Talon talon{3};
|
||||
frc::Encoder encoder{3, 1};
|
||||
encoder.SetDistancePerPulse(.001);
|
||||
encoder.SetDistancePerPulse(0.001);
|
||||
|
||||
frc::sim::lowfi::SimpleMotorModel motorModelSim(6000);
|
||||
frc::sim::lowfi::WpiMotorSim motorSim(3, motorModelSim);
|
||||
@@ -97,7 +97,7 @@ TEST(MotorEncoderConnectorTest, TestWithDistancePerPulseRealistic) {
|
||||
|
||||
talon.Set(0.5);
|
||||
|
||||
motorSim.Update(.02);
|
||||
motorSim.Update(0.02);
|
||||
connector.Update();
|
||||
|
||||
// Position
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -13,7 +13,7 @@ TEST(SimpleMotorModelSimulationTest, TestSimpleModel) {
|
||||
|
||||
// Test forward voltage
|
||||
motorModelSim.SetVoltage(6);
|
||||
motorModelSim.Update(.5);
|
||||
motorModelSim.Update(0.5);
|
||||
|
||||
EXPECT_DOUBLE_EQ(50, motorModelSim.GetPosition());
|
||||
EXPECT_DOUBLE_EQ(100, motorModelSim.GetVelocity());
|
||||
@@ -26,7 +26,7 @@ TEST(SimpleMotorModelSimulationTest, TestSimpleModel) {
|
||||
// Test negative voltage
|
||||
motorModelSim.Reset();
|
||||
motorModelSim.SetVoltage(-3);
|
||||
motorModelSim.Update(.06);
|
||||
motorModelSim.Update(0.06);
|
||||
|
||||
EXPECT_DOUBLE_EQ(-3, motorModelSim.GetPosition());
|
||||
EXPECT_DOUBLE_EQ(-50, motorModelSim.GetVelocity());
|
||||
|
||||
Reference in New Issue
Block a user