diff options
author | Yuri Gorshenin <y@maps.me> | 2015-08-26 15:06:24 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:02:29 +0300 |
commit | 1fbe5b18ad9ae00031d202173a7c6e2a4b6b4fb5 (patch) | |
tree | e4e6146680886b5b1891a0b2af9cdfe6bdf41361 /routing | |
parent | 318d412f6ad37dfa456220877c50a8982ee8eff4 (diff) |
[routing] Fixes to TTS tests.
Diffstat (limited to 'routing')
-rw-r--r-- | routing/routing_tests/turns_tts_text_tests.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/routing/routing_tests/turns_tts_text_tests.cpp b/routing/routing_tests/turns_tts_text_tests.cpp index b2bba62050..6d3749e390 100644 --- a/routing/routing_tests/turns_tts_text_tests.cpp +++ b/routing/routing_tests/turns_tts_text_tests.cpp @@ -3,14 +3,19 @@ #include "routing/turns_sound_settings.hpp" #include "routing/turns_tts_text.hpp" +#include "std/cstring.hpp" #include "std/string.hpp" - namespace { using namespace routing::turns; using namespace routing::turns::sound; +bool pairDistEquals(PairDist const & lhs, PairDist const & rhs) +{ + return lhs.first == rhs.first && strcmp(lhs.second, rhs.second) == 0; +} + UNIT_TEST(GetDistanceTextIdMetersTest) { // Notification(uint32_t distanceUnits, uint8_t exitNum, bool useThenInsteadOfDistance, @@ -105,11 +110,11 @@ UNIT_TEST(GetAllSoundedDistMetersTest) TEST_EQUAL(allSoundedDistMeters.size(), 17, ()); PairDist const expected1 = {50, "in_50_meters"}; - TEST_EQUAL(allSoundedDistMeters[0], expected1, ()); + TEST(pairDistEquals(allSoundedDistMeters[0], expected1), (allSoundedDistMeters[0], expected1)); PairDist const expected2 = {700, "in_700_meters"}; - TEST_EQUAL(allSoundedDistMeters[8], expected2, ()); + TEST(pairDistEquals(allSoundedDistMeters[8], expected2), (allSoundedDistMeters[8], expected2)); PairDist const expected3 = {3000, "in_3_kilometers"}; - TEST_EQUAL(allSoundedDistMeters[16], expected3, ()); + TEST(pairDistEquals(allSoundedDistMeters[16], expected3), (allSoundedDistMeters[16], expected3)); } UNIT_TEST(GetAllSoundedDistFeet) @@ -124,11 +129,11 @@ UNIT_TEST(GetAllSoundedDistFeet) TEST_EQUAL(allSoundedDistFeet.size(), 22, ()); PairDist const expected1 = {50, "in_50_feet"}; - TEST_EQUAL(allSoundedDistFeet[0], expected1, ()); + TEST(pairDistEquals(allSoundedDistFeet[0], expected1), (allSoundedDistFeet[0], expected1)); PairDist const expected2 = {700, "in_700_feet"}; - TEST_EQUAL(allSoundedDistFeet[7], expected2, ()); + TEST(pairDistEquals(allSoundedDistFeet[7], expected2), (allSoundedDistFeet[7], expected2)); PairDist const expected3 = {10560, "in_2_miles"}; - TEST_EQUAL(allSoundedDistFeet[21], expected3, ()); + TEST(pairDistEquals(allSoundedDistFeet[21], expected3), (allSoundedDistFeet[21], expected3)); } UNIT_TEST(GetSoundedDistMeters) |