diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2016-09-13 15:48:02 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2016-09-14 11:21:41 +0300 |
commit | 0a3f1e9563bb2cc72940fc2f0f69385ef0194d8a (patch) | |
tree | 0183b3ab2659b9800d1253cb64d3feb17362297f /map | |
parent | 7c5e9684863d09236154ea6a7d067e5648d72732 (diff) |
Tests on ScaleChartData, ReflectChartData, ShiftChartData.
Diffstat (limited to 'map')
-rw-r--r-- | map/map_tests/chart_generator_tests.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
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<uint8_t> const & frameB expectedR, expectedG, expectedB, expectedA), ()); } +UNIT_TEST(ScaleChartData_Test) +{ + vector<double> chartData = {0.0, -1.0, 2.0}; + maps::ScaleChartData(chartData, 2.0 /* scale */); + vector<double> const expectedChartData = {0.0, -2.0, 4.0}; + TEST_EQUAL(chartData, expectedChartData, ()); +} + +UNIT_TEST(ShiftChartData_Test) +{ + vector<double> chartData = {0.0, -1.0, 2.0}; + maps::ShiftChartData(chartData, 1 /* shift */); + vector<double> const expectedChartData = {1.0, 0.0, 3.0}; + TEST_EQUAL(chartData, expectedChartData, ()); +} + +UNIT_TEST(ReflectChartData_Test) +{ + vector<double> chartData = {0.0, -1.0, 2.0}; + maps::ReflectChartData(chartData); + vector<double> const expectedChartData = {0.0, 1.0, -2.0}; + TEST_EQUAL(chartData, expectedChartData, ()); +} + UNIT_TEST(NormalizeChartData_SmokeTest) { vector<double> const distanceDataM = {0.0, 0.0, 0.0}; |