diff options
author | Ilya Grechuhin <i.grechuhin@gmail.com> | 2016-07-06 13:49:16 +0300 |
---|---|---|
committer | Ilya Grechuhin <i.grechuhin@gmail.com> | 2016-07-07 14:23:14 +0300 |
commit | f7aafa00e27d85f4d0f2b4c504d9063d392b41f8 (patch) | |
tree | 42a642688dfef0e8dea4d9fc8ebacd185dc75993 /routing/routing_tests/turns_tts_text_tests.cpp | |
parent | aae90b0081d9b38fe2d0d58ee63445a8e58f6462 (diff) |
[omim] Refactored measurement_utils.
Diffstat (limited to 'routing/routing_tests/turns_tts_text_tests.cpp')
-rw-r--r-- | routing/routing_tests/turns_tts_text_tests.cpp | 71 |
1 files changed, 47 insertions, 24 deletions
diff --git a/routing/routing_tests/turns_tts_text_tests.cpp b/routing/routing_tests/turns_tts_text_tests.cpp index a2fbb7d113..dc2d968d6d 100644 --- a/routing/routing_tests/turns_tts_text_tests.cpp +++ b/routing/routing_tests/turns_tts_text_tests.cpp @@ -20,13 +20,17 @@ UNIT_TEST(GetDistanceTextIdMetersTest) { // Notification(uint32_t distanceUnits, uint8_t exitNum, bool useThenInsteadOfDistance, // TurnDirection turnDir, ::Settings::Units lengthUnits) - Notification const notification1(500, 0, false, TurnDirection::TurnRight, ::settings::Metric); + Notification const notification1(500, 0, false, TurnDirection::TurnRight, + measurement_utils::Units::Metric); TEST_EQUAL(GetDistanceTextId(notification1), "in_500_meters", ()); - Notification const notification2(500, 0, true, TurnDirection::TurnRight, ::settings::Metric); + Notification const notification2(500, 0, true, TurnDirection::TurnRight, + measurement_utils::Units::Metric); TEST_EQUAL(GetDistanceTextId(notification2), "then", ()); - Notification const notification3(200, 0, false, TurnDirection::TurnRight, ::settings::Metric); + Notification const notification3(200, 0, false, TurnDirection::TurnRight, + measurement_utils::Units::Metric); TEST_EQUAL(GetDistanceTextId(notification3), "in_200_meters", ()); - Notification const notification4(2000, 0, false, TurnDirection::TurnRight, ::settings::Metric); + Notification const notification4(2000, 0, false, TurnDirection::TurnRight, + measurement_utils::Units::Metric); TEST_EQUAL(GetDistanceTextId(notification4), "in_2_kilometers", ()); } @@ -34,13 +38,17 @@ UNIT_TEST(GetDistanceTextIdFeetTest) { // Notification(uint32_t distanceUnits, uint8_t exitNum, bool useThenInsteadOfDistance, // TurnDirection turnDir, ::Settings::Units lengthUnits) - Notification const notification1(500, 0, false, TurnDirection::TurnRight, ::settings::Foot); + Notification const notification1(500, 0, false, TurnDirection::TurnRight, + measurement_utils::Units::Imperial); TEST_EQUAL(GetDistanceTextId(notification1), "in_500_feet", ()); - Notification const notification2(500, 0, true, TurnDirection::TurnRight, ::settings::Foot); + Notification const notification2(500, 0, true, TurnDirection::TurnRight, + measurement_utils::Units::Imperial); TEST_EQUAL(GetDistanceTextId(notification2), "then", ()); - Notification const notification3(800, 0, false, TurnDirection::TurnRight, ::settings::Foot); + Notification const notification3(800, 0, false, TurnDirection::TurnRight, + measurement_utils::Units::Imperial); TEST_EQUAL(GetDistanceTextId(notification3), "in_800_feet", ()); - Notification const notification4(5000, 0, false, TurnDirection::TurnRight, ::settings::Foot); + Notification const notification4(5000, 0, false, TurnDirection::TurnRight, + measurement_utils::Units::Imperial); TEST_EQUAL(GetDistanceTextId(notification4), "in_5000_feet", ()); } @@ -48,13 +56,17 @@ UNIT_TEST(GetRoundaboutTextIdTest) { // Notification(uint32_t distanceUnits, uint8_t exitNum, bool useThenInsteadOfDistance, // TurnDirection turnDir, ::Settings::Units lengthUnits) - Notification const notification1(500, 0, false, TurnDirection::LeaveRoundAbout, ::settings::Foot); + Notification const notification1(500, 0, false, TurnDirection::LeaveRoundAbout, + measurement_utils::Units::Imperial); TEST_EQUAL(GetRoundaboutTextId(notification1), "leave_the_roundabout", ()); - Notification const notification2(0, 3, true, TurnDirection::LeaveRoundAbout, ::settings::Foot); + Notification const notification2(0, 3, true, TurnDirection::LeaveRoundAbout, + measurement_utils::Units::Imperial); TEST_EQUAL(GetRoundaboutTextId(notification2), "take_the_3_exit", ()); - Notification const notification3(0, 7, true, TurnDirection::LeaveRoundAbout, ::settings::Metric); + Notification const notification3(0, 7, true, TurnDirection::LeaveRoundAbout, + measurement_utils::Units::Metric); TEST_EQUAL(GetRoundaboutTextId(notification3), "take_the_7_exit", ()); - Notification const notification4(0, 15, true, TurnDirection::LeaveRoundAbout, ::settings::Metric); + Notification const notification4(0, 15, true, TurnDirection::LeaveRoundAbout, + measurement_utils::Units::Metric); TEST_EQUAL(GetRoundaboutTextId(notification4), "leave_the_roundabout", ()); } @@ -62,11 +74,14 @@ UNIT_TEST(GetYouArriveTextIdTest) { // Notification(uint32_t distanceUnits, uint8_t exitNum, bool useThenInsteadOfDistance, // TurnDirection turnDir, ::Settings::Units lengthUnits) - Notification const notification1(500, 0, false, TurnDirection::ReachedYourDestination, ::settings::Foot); + Notification const notification1(500, 0, false, TurnDirection::ReachedYourDestination, + measurement_utils::Units::Imperial); TEST_EQUAL(GetYouArriveTextId(notification1), "destination", ()); - Notification const notification2(0, 0, false, TurnDirection::ReachedYourDestination, ::settings::Metric); + Notification const notification2(0, 0, false, TurnDirection::ReachedYourDestination, + measurement_utils::Units::Metric); TEST_EQUAL(GetYouArriveTextId(notification2), "you_have_reached_the_destination", ()); - Notification const notification3(0, 0, true, TurnDirection::ReachedYourDestination, ::settings::Metric); + Notification const notification3(0, 0, true, TurnDirection::ReachedYourDestination, + measurement_utils::Units::Metric); TEST_EQUAL(GetYouArriveTextId(notification3), "destination", ()); } @@ -74,15 +89,20 @@ UNIT_TEST(GetDirectionTextIdTest) { // Notification(uint32_t distanceUnits, uint8_t exitNum, bool useThenInsteadOfDistance, // TurnDirection turnDir, ::Settings::Units lengthUnits) - Notification const notification1(500, 0, false, TurnDirection::TurnRight, ::settings::Foot); + Notification const notification1(500, 0, false, TurnDirection::TurnRight, + measurement_utils::Units::Imperial); TEST_EQUAL(GetDirectionTextId(notification1), "make_a_right_turn", ()); - Notification const notification2(1000, 0, false, TurnDirection::GoStraight, ::settings::Metric); + Notification const notification2(1000, 0, false, TurnDirection::GoStraight, + measurement_utils::Units::Metric); TEST_EQUAL(GetDirectionTextId(notification2), "go_straight", ()); - Notification const notification3(700, 0, false, TurnDirection::UTurnLeft, ::settings::Metric); + Notification const notification3(700, 0, false, TurnDirection::UTurnLeft, + measurement_utils::Units::Metric); TEST_EQUAL(GetDirectionTextId(notification3), "make_a_u_turn", ()); - Notification const notification4(200, 0, false, TurnDirection::ReachedYourDestination, ::settings::Metric); + Notification const notification4(200, 0, false, TurnDirection::ReachedYourDestination, + measurement_utils::Units::Metric); TEST_EQUAL(GetDirectionTextId(notification4), "destination", ()); - Notification const notification5(0, 0, false, TurnDirection::ReachedYourDestination, ::settings::Metric); + Notification const notification5(0, 0, false, TurnDirection::ReachedYourDestination, + measurement_utils::Units::Metric); TEST_EQUAL(GetDirectionTextId(notification5), "you_have_reached_the_destination", ()); } @@ -113,11 +133,14 @@ UNIT_TEST(GetTtsTextTest) GetTtsText getTtsText; // Notification(uint32_t distanceUnits, uint8_t exitNum, bool useThenInsteadOfDistance, // TurnDirection turnDir, Settings::Units lengthUnits) - Notification const notification1(500, 0, false, TurnDirection::TurnRight, ::settings::Metric); - Notification const notification2(300, 0, false, TurnDirection::TurnLeft, ::settings::Metric); + Notification const notification1(500, 0, false, TurnDirection::TurnRight, + measurement_utils::Units::Metric); + Notification const notification2(300, 0, false, TurnDirection::TurnLeft, + measurement_utils::Units::Metric); Notification const notification3(0, 0, false, TurnDirection::ReachedYourDestination, - ::settings::Metric); - Notification const notification4(0, 0, true, TurnDirection::TurnLeft, ::settings::Metric); + measurement_utils::Units::Metric); + Notification const notification4(0, 0, true, TurnDirection::TurnLeft, + measurement_utils::Units::Metric); getTtsText.ForTestingSetLocaleWithJson(engShortJson, "en"); TEST_EQUAL(getTtsText(notification1), "In 500 meters. Make a right turn.", ()); |