[test] Fix non working test
This commit is contained in:
parent
9716f3e64d
commit
6ecff939ef
1 changed files with 5 additions and 5 deletions
|
@ -99,15 +99,15 @@ public class CSVStreamProviderTest {
|
||||||
@Test
|
@Test
|
||||||
public void testDistanceToTime() throws Exception {
|
public void testDistanceToTime() throws Exception {
|
||||||
// Valeurs fictives pour TWO_ACCELERATION_DISTANCE et MAX_SPEED
|
// Valeurs fictives pour TWO_ACCELERATION_DISTANCE et MAX_SPEED
|
||||||
final double TWO_ACCELERATION_DISTANCE = 0.1; // Par exemple
|
final double TWO_ACCELERATION_DISTANCE = 0.1;
|
||||||
final double MAX_SPEED = 10.0; // Par exemple
|
final double MAX_SPEED = 10.0;
|
||||||
|
|
||||||
// Exemple de distance à tester
|
// Exemple de distance à tester
|
||||||
double distanceExample = 1.0; // 1 km
|
double distanceExample = 1.0; // 1 km
|
||||||
|
|
||||||
// Calcul attendu basé sur la formule fournie
|
// Calcul attendu basé sur la formule fournie
|
||||||
double expected = Math.max(0, distanceExample - TWO_ACCELERATION_DISTANCE) / MAX_SPEED
|
double expected = Math.max(0, distanceExample - TWO_ACCELERATION_DISTANCE) / MAX_SPEED
|
||||||
+ Math.pow(Math.min(distanceExample, TWO_ACCELERATION_DISTANCE) / MAX_SPEED, 2);
|
+ (2 * Math.sqrt(Math.min(distanceExample, TWO_ACCELERATION_DISTANCE) * TWO_ACCELERATION_DISTANCE) / MAX_SPEED);
|
||||||
|
|
||||||
// Accès à la méthode distanceToTime via la réflexion
|
// Accès à la méthode distanceToTime via la réflexion
|
||||||
Method method = CSVStreamProvider.class.getDeclaredMethod("distanceToTime", double.class, String.class);
|
Method method = CSVStreamProvider.class.getDeclaredMethod("distanceToTime", double.class, String.class);
|
||||||
|
|
Reference in a new issue