forked from upstream-mirrors/OpenTracks
Fix eclipse warnings
This commit is contained in:
@@ -315,7 +315,6 @@ public class CalorieUtils {
|
||||
* @param gradeBuffer
|
||||
* @param distance
|
||||
* @param rise
|
||||
* @return
|
||||
*/
|
||||
private static double updateGrade(DoubleBuffer gradeBuffer, float distance, Double rise) {
|
||||
double grade = 0;
|
||||
|
||||
+24
-37
@@ -45,8 +45,8 @@ public class ChartFragmentTest extends AndroidTestCase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the logic to get the incorrect values of sensor in
|
||||
* {@link ChartFragment#fillDataPoint(Location, double[])}
|
||||
* Tests the logic to get the incorrect values of sensor in {@link ChartFragment#fillDataPoint(Location,
|
||||
* double[], android.content.Context)}
|
||||
*/
|
||||
public void testFillDataPoint_sensorIncorrect() {
|
||||
MyTracksLocation myTracksLocation = TrackStubUtils.createMyTracksLocation();
|
||||
@@ -69,10 +69,7 @@ public class ChartFragmentTest extends AndroidTestCase {
|
||||
// Creates SensorDataSet.
|
||||
SensorDataSet sensorDataSet = myTracksLocation.getSensorDataSet();
|
||||
sensorDataSet = sensorDataSet.toBuilder()
|
||||
.setHeartRate(heartRateData)
|
||||
.setCadence(cadenceData)
|
||||
.setPower(powerData)
|
||||
.build();
|
||||
.setHeartRate(heartRateData).setCadence(cadenceData).setPower(powerData).build();
|
||||
myTracksLocation.setSensorDataSet(sensorDataSet);
|
||||
// Test.
|
||||
point = fillDataPointTestHelper(myTracksLocation);
|
||||
@@ -82,8 +79,8 @@ public class ChartFragmentTest extends AndroidTestCase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the logic to get the correct values of sensor in
|
||||
* {@link ChartFragment#fillDataPoint(Location, double[])}.
|
||||
* Tests the logic to get the correct values of sensor in {@link ChartFragment#fillDataPoint(Location,
|
||||
* double[], android.content.Context)}.
|
||||
*/
|
||||
public void testFillDataPoint_sensorCorrect() {
|
||||
MyTracksLocation myTracksLocation = TrackStubUtils.createMyTracksLocation();
|
||||
@@ -104,10 +101,7 @@ public class ChartFragmentTest extends AndroidTestCase {
|
||||
// Creates SensorDataSet.
|
||||
SensorDataSet sensorDataSet = myTracksLocation.getSensorDataSet();
|
||||
sensorDataSet = sensorDataSet.toBuilder()
|
||||
.setHeartRate(heartRateData)
|
||||
.setCadence(cadenceData)
|
||||
.setPower(powerData)
|
||||
.build();
|
||||
.setHeartRate(heartRateData).setCadence(cadenceData).setPower(powerData).build();
|
||||
myTracksLocation.setSensorDataSet(sensorDataSet);
|
||||
// Test.
|
||||
point = fillDataPointTestHelper(myTracksLocation);
|
||||
@@ -117,8 +111,8 @@ public class ChartFragmentTest extends AndroidTestCase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the logic to get the value of metric Distance in
|
||||
* {@link ChartFragment#fillDataPoint(Location, double[])}.
|
||||
* Tests the logic to get the value of metric Distance in {@link ChartFragment#fillDataPoint(Location,
|
||||
* double[], android.content.Context)}.
|
||||
*/
|
||||
public void testFillDataPoint_distanceMetric() {
|
||||
// By distance.
|
||||
@@ -158,8 +152,8 @@ public class ChartFragmentTest extends AndroidTestCase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the logic to get the value of imperial Distance in
|
||||
* {@link ChartFragment#fillDataPoint(Location, double[])}.
|
||||
* Tests the logic to get the value of imperial Distance in {@link ChartFragment#fillDataPoint(Location,
|
||||
* double[], android.content.Context)}.
|
||||
*/
|
||||
public void testFillDataPoint_distanceImperial() {
|
||||
// By distance.
|
||||
@@ -203,8 +197,8 @@ public class ChartFragmentTest extends AndroidTestCase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the logic to get the values of time in
|
||||
* {@link ChartFragment#fillDataPoint(Location, double[])}.
|
||||
* Tests the logic to get the values of time in {@link ChartFragment#fillDataPoint(Location,
|
||||
* double[], android.content.Context)}.
|
||||
*/
|
||||
public void testFillDataPoint_time() {
|
||||
// By time
|
||||
@@ -220,9 +214,8 @@ public class ChartFragmentTest extends AndroidTestCase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the logic to get the value of elevation in
|
||||
* {@link ChartFragment#fillDataPoint(Location, double[])} by one and two
|
||||
* points.
|
||||
* Tests the logic to get the value of elevation in {@link ChartFragment#fillDataPoint(Location,
|
||||
* double[], android.content.Context)} by one and two points.
|
||||
*/
|
||||
public void testFillDataPoint_elevation() {
|
||||
MyTracksLocation myTracksLocation1 = TrackStubUtils.createMyTracksLocation();
|
||||
@@ -246,10 +239,10 @@ public class ChartFragmentTest extends AndroidTestCase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the logic to get the value of speed in
|
||||
* {@link ChartFragment#fillDataPoint(Location, double[])}. In this test,
|
||||
* firstly remove all points in memory, and then fill in two points one by
|
||||
* one. The speed values of these points are 129, 130.
|
||||
* Tests the logic to get the value of speed in {@link ChartFragment#fillDataPoint(Location,
|
||||
* double[], android.content.Context)}. In this test, firstly remove all
|
||||
* points in memory, and then fill in two points one by one. The speed values
|
||||
* of these points are 129, 130.
|
||||
*/
|
||||
public void testFillDataPoint_speed() {
|
||||
/*
|
||||
@@ -293,12 +286,9 @@ public class ChartFragmentTest extends AndroidTestCase {
|
||||
MyTracksLocation myTracksLocation2 = TrackStubUtils.createMyTracksLocation();
|
||||
|
||||
/*
|
||||
* Add a time span here to make sure the second point is valid and the speed is valid.
|
||||
*
|
||||
* Speed is valid if:
|
||||
* speedDifference > Constants.MAX_ACCELERATION * timeDifference
|
||||
* speedDifference = 102 -100
|
||||
* timeDifference = 222
|
||||
* Add a time span here to make sure the second point is valid and the speed
|
||||
* is valid. Speed is valid if: speedDifference > Constants.MAX_ACCELERATION
|
||||
* * timeDifference speedDifference = 102 -100 timeDifference = 222
|
||||
*/
|
||||
myTracksLocation2.setTime(myTracksLocation2.getTime() + 222);
|
||||
myTracksLocation2.setSpeed(102);
|
||||
@@ -323,12 +313,9 @@ public class ChartFragmentTest extends AndroidTestCase {
|
||||
MyTracksLocation myTracksLocation2 = TrackStubUtils.createMyTracksLocation();
|
||||
|
||||
/*
|
||||
* Add a time span here to make sure the second point is valid and the speed is valid.
|
||||
*
|
||||
* Speed is valid if:
|
||||
* speedDifference > Constants.MAX_ACCELERATION * timeDifference
|
||||
* speedDifference = 102 -100
|
||||
* timeDifference = 222
|
||||
* Add a time span here to make sure the second point is valid and the speed
|
||||
* is valid. Speed is valid if: speedDifference > Constants.MAX_ACCELERATION
|
||||
* * timeDifference speedDifference = 102 -100 timeDifference = 222
|
||||
*/
|
||||
myTracksLocation2.setTime(myTracksLocation2.getTime() + 222);
|
||||
myTracksLocation2.setSpeed(102);
|
||||
|
||||
Reference in New Issue
Block a user