Skip to content

Commit

Permalink
Correct expected maximum values
Browse files Browse the repository at this point in the history
Where I inserted maxStepHi, 127 was hardcoded before. No functional change.
Where I inserted maxStepLo, 127 was hardcoded before. This is wrong, the function under test should not return larger values than its speed step input.
  • Loading branch information
newHeiko committed Mar 1, 2021
1 parent 78ff15e commit a1c2c25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions java/test/jmri/jmrix/AbstractThrottleTest.java
Expand Up @@ -1592,11 +1592,11 @@ public void testGetSpeed_float_int() {
int result = instance.intSpeed(speed, maxStepHi);
Assert.assertNotSame(speed + "(" + maxStepHi + " steps) should not idle", 0, result);
Assert.assertNotSame(speed + "(" + maxStepHi + " steps) should not eStop", 1, result);
Assert.assertTrue(speed + "(" + maxStepHi + " steps) should not exceed " + maxStepHi, result <= 127);
Assert.assertTrue(speed + "(" + maxStepHi + " steps) should not exceed " + maxStepHi, result <= maxStepHi);
result = instance.intSpeed(speed, maxStepLo);
Assert.assertNotSame(speed + "(" + maxStepLo + " steps) should not idle", 0, result);
Assert.assertNotSame(speed + "(" + maxStepLo + " steps) should not eStop", 1, result);
Assert.assertTrue(speed + "(" + maxStepLo + " steps) should not exceed " + maxStepLo, result <= 127);
Assert.assertTrue(speed + "(" + maxStepLo + " steps) should not exceed " + maxStepLo, result <= maxStepLo);
speed = speed + 0.001F;
}
}
Expand Down

0 comments on commit a1c2c25

Please sign in to comment.