From e3f32204b9fb861d09439212b411f79954cf3168 Mon Sep 17 00:00:00 2001 From: vng Date: Tue, 15 Mar 2016 20:16:20 +0300 Subject: [PATCH] [tests] Added additional logging. --- map/map_tests/address_tests.cpp | 4 ++-- search/reverse_geocoder.cpp | 10 ++++++++++ search/reverse_geocoder.hpp | 4 ++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/map/map_tests/address_tests.cpp b/map/map_tests/address_tests.cpp index 7160fecff1..6c8c651afd 100644 --- a/map/map_tests/address_tests.cpp +++ b/map/map_tests/address_tests.cpp @@ -22,8 +22,8 @@ void TestAddress(ReverseGeocoder & coder, ms::LatLon const & ll, string key; GetStreetNameAsKey(addr.m_street.m_name, key); - TEST_EQUAL(stName, key, ()); - TEST_EQUAL(hNumber, addr.m_building.m_name, ()); + TEST_EQUAL(stName, key, (addr)); + TEST_EQUAL(hNumber, addr.m_building.m_name, (addr)); } } // namespace diff --git a/search/reverse_geocoder.cpp b/search/reverse_geocoder.cpp index 02a079c450..560af85d07 100644 --- a/search/reverse_geocoder.cpp +++ b/search/reverse_geocoder.cpp @@ -207,4 +207,14 @@ bool ReverseGeocoder::HouseTable::Get(FeatureID const & fid, uint32_t & streetIn return m_table->Get(fid.m_index, streetIndex); } +string DebugPrint(ReverseGeocoder::Object const & obj) +{ + return obj.m_name; +} + +string DebugPrint(ReverseGeocoder::Address const & addr) +{ + return "{ " + DebugPrint(addr.m_building) + ", " + DebugPrint(addr.m_street) + " }"; +} + } // namespace search diff --git a/search/reverse_geocoder.hpp b/search/reverse_geocoder.hpp index 2eb4c21f38..0a4ea1f273 100644 --- a/search/reverse_geocoder.hpp +++ b/search/reverse_geocoder.hpp @@ -34,6 +34,8 @@ class ReverseGeocoder inline bool IsValid() const { return m_id.IsValid(); } }; + friend string DebugPrint(Object const & obj); + public: /// All "Nearby" functions work in this lookup radius. static int constexpr kLookupRadiusM = 500; @@ -68,6 +70,8 @@ public: double GetDistance() const { return m_building.m_distanceMeters; } }; + friend string DebugPrint(Address const & addr); + /// @return Sorted by distance streets vector for the specified MwmId. //@{ void GetNearbyStreets(MwmSet::MwmId const & id, m2::PointD const & center,