{"action":"created","comment":{"url":"https://api.github.com/repos/xapian/xapian/pulls/comments/129022134","pull_request_review_id":51753058,"id":129022134,"diff_hunk":"@@ -0,0 +1,187 @@\n+/** @file api_generated.cc\n+ * @brief test common features of API classes\n+ */\n+/* Warning: This file is generated by ./generate-api_generated - do not modify directly! */\n+/* Copyright (C) 2007,2009,2012,2014,2015,2016 Olly Betts\n+ *\n+ * This program is free software; you can redistribute it and/or modify\n+ * it under the terms of the GNU General Public License as published by\n+ * the Free Software Foundation; either version 2 of the License, or\n+ * (at your option) any later version.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU General Public License\n+ * along with this program; if not, write to the Free Software\n+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA\n+ */\n+\n+#include <config.h>\n+\n+#include \"api_letor.h\"\n+\n+#define XAPIAN_DEPRECATED(D) D\n+#include <xapian.h>\n+#include <xapian-letor.h>\n+#include <fstream>\n+\n+#include \"apitest.h\"\n+#include \"testutils.h\"\n+\n+using namespace std;\n+\n+DEFINE_TESTCASE(assign_db_path1, !backend) {\n+   Xapian::Ranker *ranker = new Xapian::ListNETRanker();\n+   ranker->set_database_path(\"db_path\");\n+   TEST_EQUAL(\"db_path\", ranker->get_database_path());\n+   delete ranker;\n+   ranker = new Xapian::SVMRanker();\n+   ranker->set_database_path(\"db_path\");\n+   TEST_EQUAL(\"db_path\", ranker->get_database_path());\n+   delete ranker;\n+\n+   return true;\n+}\n+\n+DEFINE_TESTCASE(assign_db_path2, backend) {\n+    Xapian::Ranker *ranker = new Xapian::ListNETRanker();\n+    TEST_EXCEPTION(Xapian::FileNotFoundError, ranker->train_model(\"\", \"\"));\n+    delete ranker;\n+    ranker = new Xapian::SVMRanker();\n+    TEST_EXCEPTION(Xapian::FileNotFoundError, ranker->train_model(\"\", \"\"));\n+    delete ranker;\n+\n+    return true;\n+}\n+\n+static void\n+gen_uniqterms_gt_doclen_db(Xapian::WritableDatabase& db, const string&)\n+{\n+    Xapian::Document doc;\n+    Xapian::TermGenerator termgenerator;\n+    termgenerator.set_document(doc);\n+    termgenerator.set_stemmer(Xapian::Stem(\"en\"));\n+    termgenerator.index_text(\"Lions, Tigers, Bears and Giraffes\", 1, \"S\");\n+    termgenerator.index_text(\"This paragraph talks about lions and tigers and \"\n+\t\t\t     \"bears (oh, my!). It mentions giraffes, \"\n+\t\t\t     \"but that's not really very important. Lions \"\n+\t\t\t     \"and tigers are big cats, so they must be really \"\n+\t\t\t     \"cuddly. Bears are famous for being cuddly, at \"\n+\t\t\t     \"least when they're teddy bears.\", 1, \"XD\");\n+    termgenerator.index_text(\"Lions, Tigers, Bears and Giraffes\");\n+    termgenerator.increase_termpos();\n+    termgenerator.index_text(\"This paragraph talks about lions and tigers and \"\n+\t\t\t     \"bears (oh, my!). It mentions giraffes, \"\n+\t\t\t     \"but that's not really very important. Lions \"\n+\t\t\t     \"and tigers are big cats, so they must be really \"\n+\t\t\t     \"cuddly. Bears are famous for being cuddly, at \"\n+\t\t\t     \"least when they're teddy bears.\");\n+    db.add_document(doc);\n+    doc.clear_terms();\n+    termgenerator.index_text(\"Lions, Tigers and Bears\", 1, \"S\");\n+    termgenerator.index_text(\"This is the paragraph of interest. Tigers are \"\n+\t\t\t     \"massive beasts - I wouldn't want to meet a \"\n+\t\t\t     \"hungry one anywhere. Lions are scary even when \"\n+\t\t\t     \"lyin' down. Bears are scary even when bare. \"\n+\t\t\t     \"Together I suspect they'd be less scary, as the \"\n+\t\t\t     \"tigers, lions, and bears would all keep each \"\n+\t\t\t     \"other busy. On the other hand, bears don't live \"\n+\t\t\t     \"in the same continent as far as I know.\", 1,\n+\t\t\t     \"XD\");\n+    termgenerator.index_text(\"Lions, Tigers and Bears\");\n+    termgenerator.increase_termpos();\n+    termgenerator.index_text(\"This is the paragraph of interest. Tigers are \"\n+\t\t\t     \"massive beasts - I wouldn't want to meet a \"\n+\t\t\t     \"hungry one anywhere. Lions are scary even when \"\n+\t\t\t     \"lyin' down. Bears are scary even when bare. \"\n+\t\t\t     \"Together I suspect they'd be less scary, as the \"\n+\t\t\t     \"tigers, lions, and bears would all keep each \"\n+\t\t\t     \"other busy. On the other hand, bears don't live \"\n+\t\t\t     \"in the same continent as far as I know.\");\n+    db.add_document(doc);\n+}\n+\n+DEFINE_TESTCASE(ranker1, generated) {\n+    Xapian::Ranker *ranker = new Xapian::ListNETRanker();\n+    string a = get_database_path(\"apitest_ranker1\",\n+\t\t\t\t       gen_uniqterms_gt_doclen_db);","path":"xapian-letor/tests/api_letor.cc","position":null,"original_position":110,"commit_id":"1ea61830e52d4ce349de6eef7e428f5f7995fcf3","original_commit_id":"a968b997b13167f4ac8cb126df2fe76cc05597af","user":{"login":"AyushP123","id":9451641,"avatar_url":"https://avatars1.githubusercontent.com/u/9451641?v=4","gravatar_id":"","url":"https://api.github.com/users/AyushP123","html_url":"https://github.com/AyushP123","followers_url":"https://api.github.com/users/AyushP123/followers","following_url":"https://api.github.com/users/AyushP123/following{/other_user}","gists_url":"https://api.github.com/users/AyushP123/gists{/gist_id}","starred_url":"https://api.github.com/users/AyushP123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AyushP123/subscriptions","organizations_url":"https://api.github.com/users/AyushP123/orgs","repos_url":"https://api.github.com/users/AyushP123/repos","events_url":"https://api.github.com/users/AyushP123/events{/privacy}","received_events_url":"https://api.github.com/users/AyushP123/received_events","type":"User","site_admin":false},"body":"changed the name from a to db_path .... I used the name a before because I copied it from \"compactnorenumber1\" test in xapian-core/tests/api_compact.cc","created_at":"2017-07-24T12:31:49Z","updated_at":"2017-07-24T12:31:50Z","html_url":"https://github.com/xapian/xapian/pull/166#discussion_r129022134","pull_request_url":"https://api.github.com/repos/xapian/xapian/pulls/166","_links":{"self":{"href":"https://api.github.com/repos/xapian/xapian/pulls/comments/129022134"},"html":{"href":"https://github.com/xapian/xapian/pull/166#discussion_r129022134"},"pull_request":{"href":"https://api.github.com/repos/xapian/xapian/pulls/166"}}},"pull_request":{"url":"https://api.github.com/repos/xapian/xapian/pulls/166","id":129605019,"html_url":"https://github.com/xapian/xapian/pull/166","diff_url":"https://github.com/xapian/xapian/pull/166.diff","patch_url":"https://github.com/xapian/xapian/pull/166.patch","issue_url":"https://api.github.com/repos/xapian/xapian/issues/166","number":166,"state":"open","locked":false,"title":"Add tests to letor","user":{"login":"AyushP123","id":9451641,"avatar_url":"https://avatars1.githubusercontent.com/u/9451641?v=4","gravatar_id":"","url":"https://api.github.com/users/AyushP123","html_url":"https://github.com/AyushP123","followers_url":"https://api.github.com/users/AyushP123/followers","following_url":"https://api.github.com/users/AyushP123/following{/other_user}","gists_url":"https://api.github.com/users/AyushP123/gists{/gist_id}","starred_url":"https://api.github.com/users/AyushP123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AyushP123/subscriptions","organizations_url":"https://api.github.com/users/AyushP123/orgs","repos_url":"https://api.github.com/users/AyushP123/repos","events_url":"https://api.github.com/users/AyushP123/events{/privacy}","received_events_url":"https://api.github.com/users/AyushP123/received_events","type":"User","site_admin":false},"body":"Writing automated test suite for letor .... Currently it tests all the aspects of ranker and a letor/api.","created_at":"2017-07-10T05:49:16Z","updated_at":"2017-07-24T12:31:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"47703d6a4b7fc1820d28d6be575f7a0299c98d8c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/xapian/xapian/pulls/166/commits","review_comments_url":"https://api.github.com/repos/xapian/xapian/pulls/166/comments","review_comment_url":"https://api.github.com/repos/xapian/xapian/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xapian/xapian/issues/166/comments","statuses_url":"https://api.github.com/repos/xapian/xapian/statuses/1ea61830e52d4ce349de6eef7e428f5f7995fcf3","head":{"label":"AyushP123:letor_tests1","ref":"letor_tests1","sha":"1ea61830e52d4ce349de6eef7e428f5f7995fcf3","user":{"login":"AyushP123","id":9451641,"avatar_url":"https://avatars1.githubusercontent.com/u/9451641?v=4","gravatar_id":"","url":"https://api.github.com/users/AyushP123","html_url":"https://github.com/AyushP123","followers_url":"https://api.github.com/users/AyushP123/followers","following_url":"https://api.github.com/users/AyushP123/following{/other_user}","gists_url":"https://api.github.com/users/AyushP123/gists{/gist_id}","starred_url":"https://api.github.com/users/AyushP123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AyushP123/subscriptions","organizations_url":"https://api.github.com/users/AyushP123/orgs","repos_url":"https://api.github.com/users/AyushP123/repos","events_url":"https://api.github.com/users/AyushP123/events{/privacy}","received_events_url":"https://api.github.com/users/AyushP123/received_events","type":"User","site_admin":false},"repo":{"id":79650721,"name":"xapian","full_name":"AyushP123/xapian","owner":{"login":"AyushP123","id":9451641,"avatar_url":"https://avatars1.githubusercontent.com/u/9451641?v=4","gravatar_id":"","url":"https://api.github.com/users/AyushP123","html_url":"https://github.com/AyushP123","followers_url":"https://api.github.com/users/AyushP123/followers","following_url":"https://api.github.com/users/AyushP123/following{/other_user}","gists_url":"https://api.github.com/users/AyushP123/gists{/gist_id}","starred_url":"https://api.github.com/users/AyushP123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AyushP123/subscriptions","organizations_url":"https://api.github.com/users/AyushP123/orgs","repos_url":"https://api.github.com/users/AyushP123/repos","events_url":"https://api.github.com/users/AyushP123/events{/privacy}","received_events_url":"https://api.github.com/users/AyushP123/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AyushP123/xapian","description":"Mirror of the Xapian repository.  You're welcome to open pull requests on github (they'll just get merged indirectly).","fork":true,"url":"https://api.github.com/repos/AyushP123/xapian","forks_url":"https://api.github.com/repos/AyushP123/xapian/forks","keys_url":"https://api.github.com/repos/AyushP123/xapian/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AyushP123/xapian/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AyushP123/xapian/teams","hooks_url":"https://api.github.com/repos/AyushP123/xapian/hooks","issue_events_url":"https://api.github.com/repos/AyushP123/xapian/issues/events{/number}","events_url":"https://api.github.com/repos/AyushP123/xapian/events","assignees_url":"https://api.github.com/repos/AyushP123/xapian/assignees{/user}","branches_url":"https://api.github.com/repos/AyushP123/xapian/branches{/branch}","tags_url":"https://api.github.com/repos/AyushP123/xapian/tags","blobs_url":"https://api.github.com/repos/AyushP123/xapian/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AyushP123/xapian/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AyushP123/xapian/git/refs{/sha}","trees_url":"https://api.github.com/repos/AyushP123/xapian/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AyushP123/xapian/statuses/{sha}","languages_url":"https://api.github.com/repos/AyushP123/xapian/languages","stargazers_url":"https://api.github.com/repos/AyushP123/xapian/stargazers","contributors_url":"https://api.github.com/repos/AyushP123/xapian/contributors","subscribers_url":"https://api.github.com/repos/AyushP123/xapian/subscribers","subscription_url":"https://api.github.com/repos/AyushP123/xapian/subscription","commits_url":"https://api.github.com/repos/AyushP123/xapian/commits{/sha}","git_commits_url":"https://api.github.com/repos/AyushP123/xapian/git/commits{/sha}","comments_url":"https://api.github.com/repos/AyushP123/xapian/comments{/number}","issue_comment_url":"https://api.github.com/repos/AyushP123/xapian/issues/comments{/number}","contents_url":"https://api.github.com/repos/AyushP123/xapian/contents/{+path}","compare_url":"https://api.github.com/repos/AyushP123/xapian/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AyushP123/xapian/merges","archive_url":"https://api.github.com/repos/AyushP123/xapian/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AyushP123/xapian/downloads","issues_url":"https://api.github.com/repos/AyushP123/xapian/issues{/number}","pulls_url":"https://api.github.com/repos/AyushP123/xapian/pulls{/number}","milestones_url":"https://api.github.com/repos/AyushP123/xapian/milestones{/number}","notifications_url":"https://api.github.com/repos/AyushP123/xapian/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AyushP123/xapian/labels{/name}","releases_url":"https://api.github.com/repos/AyushP123/xapian/releases{/id}","deployments_url":"https://api.github.com/repos/AyushP123/xapian/deployments","created_at":"2017-01-21T14:31:07Z","updated_at":"2017-01-21T14:31:16Z","pushed_at":"2017-07-23T12:19:52Z","git_url":"git://github.com/AyushP123/xapian.git","ssh_url":"git@github.com:AyushP123/xapian.git","clone_url":"https://github.com/AyushP123/xapian.git","svn_url":"https://github.com/AyushP123/xapian","homepage":"https://xapian.org/","size":77658,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"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":"xapian:master","ref":"master","sha":"c278b052e63f1c2509951f18b8fe25a8d3833c7c","user":{"login":"xapian","id":312861,"avatar_url":"https://avatars0.githubusercontent.com/u/312861?v=4","gravatar_id":"","url":"https://api.github.com/users/xapian","html_url":"https://github.com/xapian","followers_url":"https://api.github.com/users/xapian/followers","following_url":"https://api.github.com/users/xapian/following{/other_user}","gists_url":"https://api.github.com/users/xapian/gists{/gist_id}","starred_url":"https://api.github.com/users/xapian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xapian/subscriptions","organizations_url":"https://api.github.com/users/xapian/orgs","repos_url":"https://api.github.com/users/xapian/repos","events_url":"https://api.github.com/users/xapian/events{/privacy}","received_events_url":"https://api.github.com/users/xapian/received_events","type":"Organization","site_admin":false},"repo":{"id":735981,"name":"xapian","full_name":"xapian/xapian","owner":{"login":"xapian","id":312861,"avatar_url":"https://avatars0.githubusercontent.com/u/312861?v=4","gravatar_id":"","url":"https://api.github.com/users/xapian","html_url":"https://github.com/xapian","followers_url":"https://api.github.com/users/xapian/followers","following_url":"https://api.github.com/users/xapian/following{/other_user}","gists_url":"https://api.github.com/users/xapian/gists{/gist_id}","starred_url":"https://api.github.com/users/xapian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xapian/subscriptions","organizations_url":"https://api.github.com/users/xapian/orgs","repos_url":"https://api.github.com/users/xapian/repos","events_url":"https://api.github.com/users/xapian/events{/privacy}","received_events_url":"https://api.github.com/users/xapian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xapian/xapian","description":"Mirror of the Xapian repository.  You're welcome to open pull requests on github (they'll just get merged indirectly).","fork":false,"url":"https://api.github.com/repos/xapian/xapian","forks_url":"https://api.github.com/repos/xapian/xapian/forks","keys_url":"https://api.github.com/repos/xapian/xapian/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xapian/xapian/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xapian/xapian/teams","hooks_url":"https://api.github.com/repos/xapian/xapian/hooks","issue_events_url":"https://api.github.com/repos/xapian/xapian/issues/events{/number}","events_url":"https://api.github.com/repos/xapian/xapian/events","assignees_url":"https://api.github.com/repos/xapian/xapian/assignees{/user}","branches_url":"https://api.github.com/repos/xapian/xapian/branches{/branch}","tags_url":"https://api.github.com/repos/xapian/xapian/tags","blobs_url":"https://api.github.com/repos/xapian/xapian/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xapian/xapian/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xapian/xapian/git/refs{/sha}","trees_url":"https://api.github.com/repos/xapian/xapian/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xapian/xapian/statuses/{sha}","languages_url":"https://api.github.com/repos/xapian/xapian/languages","stargazers_url":"https://api.github.com/repos/xapian/xapian/stargazers","contributors_url":"https://api.github.com/repos/xapian/xapian/contributors","subscribers_url":"https://api.github.com/repos/xapian/xapian/subscribers","subscription_url":"https://api.github.com/repos/xapian/xapian/subscription","commits_url":"https://api.github.com/repos/xapian/xapian/commits{/sha}","git_commits_url":"https://api.github.com/repos/xapian/xapian/git/commits{/sha}","comments_url":"https://api.github.com/repos/xapian/xapian/comments{/number}","issue_comment_url":"https://api.github.com/repos/xapian/xapian/issues/comments{/number}","contents_url":"https://api.github.com/repos/xapian/xapian/contents/{+path}","compare_url":"https://api.github.com/repos/xapian/xapian/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xapian/xapian/merges","archive_url":"https://api.github.com/repos/xapian/xapian/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xapian/xapian/downloads","issues_url":"https://api.github.com/repos/xapian/xapian/issues{/number}","pulls_url":"https://api.github.com/repos/xapian/xapian/pulls{/number}","milestones_url":"https://api.github.com/repos/xapian/xapian/milestones{/number}","notifications_url":"https://api.github.com/repos/xapian/xapian/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xapian/xapian/labels{/name}","releases_url":"https://api.github.com/repos/xapian/xapian/releases{/id}","deployments_url":"https://api.github.com/repos/xapian/xapian/deployments","created_at":"2010-06-23T15:51:03Z","updated_at":"2017-07-22T22:01:04Z","pushed_at":"2017-07-23T17:30:45Z","git_url":"git://github.com/xapian/xapian.git","ssh_url":"git@github.com:xapian/xapian.git","clone_url":"https://github.com/xapian/xapian.git","svn_url":"https://github.com/xapian/xapian","homepage":"https://xapian.org/","size":77350,"stargazers_count":345,"watchers_count":345,"language":"C++","has_issues":false,"has_projects":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":177,"mirror_url":null,"open_issues_count":17,"forks":177,"open_issues":17,"watchers":345,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xapian/xapian/pulls/166"},"html":{"href":"https://github.com/xapian/xapian/pull/166"},"issue":{"href":"https://api.github.com/repos/xapian/xapian/issues/166"},"comments":{"href":"https://api.github.com/repos/xapian/xapian/issues/166/comments"},"review_comments":{"href":"https://api.github.com/repos/xapian/xapian/pulls/166/comments"},"review_comment":{"href":"https://api.github.com/repos/xapian/xapian/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xapian/xapian/pulls/166/commits"},"statuses":{"href":"https://api.github.com/repos/xapian/xapian/statuses/1ea61830e52d4ce349de6eef7e428f5f7995fcf3"}}}}
{"actor":{"display_login":"AyushP123"}}