Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/map
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-09-13 15:48:02 +0300
committerVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-09-14 11:21:41 +0300
commit0a3f1e9563bb2cc72940fc2f0f69385ef0194d8a (patch)
tree0183b3ab2659b9800d1253cb64d3feb17362297f /map
parent7c5e9684863d09236154ea6a7d067e5648d72732 (diff)
Tests on ScaleChartData, ReflectChartData, ShiftChartData.
Diffstat (limited to 'map')
-rw-r--r--map/map_tests/chart_generator_tests.cpp24
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};