Review fixes.

This commit is contained in:
Vladimir Byko-Ianko 2016-09-12 18:03:43 +03:00
parent 9c37891c0a
commit 38969d8130
2 changed files with 6 additions and 5 deletions

View file

@ -169,7 +169,8 @@ bool GenerateYAxisChartData(uint32_t height, double minMetersPerPxl,
double const freeHeightSpacePxl = drawHeightPxl - deltaAltM / metersPerPxl;
if (freeHeightSpacePxl < 0 || freeHeightSpacePxl > drawHeightPxl)
{
LOG(LERROR, ("freeHeightSpacePxl is out of the range [0, drawHeightPxl]."));
LOG(LERROR, ("Number of pixels free of chart points (", freeHeightSpacePxl,
") is below zero or greater number of pixels for the chart (", drawHeightPxl, ")."));
return false;
}

View file

@ -104,8 +104,8 @@ UNIT_TEST(GenerateYAxisChartData_SmokeTest)
vector<double> yAxisDataPxl;
TEST(maps::GenerateYAxisChartData(30 /* height */, 1.0 /* minMetersPerPxl */, altitudeDataM, yAxisDataPxl), ());
vector<double> expecttedYAxisDataPxl = {15.0, 15.0};
TEST(AlmostEqualAbs(yAxisDataPxl, expecttedYAxisDataPxl), ());
vector<double> expectedYAxisDataPxl = {15.0, 15.0};
TEST(AlmostEqualAbs(yAxisDataPxl, expectedYAxisDataPxl), ());
}
UNIT_TEST(GenerateYAxisChartData_EmptyAltitudeDataTest)
@ -123,8 +123,8 @@ UNIT_TEST(GenerateYAxisChartData_Test)
vector<double> yAxisDataPxl;
TEST(maps::GenerateYAxisChartData(100 /* height */, 1.0 /* minMetersPerPxl */, altitudeDataM, yAxisDataPxl), ());
vector<double> expecttedYAxisDataPxl = {50.0, 48.0, 50.0, 52.0, 49.0};
TEST(AlmostEqualAbs(yAxisDataPxl, expecttedYAxisDataPxl), ());
vector<double> expectedYAxisDataPxl = {50.0, 48.0, 50.0, 52.0, 49.0};
TEST(AlmostEqualAbs(yAxisDataPxl, expectedYAxisDataPxl), ());
}
UNIT_TEST(GenerateChartByPoints_NoGeometryTest)