Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Gorbushin <m.gorbushin@corp.mail.ru>2019-09-16 19:43:29 +0300
committerTatiana Yan <tatiana.kondakova@gmail.com>2019-09-17 15:41:49 +0300
commit2d7d44fcd79cf21501f0f30b10e49c60a9e7274d (patch)
treee82dc55661c0f38ffb89d4c7d4e30af1a21081db
parent90a16ae27d2cf88964c72d9ad1c86a28bb68b4d1 (diff)
[generator] Small refact of tests support
-rw-r--r--generator/generator_tests/common.cpp48
1 files changed, 0 insertions, 48 deletions
diff --git a/generator/generator_tests/common.cpp b/generator/generator_tests/common.cpp
index 13b2a465c4..ad9d7521fa 100644
--- a/generator/generator_tests/common.cpp
+++ b/generator/generator_tests/common.cpp
@@ -1,7 +1,6 @@
#include "generator/generator_tests/common.hpp"
#include "generator/borders.hpp"
-#include "generator/osm2type.hpp"
#include "indexer/classificator.hpp"
@@ -10,10 +9,6 @@
#include "base/file_name_utils.hpp"
#include "base/string_utils.hpp"
-#include <fstream>
-
-#include "defines.hpp"
-
namespace generator_tests
{
OsmElement MakeOsmElement(uint64_t id, Tags const & tags, OsmElement::EntityType t)
@@ -46,47 +41,4 @@ bool MakeFakeBordersFile(std::string const & intemediatePath, std::string const
borders::DumpBorderToPolyFile(borderPath, filename, {m2::RegionD{points}});
return true;
}
-
-OsmElement MakeOsmElement(OsmElementData const & elementData)
-{
- OsmElement el;
- el.m_id = elementData.m_id;
- el.m_type = elementData.m_polygon.size() > 1 ? OsmElement::EntityType::Relation
- : OsmElement::EntityType::Node;
- for (auto const & tag : elementData.m_tags)
- el.AddTag(tag.m_key, tag.m_value);
- el.m_members = elementData.m_members;
-
- return el;
-}
-
-feature::FeatureBuilder FeatureBuilderFromOmsElementData(OsmElementData const & elementData)
-{
- auto el = MakeOsmElement(elementData);
- feature::FeatureBuilder fb;
- CHECK(elementData.m_polygon.size() == 1 || elementData.m_polygon.size() == 2, ());
- if (elementData.m_polygon.size() == 1)
- {
- fb.SetCenter(elementData.m_polygon[0]);
- }
- else if (elementData.m_polygon.size() == 2)
- {
- auto const & p1 = elementData.m_polygon[0];
- auto const & p2 = elementData.m_polygon[1];
- vector<m2::PointD> poly = {
- {p1.x, p1.y}, {p1.x, p2.y}, {p2.x, p2.y}, {p2.x, p1.y}, {p1.x, p1.y}};
- fb.AddPolygon(poly);
- fb.SetHoles({});
- fb.SetArea();
- }
-
- auto osmId = el.m_type == OsmElement::EntityType::Relation ? base::MakeOsmRelation(el.m_id)
- : base::MakeOsmNode(el.m_id);
- fb.SetOsmId(osmId);
-
- ftype::GetNameAndType(&el, fb.GetParams(),
- [](uint32_t type) { return classif().IsTypeValid(type); });
- return fb;
-}
-
} // namespace generator_tests