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

helpers.hpp « indexer_tests_support « indexer - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5adfbb076818bcaf7fc21e1257d609cab18a2280 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once

#include "indexer/editable_map_object.hpp"
#include "indexer/osm_editor.hpp"

#include "base/assert.hpp"

#include "std/unique_ptr.hpp"

namespace indexer
{
namespace tests_support
{
void SetUpEditorForTesting(unique_ptr<osm::Editor::Delegate> delegate);

template <typename TFn>
void EditFeature(FeatureType const & ft, TFn && fn)
{
  auto & editor = osm::Editor::Instance();

  osm::EditableMapObject emo;
  emo.SetFromFeatureType(ft);
  emo.SetEditableProperties(editor.GetEditableProperties(ft));

  fn(emo);

  CHECK_EQUAL(editor.SaveEditedFeature(emo), osm::Editor::SaveResult::SavedSuccessfully, ());
}
}  // namespace tests_support
}  // namespace indexer