From a94ff813164efee04d765be09a190aedb67fb735 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Wed, 30 Sep 2015 15:46:51 +0300 Subject: [PATCH] Fixing routing unit tests. --- routing/routing_tests/turns_sound_test.cpp | 3 +++ routing/turns_sound.hpp | 2 ++ routing/turns_sound_settings.hpp | 2 ++ 3 files changed, 7 insertions(+) diff --git a/routing/routing_tests/turns_sound_test.cpp b/routing/routing_tests/turns_sound_test.cpp index 21add086c7..05e6c0cfa6 100644 --- a/routing/routing_tests/turns_sound_test.cpp +++ b/routing/routing_tests/turns_sound_test.cpp @@ -97,6 +97,7 @@ UNIT_TEST(TurnsSoundMetersTest) \"make_a_right_turn\":\"Make a right turn.\"\ }"; turnSound.SetLocaleWithJson(engShortJson); + turnSound.SetNotificationTimeSecond(20); turnSound.Reset(); turnSound.SetSpeedMetersPerSecond(30.); @@ -179,6 +180,7 @@ UNIT_TEST(TurnsSoundMetersTwoTurnsTest) \"enter_the_roundabout\":\"Enter the roundabout.\"\ }"; turnSound.SetLocaleWithJson(engShortJson); + turnSound.SetNotificationTimeSecond(20); turnSound.Reset(); turnSound.SetSpeedMetersPerSecond(35.); @@ -242,6 +244,7 @@ UNIT_TEST(TurnsSoundFeetTest) \"enter_the_roundabout\":\"Enter the roundabout.\"\ }"; turnSound.SetLocaleWithJson(engShortJson); + turnSound.SetNotificationTimeSecond(20); turnSound.Reset(); turnSound.SetSpeedMetersPerSecond(30.); diff --git a/routing/turns_sound.hpp b/routing/turns_sound.hpp index 86ddb1e248..a20359b573 100644 --- a/routing/turns_sound.hpp +++ b/routing/turns_sound.hpp @@ -71,6 +71,8 @@ public: inline string GetLocale() const { return m_getTtsText.GetLocale(); } /// SetLocaleWithJson is used for writing unit tests only. void SetLocaleWithJson(string const & jsonBuffer) { m_getTtsText.SetLocaleWithJson(jsonBuffer); } + /// SetNotificationTimeSecond is used for writing unit tests only. + void SetNotificationTimeSecond(uint32_t time) { m_settings.SetNotificationTimeSecond(time); } void SetSpeedMetersPerSecond(double speed); /// \brief GenerateTurnSound updates information about the next turn notification. diff --git a/routing/turns_sound_settings.hpp b/routing/turns_sound_settings.hpp index 42df7c6ff5..904d4effe1 100644 --- a/routing/turns_sound_settings.hpp +++ b/routing/turns_sound_settings.hpp @@ -72,6 +72,8 @@ public: inline void SetLengthUnits(LengthUnits units) { m_lengthUnits = units; } double ConvertMetersPerSecondToUnitsPerSecond(double speedInMetersPerSecond) const; double ConvertUnitsToMeters(double distanceInUnits) const; + /// SetNotificationTimeSecond is used for writing unit tests only. + void SetNotificationTimeSecond(uint32_t time) { m_timeSeconds = time; } }; /// \brief The Notification struct contains all the information about the next sound