{"action":"created","comment":{"url":"https://api.github.com/repos/Metaswitch/cpp-common-test/pulls/comments/71750201","id":71750201,"diff_hunk":"@@ -0,0 +1,127 @@\n+/**\n+ * @file resolver_test.cpp UT for BaseResolver class.\n+ *\n+ * Project Clearwater - IMS in the Cloud\n+ * Copyright (C) 2016  Metaswitch Networks Ltd\n+ *\n+ * This program is free software: you can redistribute it and/or modify it\n+ * under the terms of the GNU General Public License as published by the\n+ * Free Software Foundation, either version 3 of the License, or (at your\n+ * option) any later version, along with the \"Special Exception\" for use of\n+ * the program along with SSL, set forth below. This program is distributed\n+ * in the hope that it will be useful, but WITHOUT ANY WARRANTY;\n+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more\n+ * details. You should have received a copy of the GNU General Public\n+ * License along with this program.  If not, see\n+ * <http://www.gnu.org/licenses/>.\n+ *\n+ * The author can be reached by email at clearwater@metaswitch.com or by\n+ * post at Metaswitch Networks Ltd, 100 Church St, Enfield EN2 6BQ, UK\n+ *\n+ * Special Exception\n+ * Metaswitch Networks Ltd  grants you permission to copy, modify,\n+ * propagate, and distribute a work formed by combining OpenSSL with The\n+ * Software, or a work derivative of such a combination, even if such\n+ * copying, modification, propagation, or distribution would otherwise\n+ * violate the terms of the GPL. You must comply with the GPL in all\n+ * respects for all of the code used other than OpenSSL.\n+ * \"OpenSSL\" means OpenSSL toolkit software distributed by the OpenSSL\n+ * Project and licensed under the OpenSSL Licenses, or a work based on such\n+ * software and licensed under the OpenSSL Licenses.\n+ * \"OpenSSL Licenses\" means the OpenSSL License and Original SSLeay License\n+ * under which the OpenSSL Project distributes the OpenSSL toolkit software,\n+ * as those licenses appear in the file LICENSE-OPENSSL.\n+ */\n+\n+#include<resolver_test.h>\n+#include \"resolver_utils.h\"\n+#include \"test_interposer.hpp\"\n+\n+/// DNS Resolver is created with server address 0.0.0.0 to disable server\n+/// queries.\n+ResolverTest::ResolverTest() :\n+  _dnsresolver(\"0.0.0.0\")\n+{\n+  cwtest_completely_control_time();\n+}\n+\n+ResolverTest::~ResolverTest()\n+{\n+  cwtest_reset_time();\n+}\n+\n+AddrInfo ResolverTest::ip_to_addr_info(std::string address_str, int port, int transport)\n+{\n+  AddrInfo ai;\n+  BaseResolver::parse_ip_target(address_str, ai.address);","path":"src/ut/resolver_test.cpp","position":57,"original_position":57,"commit_id":"d00434a1795568bbf5acb2a035f0f8f46c194534","original_commit_id":"d00434a1795568bbf5acb2a035f0f8f46c194534","user":{"login":"AlexHockey","id":4903205,"avatar_url":"https://avatars.githubusercontent.com/u/4903205?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexHockey","html_url":"https://github.com/AlexHockey","followers_url":"https://api.github.com/users/AlexHockey/followers","following_url":"https://api.github.com/users/AlexHockey/following{/other_user}","gists_url":"https://api.github.com/users/AlexHockey/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexHockey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexHockey/subscriptions","organizations_url":"https://api.github.com/users/AlexHockey/orgs","repos_url":"https://api.github.com/users/AlexHockey/repos","events_url":"https://api.github.com/users/AlexHockey/events{/privacy}","received_events_url":"https://api.github.com/users/AlexHockey/received_events","type":"User","site_admin":false},"body":"OK, so `ip_to_addr_info` is a utility method of the test framework, but it uses a function from the production code. This is something you should avoid if possible as it makes it more likely that a bug in the production code may get missed by the tests. Ideally you would implement `ip_to_addr_info` completely separately. In this case I'm not too worried, as I think the separate implementation would be almost exactly the same as the production code, but bear this in mind in the future.  ","created_at":"2016-07-21T17:32:39Z","updated_at":"2016-07-21T17:32:39Z","html_url":"https://github.com/Metaswitch/cpp-common-test/pull/24#discussion_r71750201","pull_request_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/Metaswitch/cpp-common-test/pulls/comments/71750201"},"html":{"href":"https://github.com/Metaswitch/cpp-common-test/pull/24#discussion_r71750201"},"pull_request":{"href":"https://api.github.com/repos/Metaswitch/cpp-common-test/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/Metaswitch/cpp-common-test/pulls/24","id":78285546,"html_url":"https://github.com/Metaswitch/cpp-common-test/pull/24","diff_url":"https://github.com/Metaswitch/cpp-common-test/pull/24.diff","patch_url":"https://github.com/Metaswitch/cpp-common-test/pull/24.patch","issue_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/issues/24","number":24,"state":"open","locked":false,"title":"Reviewer: [AJH] HTTP Graylisting","user":{"login":"TJW2","id":20281378,"avatar_url":"https://avatars.githubusercontent.com/u/20281378?v=3","gravatar_id":"","url":"https://api.github.com/users/TJW2","html_url":"https://github.com/TJW2","followers_url":"https://api.github.com/users/TJW2/followers","following_url":"https://api.github.com/users/TJW2/following{/other_user}","gists_url":"https://api.github.com/users/TJW2/gists{/gist_id}","starred_url":"https://api.github.com/users/TJW2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TJW2/subscriptions","organizations_url":"https://api.github.com/users/TJW2/orgs","repos_url":"https://api.github.com/users/TJW2/repos","events_url":"https://api.github.com/users/TJW2/events{/privacy}","received_events_url":"https://api.github.com/users/TJW2/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-21T09:38:27Z","updated_at":"2016-07-21T17:32:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb32f6dabd8693df1ce996305d9e8407d15196b6","assignee":{"login":"AlexHockey","id":4903205,"avatar_url":"https://avatars.githubusercontent.com/u/4903205?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexHockey","html_url":"https://github.com/AlexHockey","followers_url":"https://api.github.com/users/AlexHockey/followers","following_url":"https://api.github.com/users/AlexHockey/following{/other_user}","gists_url":"https://api.github.com/users/AlexHockey/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexHockey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexHockey/subscriptions","organizations_url":"https://api.github.com/users/AlexHockey/orgs","repos_url":"https://api.github.com/users/AlexHockey/repos","events_url":"https://api.github.com/users/AlexHockey/events{/privacy}","received_events_url":"https://api.github.com/users/AlexHockey/received_events","type":"User","site_admin":false},"assignees":[{"login":"AlexHockey","id":4903205,"avatar_url":"https://avatars.githubusercontent.com/u/4903205?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexHockey","html_url":"https://github.com/AlexHockey","followers_url":"https://api.github.com/users/AlexHockey/followers","following_url":"https://api.github.com/users/AlexHockey/following{/other_user}","gists_url":"https://api.github.com/users/AlexHockey/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexHockey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexHockey/subscriptions","organizations_url":"https://api.github.com/users/AlexHockey/orgs","repos_url":"https://api.github.com/users/AlexHockey/repos","events_url":"https://api.github.com/users/AlexHockey/events{/privacy}","received_events_url":"https://api.github.com/users/AlexHockey/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/pulls/24/commits","review_comments_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/pulls/24/comments","review_comment_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/issues/24/comments","statuses_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/statuses/d00434a1795568bbf5acb2a035f0f8f46c194534","head":{"label":"Metaswitch:http-graylisting","ref":"http-graylisting","sha":"d00434a1795568bbf5acb2a035f0f8f46c194534","user":{"login":"Metaswitch","id":453759,"avatar_url":"https://avatars.githubusercontent.com/u/453759?v=3","gravatar_id":"","url":"https://api.github.com/users/Metaswitch","html_url":"https://github.com/Metaswitch","followers_url":"https://api.github.com/users/Metaswitch/followers","following_url":"https://api.github.com/users/Metaswitch/following{/other_user}","gists_url":"https://api.github.com/users/Metaswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Metaswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metaswitch/subscriptions","organizations_url":"https://api.github.com/users/Metaswitch/orgs","repos_url":"https://api.github.com/users/Metaswitch/repos","events_url":"https://api.github.com/users/Metaswitch/events{/privacy}","received_events_url":"https://api.github.com/users/Metaswitch/received_events","type":"Organization","site_admin":false},"repo":{"id":51383776,"name":"cpp-common-test","full_name":"Metaswitch/cpp-common-test","owner":{"login":"Metaswitch","id":453759,"avatar_url":"https://avatars.githubusercontent.com/u/453759?v=3","gravatar_id":"","url":"https://api.github.com/users/Metaswitch","html_url":"https://github.com/Metaswitch","followers_url":"https://api.github.com/users/Metaswitch/followers","following_url":"https://api.github.com/users/Metaswitch/following{/other_user}","gists_url":"https://api.github.com/users/Metaswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Metaswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metaswitch/subscriptions","organizations_url":"https://api.github.com/users/Metaswitch/orgs","repos_url":"https://api.github.com/users/Metaswitch/repos","events_url":"https://api.github.com/users/Metaswitch/events{/privacy}","received_events_url":"https://api.github.com/users/Metaswitch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Metaswitch/cpp-common-test","description":"UTs for cpp-common","fork":false,"url":"https://api.github.com/repos/Metaswitch/cpp-common-test","forks_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/forks","keys_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/teams","hooks_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/hooks","issue_events_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/issues/events{/number}","events_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/events","assignees_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/assignees{/user}","branches_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/branches{/branch}","tags_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/tags","blobs_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/git/refs{/sha}","trees_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/statuses/{sha}","languages_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/languages","stargazers_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/stargazers","contributors_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/contributors","subscribers_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/subscribers","subscription_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/subscription","commits_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/commits{/sha}","git_commits_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/git/commits{/sha}","comments_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/comments{/number}","issue_comment_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/issues/comments{/number}","contents_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/contents/{+path}","compare_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/merges","archive_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/downloads","issues_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/issues{/number}","pulls_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/pulls{/number}","milestones_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/milestones{/number}","notifications_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/labels{/name}","releases_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/releases{/id}","deployments_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/deployments","created_at":"2016-02-09T17:23:30Z","updated_at":"2016-02-15T14:19:52Z","pushed_at":"2016-07-21T16:22:39Z","git_url":"git://github.com/Metaswitch/cpp-common-test.git","ssh_url":"git@github.com:Metaswitch/cpp-common-test.git","clone_url":"https://github.com/Metaswitch/cpp-common-test.git","svn_url":"https://github.com/Metaswitch/cpp-common-test","homepage":null,"size":159,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"Metaswitch:master","ref":"master","sha":"beda70415937d641332d365f46ec86dbc303a9a0","user":{"login":"Metaswitch","id":453759,"avatar_url":"https://avatars.githubusercontent.com/u/453759?v=3","gravatar_id":"","url":"https://api.github.com/users/Metaswitch","html_url":"https://github.com/Metaswitch","followers_url":"https://api.github.com/users/Metaswitch/followers","following_url":"https://api.github.com/users/Metaswitch/following{/other_user}","gists_url":"https://api.github.com/users/Metaswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Metaswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metaswitch/subscriptions","organizations_url":"https://api.github.com/users/Metaswitch/orgs","repos_url":"https://api.github.com/users/Metaswitch/repos","events_url":"https://api.github.com/users/Metaswitch/events{/privacy}","received_events_url":"https://api.github.com/users/Metaswitch/received_events","type":"Organization","site_admin":false},"repo":{"id":51383776,"name":"cpp-common-test","full_name":"Metaswitch/cpp-common-test","owner":{"login":"Metaswitch","id":453759,"avatar_url":"https://avatars.githubusercontent.com/u/453759?v=3","gravatar_id":"","url":"https://api.github.com/users/Metaswitch","html_url":"https://github.com/Metaswitch","followers_url":"https://api.github.com/users/Metaswitch/followers","following_url":"https://api.github.com/users/Metaswitch/following{/other_user}","gists_url":"https://api.github.com/users/Metaswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Metaswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metaswitch/subscriptions","organizations_url":"https://api.github.com/users/Metaswitch/orgs","repos_url":"https://api.github.com/users/Metaswitch/repos","events_url":"https://api.github.com/users/Metaswitch/events{/privacy}","received_events_url":"https://api.github.com/users/Metaswitch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Metaswitch/cpp-common-test","description":"UTs for cpp-common","fork":false,"url":"https://api.github.com/repos/Metaswitch/cpp-common-test","forks_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/forks","keys_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/teams","hooks_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/hooks","issue_events_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/issues/events{/number}","events_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/events","assignees_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/assignees{/user}","branches_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/branches{/branch}","tags_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/tags","blobs_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/git/refs{/sha}","trees_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/statuses/{sha}","languages_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/languages","stargazers_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/stargazers","contributors_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/contributors","subscribers_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/subscribers","subscription_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/subscription","commits_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/commits{/sha}","git_commits_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/git/commits{/sha}","comments_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/comments{/number}","issue_comment_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/issues/comments{/number}","contents_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/contents/{+path}","compare_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/merges","archive_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/downloads","issues_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/issues{/number}","pulls_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/pulls{/number}","milestones_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/milestones{/number}","notifications_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/labels{/name}","releases_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/releases{/id}","deployments_url":"https://api.github.com/repos/Metaswitch/cpp-common-test/deployments","created_at":"2016-02-09T17:23:30Z","updated_at":"2016-02-15T14:19:52Z","pushed_at":"2016-07-21T16:22:39Z","git_url":"git://github.com/Metaswitch/cpp-common-test.git","ssh_url":"git@github.com:Metaswitch/cpp-common-test.git","clone_url":"https://github.com/Metaswitch/cpp-common-test.git","svn_url":"https://github.com/Metaswitch/cpp-common-test","homepage":null,"size":159,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Metaswitch/cpp-common-test/pulls/24"},"html":{"href":"https://github.com/Metaswitch/cpp-common-test/pull/24"},"issue":{"href":"https://api.github.com/repos/Metaswitch/cpp-common-test/issues/24"},"comments":{"href":"https://api.github.com/repos/Metaswitch/cpp-common-test/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/Metaswitch/cpp-common-test/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/Metaswitch/cpp-common-test/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Metaswitch/cpp-common-test/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/Metaswitch/cpp-common-test/statuses/d00434a1795568bbf5acb2a035f0f8f46c194534"}}}}
{"actor":{"display_login":"AlexHockey"}}