From 38969d813074d8e67482b80071276db65c03dad6 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Mon, 12 Sep 2016 18:03:43 +0300 Subject: [PATCH] Review fixes. --- map/chart_generator.cpp | 3 ++- map/map_tests/chart_generator_tests.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/map/chart_generator.cpp b/map/chart_generator.cpp index 30442a22e8..0804840e09 100644 --- a/map/chart_generator.cpp +++ b/map/chart_generator.cpp @@ -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; } diff --git a/map/map_tests/chart_generator_tests.cpp b/map/map_tests/chart_generator_tests.cpp index 4fa1bc2e7c..4d43d59279 100644 --- a/map/map_tests/chart_generator_tests.cpp +++ b/map/map_tests/chart_generator_tests.cpp @@ -104,8 +104,8 @@ UNIT_TEST(GenerateYAxisChartData_SmokeTest) vector yAxisDataPxl; TEST(maps::GenerateYAxisChartData(30 /* height */, 1.0 /* minMetersPerPxl */, altitudeDataM, yAxisDataPxl), ()); - vector expecttedYAxisDataPxl = {15.0, 15.0}; - TEST(AlmostEqualAbs(yAxisDataPxl, expecttedYAxisDataPxl), ()); + vector expectedYAxisDataPxl = {15.0, 15.0}; + TEST(AlmostEqualAbs(yAxisDataPxl, expectedYAxisDataPxl), ()); } UNIT_TEST(GenerateYAxisChartData_EmptyAltitudeDataTest) @@ -123,8 +123,8 @@ UNIT_TEST(GenerateYAxisChartData_Test) vector yAxisDataPxl; TEST(maps::GenerateYAxisChartData(100 /* height */, 1.0 /* minMetersPerPxl */, altitudeDataM, yAxisDataPxl), ()); - vector expecttedYAxisDataPxl = {50.0, 48.0, 50.0, 52.0, 49.0}; - TEST(AlmostEqualAbs(yAxisDataPxl, expecttedYAxisDataPxl), ()); + vector expectedYAxisDataPxl = {50.0, 48.0, 50.0, 52.0, 49.0}; + TEST(AlmostEqualAbs(yAxisDataPxl, expectedYAxisDataPxl), ()); } UNIT_TEST(GenerateChartByPoints_NoGeometryTest)