From 0a3f1e9563bb2cc72940fc2f0f69385ef0194d8a Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Tue, 13 Sep 2016 15:48:02 +0300 Subject: [PATCH] Tests on ScaleChartData, ReflectChartData, ShiftChartData. --- map/map_tests/chart_generator_tests.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/map/map_tests/chart_generator_tests.cpp b/map/map_tests/chart_generator_tests.cpp index 4d43d59279..3ca39d4aa1 100644 --- a/map/map_tests/chart_generator_tests.cpp +++ b/map/map_tests/chart_generator_tests.cpp @@ -47,6 +47,30 @@ void TestAngleColors(size_t width, size_t height, vector const & frameB expectedR, expectedG, expectedB, expectedA), ()); } +UNIT_TEST(ScaleChartData_Test) +{ + vector chartData = {0.0, -1.0, 2.0}; + maps::ScaleChartData(chartData, 2.0 /* scale */); + vector const expectedChartData = {0.0, -2.0, 4.0}; + TEST_EQUAL(chartData, expectedChartData, ()); +} + +UNIT_TEST(ShiftChartData_Test) +{ + vector chartData = {0.0, -1.0, 2.0}; + maps::ShiftChartData(chartData, 1 /* shift */); + vector const expectedChartData = {1.0, 0.0, 3.0}; + TEST_EQUAL(chartData, expectedChartData, ()); +} + +UNIT_TEST(ReflectChartData_Test) +{ + vector chartData = {0.0, -1.0, 2.0}; + maps::ReflectChartData(chartData); + vector const expectedChartData = {0.0, 1.0, -2.0}; + TEST_EQUAL(chartData, expectedChartData, ()); +} + UNIT_TEST(NormalizeChartData_SmokeTest) { vector const distanceDataM = {0.0, 0.0, 0.0};