-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
228 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 0 additions & 58 deletions
58
src/androidTest/java/de/dennisguse/opentracks/sensors/AltitudeSumManagerTest.java
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
...androidTest/java/de/dennisguse/opentracks/sensors/sensorData/AggregatorBarometerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package de.dennisguse.opentracks.sensors.sensorData; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import de.dennisguse.opentracks.data.models.AtmosphericPressure; | ||
|
||
public class AggregatorBarometerTest { | ||
|
||
private static void addSensorValue(AggregatorBarometer aggregatorBarometer, float[] values) { | ||
for (float f : values) { | ||
aggregatorBarometer.add(new Raw<>(AtmosphericPressure.ofHPA(f))); | ||
} | ||
} | ||
|
||
@Test | ||
public void getAltitudeGainLoss_downhill() { | ||
// given | ||
AggregatorBarometer subject = new AggregatorBarometer(""); | ||
|
||
// then | ||
addSensorValue(subject, new float[]{1015f, 1015.01f, 1015.02f, 1015.03f, 1015.04f, 1015.05f, 1015.06f, 1015.07f, 1015.08f, 1015.09f, 1015.10f, 1015.11f, 1015.12f, 1015.13f, 1018f, 1018.1f, 1018.1f, 1018.1f, 1018.1f}); | ||
|
||
// then | ||
Assert.assertEquals(0f, subject.value.gain_m(), 0.01); | ||
Assert.assertEquals(15f, subject.value.loss_m(), 0.01); | ||
} | ||
} |
Oops, something went wrong.