{"action":"created","comment":{"url":"https://api.github.com/repos/xapian/xapian/pulls/comments/194584488","pull_request_review_id":127784666,"id":194584488,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDU4NDQ4OA==","diff_hunk":"@@ -94,26 +167,169 @@ DEFINE_TESTCASE(createfeaturevector, generated)\n     TEST(fv.empty());\n     mset = enquire.get_mset(0, 10);\n     TEST(!mset.empty());\n+    TEST_EQUAL(mset.size(), 2);\n     fv = fl.create_feature_vectors(mset, Xapian::Query(\"lions\"), db);\n     TEST_EQUAL(fv.size(), 2);\n     TEST_EQUAL(fv[0].get_fcount(), 19);\n     TEST_EQUAL(fv[1].get_fcount(), 19);\n+    return true;\n+}\n+\n+DEFINE_TESTCASE(createfeaturevectoronevector, generated)\n+{\n+    Xapian::FeatureList fl;\n+    Xapian::Database db = get_database(\"apitest_ranker2\",\n+\t\t\t\t       db_index_one_document);\n+    Xapian::Enquire enquire(db);\n+    enquire.set_query(Xapian::Query(\"tigers\"));\n+    Xapian::MSet mset;\n+    vector<Xapian::FeatureVector> fv =\n+\t    fl.create_feature_vectors(mset, Xapian::Query(\"tigers\"), db);\n+    TEST(fv.empty());\n+    mset = enquire.get_mset(0, 10);\n+    TEST(!mset.empty());\n+    fv = fl.create_feature_vectors(mset, Xapian::Query(\"tigers\"), db);\n+    TEST_EQUAL(fv.size(), 1);\n+    TEST_EQUAL(fv[0].get_fcount(), 19);\n+    return true;\n+}\n+\n+DEFINE_TESTCASE(createfeaturevectoronevector_wrongquery, generated)\n+{\n+    Xapian::FeatureList fl;\n+    Xapian::Database db = get_database(\"apitest_ranker3\",\n+\t\t\t\t       db_index_one_document);\n+    Xapian::Enquire enquire(db);\n+    enquire.set_query(Xapian::Query(\"llamas\"));\n+    Xapian::MSet mset;\n+    vector<Xapian::FeatureVector> fv =\n+\t    fl.create_feature_vectors(mset, Xapian::Query(\"llamas\"), db);\n+    TEST(fv.empty());\n+\n+    mset = enquire.get_mset(0, 10);\n+    TEST(mset.empty());\n+    fv = fl.create_feature_vectors(mset, Xapian::Query(\"llamas\"), db);\n+    TEST_EQUAL(fv.size(), 0);\n+    return true;\n+}\n+\n+DEFINE_TESTCASE(createfeaturevectorthree, generated)\n+{\n+    Xapian::FeatureList fl;\n+    Xapian::Database db = get_database(\"apitest_ranker4\",\n+\t\t\t\t       db_index_three_documents);\n+    Xapian::Enquire enquire(db);\n+    enquire.set_query(Xapian::Query(\"score\"));\n+    Xapian::MSet mset;\n+    vector<Xapian::FeatureVector> fv =\n+\t    fl.create_feature_vectors(mset, Xapian::Query(\"score\"), db);\n+    TEST(fv.empty());\n+\n+    mset = enquire.get_mset(0, 10);\n+    TEST(!mset.empty());\n+    fv = fl.create_feature_vectors(mset, Xapian::Query(\"score\"), db);\n+    TEST_EQUAL(fv.size(), 2);\n+    TEST_EQUAL(fv[0].get_fcount(), 19);\n+    TEST_EQUAL(fv[1].get_fcount(), 19);\n+    return true;\n+}\n+\n+\n+DEFINE_TESTCASE(preparetrainingfileonedb, generated)\n+{\n+    string db_path = get_database_path(\"apitest_listnet_ranker1\",\n+\t\t\t\t       db_index_one_document);\n+    string data_directory = test_driver::get_srcdir() + \"/testdata/\";\n+    string query = data_directory + \"queryone.txt\";\n+    string qrel = data_directory + \"qrelone.txt\";\n+    string training_data = data_directory + \"training_data_one_doc.txt\";\n+    Xapian::prepare_training_file(db_path, query, qrel, 10,\n+\t\t\t\t  \"training_output_data_one_doc.txt\");","path":"xapian-letor/tests/api_letor.cc","position":null,"original_position":161,"commit_id":"90cdc61f0516312cd607a0a251864d08b4f6ebf4","original_commit_id":"b0382bf29c72bd796e25e3fd43a69e3fcd927608","user":{"login":"ojwb","id":164061,"node_id":"MDQ6VXNlcjE2NDA2MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/164061?v=4","gravatar_id":"","url":"https://api.github.com/users/ojwb","html_url":"https://github.com/ojwb","followers_url":"https://api.github.com/users/ojwb/followers","following_url":"https://api.github.com/users/ojwb/following{/other_user}","gists_url":"https://api.github.com/users/ojwb/gists{/gist_id}","starred_url":"https://api.github.com/users/ojwb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ojwb/subscriptions","organizations_url":"https://api.github.com/users/ojwb/orgs","repos_url":"https://api.github.com/users/ojwb/repos","events_url":"https://api.github.com/users/ojwb/events{/privacy}","received_events_url":"https://api.github.com/users/ojwb/received_events","type":"User","site_admin":false},"body":"That sounds like a lack of error checking somewhere.  Probably failing to check that `ifstream` actually opened a file - you need to call `is_open()` to see if opening the file (via the constructor or an explicit call to the `open()` method) actually worked.\r\n\r\nThat should be fixed, and a regression testcase added (one which fails before the fix and passes after).","created_at":"2018-06-12T00:17:51Z","updated_at":"2018-06-12T00:17:51Z","html_url":"https://github.com/xapian/xapian/pull/202#discussion_r194584488","pull_request_url":"https://api.github.com/repos/xapian/xapian/pulls/202","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/xapian/xapian/pulls/comments/194584488"},"html":{"href":"https://github.com/xapian/xapian/pull/202#discussion_r194584488"},"pull_request":{"href":"https://api.github.com/repos/xapian/xapian/pulls/202"}},"in_reply_to_id":193513890},"pull_request":{"url":"https://api.github.com/repos/xapian/xapian/pulls/202","id":192231475,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMjMxNDc1","html_url":"https://github.com/xapian/xapian/pull/202","diff_url":"https://github.com/xapian/xapian/pull/202.diff","patch_url":"https://github.com/xapian/xapian/pull/202.patch","issue_url":"https://api.github.com/repos/xapian/xapian/issues/202","number":202,"state":"open","locked":false,"title":"Added tests to xapian-letor","user":{"login":"addy007-icy","id":25341240,"node_id":"MDQ6VXNlcjI1MzQxMjQw","avatar_url":"https://avatars3.githubusercontent.com/u/25341240?v=4","gravatar_id":"","url":"https://api.github.com/users/addy007-icy","html_url":"https://github.com/addy007-icy","followers_url":"https://api.github.com/users/addy007-icy/followers","following_url":"https://api.github.com/users/addy007-icy/following{/other_user}","gists_url":"https://api.github.com/users/addy007-icy/gists{/gist_id}","starred_url":"https://api.github.com/users/addy007-icy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/addy007-icy/subscriptions","organizations_url":"https://api.github.com/users/addy007-icy/orgs","repos_url":"https://api.github.com/users/addy007-icy/repos","events_url":"https://api.github.com/users/addy007-icy/events{/privacy}","received_events_url":"https://api.github.com/users/addy007-icy/received_events","type":"User","site_admin":false},"body":"Test commit to identify failure, as well as \r\n\"Conditional jump or move depends on uninitialised value(s)\"","created_at":"2018-06-03T05:44:13Z","updated_at":"2018-06-12T00:17:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb5c27f4f82a28cb1e9f900b2b53164c1015d7ce","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/xapian/xapian/pulls/202/commits","review_comments_url":"https://api.github.com/repos/xapian/xapian/pulls/202/comments","review_comment_url":"https://api.github.com/repos/xapian/xapian/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xapian/xapian/issues/202/comments","statuses_url":"https://api.github.com/repos/xapian/xapian/statuses/90cdc61f0516312cd607a0a251864d08b4f6ebf4","head":{"label":"addy007-icy:testBranch","ref":"testBranch","sha":"90cdc61f0516312cd607a0a251864d08b4f6ebf4","user":{"login":"addy007-icy","id":25341240,"node_id":"MDQ6VXNlcjI1MzQxMjQw","avatar_url":"https://avatars3.githubusercontent.com/u/25341240?v=4","gravatar_id":"","url":"https://api.github.com/users/addy007-icy","html_url":"https://github.com/addy007-icy","followers_url":"https://api.github.com/users/addy007-icy/followers","following_url":"https://api.github.com/users/addy007-icy/following{/other_user}","gists_url":"https://api.github.com/users/addy007-icy/gists{/gist_id}","starred_url":"https://api.github.com/users/addy007-icy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/addy007-icy/subscriptions","organizations_url":"https://api.github.com/users/addy007-icy/orgs","repos_url":"https://api.github.com/users/addy007-icy/repos","events_url":"https://api.github.com/users/addy007-icy/events{/privacy}","received_events_url":"https://api.github.com/users/addy007-icy/received_events","type":"User","site_admin":false},"repo":{"id":124982442,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQ5ODI0NDI=","name":"xapian","full_name":"addy007-icy/xapian","owner":{"login":"addy007-icy","id":25341240,"node_id":"MDQ6VXNlcjI1MzQxMjQw","avatar_url":"https://avatars3.githubusercontent.com/u/25341240?v=4","gravatar_id":"","url":"https://api.github.com/users/addy007-icy","html_url":"https://github.com/addy007-icy","followers_url":"https://api.github.com/users/addy007-icy/followers","following_url":"https://api.github.com/users/addy007-icy/following{/other_user}","gists_url":"https://api.github.com/users/addy007-icy/gists{/gist_id}","starred_url":"https://api.github.com/users/addy007-icy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/addy007-icy/subscriptions","organizations_url":"https://api.github.com/users/addy007-icy/orgs","repos_url":"https://api.github.com/users/addy007-icy/repos","events_url":"https://api.github.com/users/addy007-icy/events{/privacy}","received_events_url":"https://api.github.com/users/addy007-icy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/addy007-icy/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/addy007-icy/xapian","forks_url":"https://api.github.com/repos/addy007-icy/xapian/forks","keys_url":"https://api.github.com/repos/addy007-icy/xapian/keys{/key_id}","collaborators_url":"https://api.github.com/repos/addy007-icy/xapian/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/addy007-icy/xapian/teams","hooks_url":"https://api.github.com/repos/addy007-icy/xapian/hooks","issue_events_url":"https://api.github.com/repos/addy007-icy/xapian/issues/events{/number}","events_url":"https://api.github.com/repos/addy007-icy/xapian/events","assignees_url":"https://api.github.com/repos/addy007-icy/xapian/assignees{/user}","branches_url":"https://api.github.com/repos/addy007-icy/xapian/branches{/branch}","tags_url":"https://api.github.com/repos/addy007-icy/xapian/tags","blobs_url":"https://api.github.com/repos/addy007-icy/xapian/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/addy007-icy/xapian/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/addy007-icy/xapian/git/refs{/sha}","trees_url":"https://api.github.com/repos/addy007-icy/xapian/git/trees{/sha}","statuses_url":"https://api.github.com/repos/addy007-icy/xapian/statuses/{sha}","languages_url":"https://api.github.com/repos/addy007-icy/xapian/languages","stargazers_url":"https://api.github.com/repos/addy007-icy/xapian/stargazers","contributors_url":"https://api.github.com/repos/addy007-icy/xapian/contributors","subscribers_url":"https://api.github.com/repos/addy007-icy/xapian/subscribers","subscription_url":"https://api.github.com/repos/addy007-icy/xapian/subscription","commits_url":"https://api.github.com/repos/addy007-icy/xapian/commits{/sha}","git_commits_url":"https://api.github.com/repos/addy007-icy/xapian/git/commits{/sha}","comments_url":"https://api.github.com/repos/addy007-icy/xapian/comments{/number}","issue_comment_url":"https://api.github.com/repos/addy007-icy/xapian/issues/comments{/number}","contents_url":"https://api.github.com/repos/addy007-icy/xapian/contents/{+path}","compare_url":"https://api.github.com/repos/addy007-icy/xapian/compare/{base}...{head}","merges_url":"https://api.github.com/repos/addy007-icy/xapian/merges","archive_url":"https://api.github.com/repos/addy007-icy/xapian/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/addy007-icy/xapian/downloads","issues_url":"https://api.github.com/repos/addy007-icy/xapian/issues{/number}","pulls_url":"https://api.github.com/repos/addy007-icy/xapian/pulls{/number}","milestones_url":"https://api.github.com/repos/addy007-icy/xapian/milestones{/number}","notifications_url":"https://api.github.com/repos/addy007-icy/xapian/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/addy007-icy/xapian/labels{/name}","releases_url":"https://api.github.com/repos/addy007-icy/xapian/releases{/id}","deployments_url":"https://api.github.com/repos/addy007-icy/xapian/deployments","created_at":"2018-03-13T02:47:14Z","updated_at":"2018-06-09T22:14:17Z","pushed_at":"2018-06-11T22:21:54Z","git_url":"git://github.com/addy007-icy/xapian.git","ssh_url":"git@github.com:addy007-icy/xapian.git","clone_url":"https://github.com/addy007-icy/xapian.git","svn_url":"https://github.com/addy007-icy/xapian","homepage":"https://xapian.org/","size":81812,"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,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xapian:master","ref":"master","sha":"4a9003e439b55c29275ed247118abf49bc7b3682","user":{"login":"xapian","id":312861,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMjg2MQ==","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,"node_id":"MDEwOlJlcG9zaXRvcnk3MzU5ODE=","name":"xapian","full_name":"xapian/xapian","owner":{"login":"xapian","id":312861,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMjg2MQ==","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":"2018-06-11T02:06:26Z","pushed_at":"2018-06-11T22:21:56Z","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":81911,"stargazers_count":416,"watchers_count":416,"language":"C++","has_issues":false,"has_projects":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":201,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":201,"open_issues":10,"watchers":416,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xapian/xapian/pulls/202"},"html":{"href":"https://github.com/xapian/xapian/pull/202"},"issue":{"href":"https://api.github.com/repos/xapian/xapian/issues/202"},"comments":{"href":"https://api.github.com/repos/xapian/xapian/issues/202/comments"},"review_comments":{"href":"https://api.github.com/repos/xapian/xapian/pulls/202/comments"},"review_comment":{"href":"https://api.github.com/repos/xapian/xapian/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xapian/xapian/pulls/202/commits"},"statuses":{"href":"https://api.github.com/repos/xapian/xapian/statuses/90cdc61f0516312cd607a0a251864d08b4f6ebf4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ojwb"}}