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:
authorYuri Gorshenin <y@maps.me>2016-08-22 13:47:56 +0300
committerYuri Gorshenin <y@maps.me>2016-08-26 16:21:13 +0300
commitafc3d20264e8fcd99dc3cd465ce1770d0b3246d0 (patch)
tree67d2bcd855340555d742181e467cc987bd70a332 /indexer/indexer_tests
parent336c137d59c12d0de9fd292bcf3db9b453670567 (diff)
[search] Added matching of edited features by type.
Diffstat (limited to 'indexer/indexer_tests')
-rw-r--r--indexer/indexer_tests/indexer_tests.pro8
-rw-r--r--indexer/indexer_tests/osm_editor_test.cpp22
2 files changed, 9 insertions, 21 deletions
diff --git a/indexer/indexer_tests/indexer_tests.pro b/indexer/indexer_tests/indexer_tests.pro
index 43abbd013a..81b1b08b1b 100644
--- a/indexer/indexer_tests/indexer_tests.pro
+++ b/indexer/indexer_tests/indexer_tests.pro
@@ -4,10 +4,10 @@ CONFIG -= app_bundle
TEMPLATE = app
ROOT_DIR = ../..
-DEPENDENCIES = search_tests_support generator_tests_support platform_tests_support \
- generator search routing indexer storage editor platform coding geometry \
- base stats_client jansson tess2 protobuf tomcrypt succinct opening_hours \
- pugixml
+DEPENDENCIES = generator_tests_support search_tests_support indexer_tests_support \
+ platform_tests_support generator search routing indexer storage editor \
+ platform coding geometry base stats_client jansson tess2 protobuf tomcrypt \
+ succinct opening_hours pugixml
include($$ROOT_DIR/common.pri)
diff --git a/indexer/indexer_tests/osm_editor_test.cpp b/indexer/indexer_tests/osm_editor_test.cpp
index c19032ccb2..21bc744d23 100644
--- a/indexer/indexer_tests/osm_editor_test.cpp
+++ b/indexer/indexer_tests/osm_editor_test.cpp
@@ -4,11 +4,12 @@
#include "search/reverse_geocoder.hpp"
-#include "indexer/classificator_loader.hpp"
#include "indexer/classificator.hpp"
+#include "indexer/classificator_loader.hpp"
#include "indexer/ftypes_matcher.hpp"
-#include "indexer/osm_editor.hpp"
#include "indexer/index_helpers.hpp"
+#include "indexer/indexer_tests_support/helpers.hpp"
+#include "indexer/osm_editor.hpp"
#include "editor/editor_storage.hpp"
@@ -17,6 +18,7 @@
#include "coding/file_name_utils.hpp"
using namespace generator::tests_support;
+using namespace indexer::tests_support;
namespace
{
@@ -70,17 +72,6 @@ void FillEditableMapObject(osm::Editor const & editor, FeatureType const & ft, o
emo.SetEditableProperties(editor.GetEditableProperties(ft));
}
-template <typename TFn>
-void EditFeature(FeatureType const & ft, TFn && fn)
-{
- auto & editor = osm::Editor::Instance();
-
- osm::EditableMapObject emo;
- FillEditableMapObject(editor, ft, emo);
- fn(emo);
- TEST_EQUAL(editor.SaveEditedFeature(emo), osm::Editor::SaveResult::SavedSuccessfully, ());
-}
-
void SetBuildingLevelsToOne(FeatureType const & ft)
{
EditFeature(ft, [](osm::EditableMapObject & emo)
@@ -153,10 +144,7 @@ EditorTest::EditorTest()
LOG(LERROR, ("Classificator read error: ", e.what()));
}
- auto & editor = osm::Editor::Instance();
- editor.SetIndex(m_index);
- editor.m_storage = make_unique<editor::InMemoryStorage>();
- editor.ClearAllLocalEdits();
+ indexer::tests_support::SetUpEditorForTesting(m_index);
}
EditorTest::~EditorTest()