{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/73501055","id":73501055,"diff_hunk":"@@ -0,0 +1,558 @@\n+#include \"indexer/indexer_tests/osm_editor_test.hpp\"\n+#include \"testing/testing.hpp\"\n+\n+#include \"search/reverse_geocoder.hpp\"\n+\n+#include \"indexer/classificator_loader.hpp\"\n+\n+#include \"indexer/classificator.hpp\"\n+#include \"indexer/ftypes_matcher.hpp\"\n+#include \"indexer/osm_editor.hpp\"\n+#include \"indexer/index_helpers.hpp\"\n+\n+#include \"editor/editor_storage.hpp\"\n+\n+using namespace generator::tests_support;\n+\n+namespace\n+{\n+class IsCafeChecker : public ftypes::BaseChecker\n+{\n+public:\n+  static IsCafeChecker const & Instance()\n+  {\n+    static const IsCafeChecker instance;\n+    return instance;\n+  }\n+\n+private:\n+  IsCafeChecker()\n+  {\n+    Classificator const & c = classif();\n+    m_types.push_back(c.GetTypeByPath({\"amenity\", \"cafe\"}));\n+  }\n+};\n+\n+class TestCafe : public TestPOI\n+{\n+public:\n+  TestCafe(m2::PointD const & center, string const & name, string const & lang)\n+    : TestPOI(center, name, lang)\n+  {\n+    SetTypes({{\"amenity\", \"cafe\"}});\n+  }\n+};\n+\n+template <typename TFn>\n+void ForEachCafeAtPoint(Index & index, m2::PointD const & mercator, TFn && fn)\n+{\n+  m2::RectD const rect = MercatorBounds::RectByCenterXYAndSizeInMeters(mercator, 0.2 /* rect width */);\n+\n+  auto const f = [&fn](FeatureType & ft)\n+  {\n+    if (IsCafeChecker::Instance()(ft))\n+    {\n+      fn(ft);\n+    }\n+  };\n+\n+  index.ForEachInRect(f, rect, scales::GetUpperScale());\n+}\n+\n+void FillEditableMapObject(osm::Editor const & editor, FeatureType const & ft, osm::EditableMapObject & emo)\n+{\n+  emo.SetFromFeatureType(ft);\n+  emo.SetHouseNumber(ft.GetHouseNumber());\n+  emo.SetEditableProperties(editor.GetEditableProperties(ft));\n+}\n+}  // namespace\n+\n+namespace editor\n+{\n+namespace testing\n+{\n+EditorTest::EditorTest()\n+{\n+  try\n+  {\n+    classificator::Load();\n+  }\n+  catch (RootException const & e)\n+  {\n+    LOG(LERROR, (\"Classificator read error: \", e.what()));\n+  }\n+\n+  InitEditorForTest();\n+}\n+\n+EditorTest::~EditorTest()\n+{\n+  for (auto const & file : m_mwmFiles)\n+    Cleanup(file);\n+}\n+\n+void EditorTest::GetFeatureTypeInfoTest()\n+{\n+  auto & editor = osm::Editor::Instance();\n+\n+  {\n+    MwmSet::MwmId mwmId;\n+    TEST(!editor.GetFeatureTypeInfo(mwmId, 0), ());\n+  }\n+\n+  TestCafe cafe(m2::PointD(1.0, 1.0), \"London Cafe\", \"en\");\n+  auto const mwmId = ConstructTestMwm([&cafe](TestMwmBuilder & builder)\n+  {\n+    builder.Add(cafe);\n+  });\n+  ASSERT(mwmId.GetInfo(), ());","path":"indexer/indexer_tests/osm_editor_test.cpp","position":112,"original_position":108,"commit_id":"7f04b03e245e17e55e4b62e5734ad8aebb5b89bd","original_commit_id":"e5570fc867dd39ff0f63fa1edc71b392eff81979","user":{"login":"milchakov","id":2606569,"avatar_url":"https://avatars.githubusercontent.com/u/2606569?v=3","gravatar_id":"","url":"https://api.github.com/users/milchakov","html_url":"https://github.com/milchakov","followers_url":"https://api.github.com/users/milchakov/followers","following_url":"https://api.github.com/users/milchakov/following{/other_user}","gists_url":"https://api.github.com/users/milchakov/gists{/gist_id}","starred_url":"https://api.github.com/users/milchakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milchakov/subscriptions","organizations_url":"https://api.github.com/users/milchakov/orgs","repos_url":"https://api.github.com/users/milchakov/repos","events_url":"https://api.github.com/users/milchakov/events{/privacy}","received_events_url":"https://api.github.com/users/milchakov/received_events","type":"User","site_admin":false},"body":"+","created_at":"2016-08-04T10:54:44Z","updated_at":"2016-08-04T10:54:44Z","html_url":"https://github.com/mapsme/omim/pull/3911#discussion_r73501055","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/3911","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/73501055"},"html":{"href":"https://github.com/mapsme/omim/pull/3911#discussion_r73501055"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/3911"}}},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/3911","id":79571964,"html_url":"https://github.com/mapsme/omim/pull/3911","diff_url":"https://github.com/mapsme/omim/pull/3911.diff","patch_url":"https://github.com/mapsme/omim/pull/3911.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/3911","number":3911,"state":"open","locked":false,"title":"[editor] first group of tests for editor","user":{"login":"milchakov","id":2606569,"avatar_url":"https://avatars.githubusercontent.com/u/2606569?v=3","gravatar_id":"","url":"https://api.github.com/users/milchakov","html_url":"https://github.com/milchakov","followers_url":"https://api.github.com/users/milchakov/followers","following_url":"https://api.github.com/users/milchakov/following{/other_user}","gists_url":"https://api.github.com/users/milchakov/gists{/gist_id}","starred_url":"https://api.github.com/users/milchakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milchakov/subscriptions","organizations_url":"https://api.github.com/users/milchakov/orgs","repos_url":"https://api.github.com/users/milchakov/repos","events_url":"https://api.github.com/users/milchakov/events{/privacy}","received_events_url":"https://api.github.com/users/milchakov/received_events","type":"User","site_admin":false},"body":"Первая часть тестов для редактора\r\n@ygorshenin \r\n@mgsergio ","created_at":"2016-08-01T13:54:16Z","updated_at":"2016-08-04T10:54:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cb55a4174d8b7e98b8a85c67bacc58e54aaecc45","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/3911/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/3911/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/3911/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/7f04b03e245e17e55e4b62e5734ad8aebb5b89bd","head":{"label":"milchakov:editor_tests","ref":"editor_tests","sha":"7f04b03e245e17e55e4b62e5734ad8aebb5b89bd","user":{"login":"milchakov","id":2606569,"avatar_url":"https://avatars.githubusercontent.com/u/2606569?v=3","gravatar_id":"","url":"https://api.github.com/users/milchakov","html_url":"https://github.com/milchakov","followers_url":"https://api.github.com/users/milchakov/followers","following_url":"https://api.github.com/users/milchakov/following{/other_user}","gists_url":"https://api.github.com/users/milchakov/gists{/gist_id}","starred_url":"https://api.github.com/users/milchakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milchakov/subscriptions","organizations_url":"https://api.github.com/users/milchakov/orgs","repos_url":"https://api.github.com/users/milchakov/repos","events_url":"https://api.github.com/users/milchakov/events{/privacy}","received_events_url":"https://api.github.com/users/milchakov/received_events","type":"User","site_admin":false},"repo":{"id":61498503,"name":"omim","full_name":"milchakov/omim","owner":{"login":"milchakov","id":2606569,"avatar_url":"https://avatars.githubusercontent.com/u/2606569?v=3","gravatar_id":"","url":"https://api.github.com/users/milchakov","html_url":"https://github.com/milchakov","followers_url":"https://api.github.com/users/milchakov/followers","following_url":"https://api.github.com/users/milchakov/following{/other_user}","gists_url":"https://api.github.com/users/milchakov/gists{/gist_id}","starred_url":"https://api.github.com/users/milchakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milchakov/subscriptions","organizations_url":"https://api.github.com/users/milchakov/orgs","repos_url":"https://api.github.com/users/milchakov/repos","events_url":"https://api.github.com/users/milchakov/events{/privacy}","received_events_url":"https://api.github.com/users/milchakov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/milchakov/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":true,"url":"https://api.github.com/repos/milchakov/omim","forks_url":"https://api.github.com/repos/milchakov/omim/forks","keys_url":"https://api.github.com/repos/milchakov/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/milchakov/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/milchakov/omim/teams","hooks_url":"https://api.github.com/repos/milchakov/omim/hooks","issue_events_url":"https://api.github.com/repos/milchakov/omim/issues/events{/number}","events_url":"https://api.github.com/repos/milchakov/omim/events","assignees_url":"https://api.github.com/repos/milchakov/omim/assignees{/user}","branches_url":"https://api.github.com/repos/milchakov/omim/branches{/branch}","tags_url":"https://api.github.com/repos/milchakov/omim/tags","blobs_url":"https://api.github.com/repos/milchakov/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/milchakov/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/milchakov/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/milchakov/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/milchakov/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/milchakov/omim/languages","stargazers_url":"https://api.github.com/repos/milchakov/omim/stargazers","contributors_url":"https://api.github.com/repos/milchakov/omim/contributors","subscribers_url":"https://api.github.com/repos/milchakov/omim/subscribers","subscription_url":"https://api.github.com/repos/milchakov/omim/subscription","commits_url":"https://api.github.com/repos/milchakov/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/milchakov/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/milchakov/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/milchakov/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/milchakov/omim/contents/{+path}","compare_url":"https://api.github.com/repos/milchakov/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/milchakov/omim/merges","archive_url":"https://api.github.com/repos/milchakov/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/milchakov/omim/downloads","issues_url":"https://api.github.com/repos/milchakov/omim/issues{/number}","pulls_url":"https://api.github.com/repos/milchakov/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/milchakov/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/milchakov/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/milchakov/omim/labels{/name}","releases_url":"https://api.github.com/repos/milchakov/omim/releases{/id}","deployments_url":"https://api.github.com/repos/milchakov/omim/deployments","created_at":"2016-06-19T20:16:05Z","updated_at":"2016-06-19T20:17:34Z","pushed_at":"2016-08-04T10:49:29Z","git_url":"git://github.com/milchakov/omim.git","ssh_url":"git@github.com:milchakov/omim.git","clone_url":"https://github.com/milchakov/omim.git","svn_url":"https://github.com/milchakov/omim","homepage":null,"size":2616649,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mapsme:master","ref":"master","sha":"a2d80a5bbb66eb0883e8e7b2e92cb66c6ada7c78","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/omim/deployments","created_at":"2015-09-20T02:57:13Z","updated_at":"2016-08-03T10:52:28Z","pushed_at":"2016-08-04T10:49:57Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":null,"size":2674649,"stargazers_count":1894,"watchers_count":1894,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":325,"mirror_url":null,"open_issues_count":225,"forks":325,"open_issues":225,"watchers":1894,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/3911"},"html":{"href":"https://github.com/mapsme/omim/pull/3911"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/3911"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/3911/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/3911/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/3911/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/7f04b03e245e17e55e4b62e5734ad8aebb5b89bd"}}}}
{"actor":{"display_login":"milchakov"}}