diff options
author | Yuri Gorshenin <y@maps.me> | 2016-02-04 15:51:55 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:16:47 +0300 |
commit | c3a06efed8ed03589875fe97e53586224ac60b82 (patch) | |
tree | 553777296fa7632a3d3c79baf716e4eb2e84d223 /search/search_tests_support | |
parent | 3addecf184054ef5d08a2468bd34805a64193ceb (diff) |
[search] Implemented search by name.
Diffstat (limited to 'search/search_tests_support')
-rw-r--r-- | search/search_tests_support/test_feature.cpp | 26 | ||||
-rw-r--r-- | search/search_tests_support/test_feature.hpp | 13 | ||||
-rw-r--r-- | search/search_tests_support/test_search_engine.hpp | 2 |
3 files changed, 41 insertions, 0 deletions
diff --git a/search/search_tests_support/test_feature.cpp b/search/search_tests_support/test_feature.cpp index 6dfef94818..d6e77a820e 100644 --- a/search/search_tests_support/test_feature.cpp +++ b/search/search_tests_support/test_feature.cpp @@ -214,6 +214,32 @@ string TestBuilding::ToString() const return os.str(); } +// TestPark ---------------------------------------------------------------------------------------- +TestPark::TestPark(vector<m2::PointD> const & boundary, string const & name, string const & lang) + : TestFeature(name, lang), m_boundary(boundary) +{ +} + +void TestPark::Serialize(FeatureBuilder1 & fb) const +{ + TestFeature::Serialize(fb); + for (auto const & point : m_boundary) + fb.AddPoint(point); + fb.SetArea(); + + auto const & classificator = classif(); + fb.SetType(classificator.GetTypeByPath({"leisure", "park"})); + + fb.PreSerialize(); +} + +string TestPark::ToString() const +{ + ostringstream os; + os << "TestPark [" << m_name << ", " << m_lang << "]"; + return os.str(); +} + string DebugPrint(TestFeature const & feature) { return feature.ToString(); } } // namespace tests_support } // namespace search diff --git a/search/search_tests_support/test_feature.hpp b/search/search_tests_support/test_feature.hpp index a3e14c8823..9932d1d1b8 100644 --- a/search/search_tests_support/test_feature.hpp +++ b/search/search_tests_support/test_feature.hpp @@ -113,6 +113,19 @@ protected: string const m_streetName; }; +class TestPark : public TestFeature +{ +public: + TestPark(vector<m2::PointD> const & boundary, string const & name, string const & lang); + + // TestFeature overrides: + void Serialize(FeatureBuilder1 & fb) const override; + string ToString() const override; + +private: + vector<m2::PointD> m_boundary; +}; + string DebugPrint(TestFeature const & feature); } // namespace tests_support } // namespace search diff --git a/search/search_tests_support/test_search_engine.hpp b/search/search_tests_support/test_search_engine.hpp index 5c2aad7179..8c6b5f9e1e 100644 --- a/search/search_tests_support/test_search_engine.hpp +++ b/search/search_tests_support/test_search_engine.hpp @@ -36,6 +36,8 @@ public: weak_ptr<search::QueryHandle> Search(search::SearchParams const & params, m2::RectD const & viewport); + storage::CountryInfoGetter & GetCountryInfoGetter() { return *m_infoGetter; } + private: Platform & m_platform; unique_ptr<storage::CountryInfoGetter> m_infoGetter; |