[test] Fix non working test

This commit is contained in:
Lucas 2024-05-05 11:47:41 +02:00
parent 9716f3e64d
commit 6ecff939ef

View file

@ -99,15 +99,15 @@ public class CSVStreamProviderTest {
@Test
public void testDistanceToTime() throws Exception {
// Valeurs fictives pour TWO_ACCELERATION_DISTANCE et MAX_SPEED
final double TWO_ACCELERATION_DISTANCE = 0.1; // Par exemple
final double MAX_SPEED = 10.0; // Par exemple
final double TWO_ACCELERATION_DISTANCE = 0.1;
final double MAX_SPEED = 10.0;
// Exemple de distance à tester
double distanceExample = 1.0; // 1 km
// Calcul attendu basé sur la formule fournie
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
Method method = CSVStreamProvider.class.getDeclaredMethod("distanceToTime", double.class, String.class);