{"action":"created","comment":{"url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/pulls/comments/24345766","id":24345766,"diff_hunk":"@@ -0,0 +1,76 @@\n+/*  Copyright 2009 MaidSafe.net limited\n+\n+    This MaidSafe Software is licensed to you under (1) the MaidSafe.net Commercial License,\n+    version 1.0 or later, or (2) The General Public License (GPL), version 3, depending on which\n+    licence you accepted on initial access to the Software (the \"Licences\").\n+\n+    By contributing code to the MaidSafe Software, or to this project generally, you agree to be\n+    bound by the terms of the MaidSafe Contributor Agreement, version 1.0, found in the root\n+    directory of this project at LICENSE, COPYING and CONTRIBUTOR respectively and also\n+    available at: http://www.maidsafe.net/licenses\n+\n+    Unless required by applicable law or agreed to in writing, the MaidSafe Software distributed\n+    under the GPL Licence is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS\n+    OF ANY KIND, either express or implied.\n+\n+    See the Licences for the specific language governing permissions and limitations relating to\n+    use of the MaidSafe Software.                                                                 */\n+\n+#include \"maidsafe/common/test.h\"\n+#include \"maidsafe/common/convert.h\"\n+\n+namespace maidsafe {\n+\n+namespace test {\n+\n+template <class T>\n+void ToBoostThenBack(const T& value) {\n+  auto boost_value = common::convert::ToBoost(value);\n+  auto second_value = common::convert::ToAsio(boost_value);\n+  EXPECT_EQ(value, second_value);\n+}\n+\n+template <class T>\n+void ToAsioThenBack(const T& value) {\n+  auto boost_value = common::convert::ToAsio(value);\n+  auto second_value = common::convert::ToBoost(boost_value);\n+  EXPECT_EQ(value, second_value);\n+}\n+\n+TEST(Conversions, BEH_Address_v4) {\n+  auto ip = GetRandomIPv4AddressAsString();\n+  ToBoostThenBack(asio::ip::address_v4::from_string(ip));\n+  ToAsioThenBack(boost::asio::ip::address_v4::from_string(ip));\n+}\n+\n+TEST(Conversions, BEH_Address_v6) {\n+  auto ip = GetRandomIPv6AddressAsString();\n+  ToBoostThenBack(asio::ip::address_v6::from_string(ip));\n+  ToAsioThenBack(boost::asio::ip::address_v6::from_string(ip));\n+}\n+\n+TEST(Conversions, BEH_Address) {\n+  auto ip_v4 = GetRandomIPv4AddressAsString();\n+  ToBoostThenBack(asio::ip::address::from_string(ip_v4));\n+  ToAsioThenBack(boost::asio::ip::address::from_string(ip_v4));\n+  auto ip_v6 = GetRandomIPv6AddressAsString();","path":"src/maidsafe/common/tests/convert_test.cc","position":56,"original_position":56,"commit_id":"255f2f6c6d0bf47bce7fdb60946b0830650fad65","original_commit_id":"255f2f6c6d0bf47bce7fdb60946b0830650fad65","user":{"login":"Fraser999","id":190532,"avatar_url":"https://avatars.githubusercontent.com/u/190532?v=3","gravatar_id":"","url":"https://api.github.com/users/Fraser999","html_url":"https://github.com/Fraser999","followers_url":"https://api.github.com/users/Fraser999/followers","following_url":"https://api.github.com/users/Fraser999/following{/other_user}","gists_url":"https://api.github.com/users/Fraser999/gists{/gist_id}","starred_url":"https://api.github.com/users/Fraser999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fraser999/subscriptions","organizations_url":"https://api.github.com/users/Fraser999/orgs","repos_url":"https://api.github.com/users/Fraser999/repos","events_url":"https://api.github.com/users/Fraser999/events{/privacy}","received_events_url":"https://api.github.com/users/Fraser999/received_events","type":"User","site_admin":false},"body":"I was just thinking of the bug I had here, and that we should maybe also set the Scope ID to a random valid value for the IPv6 test.","created_at":"2015-02-09T17:18:55Z","updated_at":"2015-02-09T17:18:55Z","html_url":"https://github.com/maidsafe/MaidSafe-Common/pull/117#discussion_r24345766","pull_request_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/pulls/117","_links":{"self":{"href":"https://api.github.com/repos/maidsafe/MaidSafe-Common/pulls/comments/24345766"},"html":{"href":"https://github.com/maidsafe/MaidSafe-Common/pull/117#discussion_r24345766"},"pull_request":{"href":"https://api.github.com/repos/maidsafe/MaidSafe-Common/pulls/117"}}},"pull_request":{"url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/pulls/117","id":28934049,"html_url":"https://github.com/maidsafe/MaidSafe-Common/pull/117","diff_url":"https://github.com/maidsafe/MaidSafe-Common/pull/117.diff","patch_url":"https://github.com/maidsafe/MaidSafe-Common/pull/117.patch","issue_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/issues/117","number":117,"state":"open","locked":false,"title":"Adds conversion functions between Asio and Boost.Asio","user":{"login":"inetic","id":40127,"avatar_url":"https://avatars.githubusercontent.com/u/40127?v=3","gravatar_id":"","url":"https://api.github.com/users/inetic","html_url":"https://github.com/inetic","followers_url":"https://api.github.com/users/inetic/followers","following_url":"https://api.github.com/users/inetic/following{/other_user}","gists_url":"https://api.github.com/users/inetic/gists{/gist_id}","starred_url":"https://api.github.com/users/inetic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inetic/subscriptions","organizations_url":"https://api.github.com/users/inetic/orgs","repos_url":"https://api.github.com/users/inetic/repos","events_url":"https://api.github.com/users/inetic/events{/privacy}","received_events_url":"https://api.github.com/users/inetic/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-09T16:23:51Z","updated_at":"2015-02-09T17:18:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"20f42291d41d21a72e8cc82998707c80d49a7816","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/pulls/117/commits","review_comments_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/pulls/117/comments","review_comment_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/pulls/comments/{number}","comments_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/issues/117/comments","statuses_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/statuses/255f2f6c6d0bf47bce7fdb60946b0830650fad65","head":{"label":"inetic:MAID-769-boost_asio_conversios","ref":"MAID-769-boost_asio_conversios","sha":"255f2f6c6d0bf47bce7fdb60946b0830650fad65","user":{"login":"inetic","id":40127,"avatar_url":"https://avatars.githubusercontent.com/u/40127?v=3","gravatar_id":"","url":"https://api.github.com/users/inetic","html_url":"https://github.com/inetic","followers_url":"https://api.github.com/users/inetic/followers","following_url":"https://api.github.com/users/inetic/following{/other_user}","gists_url":"https://api.github.com/users/inetic/gists{/gist_id}","starred_url":"https://api.github.com/users/inetic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inetic/subscriptions","organizations_url":"https://api.github.com/users/inetic/orgs","repos_url":"https://api.github.com/users/inetic/repos","events_url":"https://api.github.com/users/inetic/events{/privacy}","received_events_url":"https://api.github.com/users/inetic/received_events","type":"User","site_admin":false},"repo":{"id":27740553,"name":"MaidSafe-Common","full_name":"inetic/MaidSafe-Common","owner":{"login":"inetic","id":40127,"avatar_url":"https://avatars.githubusercontent.com/u/40127?v=3","gravatar_id":"","url":"https://api.github.com/users/inetic","html_url":"https://github.com/inetic","followers_url":"https://api.github.com/users/inetic/followers","following_url":"https://api.github.com/users/inetic/following{/other_user}","gists_url":"https://api.github.com/users/inetic/gists{/gist_id}","starred_url":"https://api.github.com/users/inetic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inetic/subscriptions","organizations_url":"https://api.github.com/users/inetic/orgs","repos_url":"https://api.github.com/users/inetic/repos","events_url":"https://api.github.com/users/inetic/events{/privacy}","received_events_url":"https://api.github.com/users/inetic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/inetic/MaidSafe-Common","description":"Library of utility functions","fork":true,"url":"https://api.github.com/repos/inetic/MaidSafe-Common","forks_url":"https://api.github.com/repos/inetic/MaidSafe-Common/forks","keys_url":"https://api.github.com/repos/inetic/MaidSafe-Common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inetic/MaidSafe-Common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inetic/MaidSafe-Common/teams","hooks_url":"https://api.github.com/repos/inetic/MaidSafe-Common/hooks","issue_events_url":"https://api.github.com/repos/inetic/MaidSafe-Common/issues/events{/number}","events_url":"https://api.github.com/repos/inetic/MaidSafe-Common/events","assignees_url":"https://api.github.com/repos/inetic/MaidSafe-Common/assignees{/user}","branches_url":"https://api.github.com/repos/inetic/MaidSafe-Common/branches{/branch}","tags_url":"https://api.github.com/repos/inetic/MaidSafe-Common/tags","blobs_url":"https://api.github.com/repos/inetic/MaidSafe-Common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inetic/MaidSafe-Common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inetic/MaidSafe-Common/git/refs{/sha}","trees_url":"https://api.github.com/repos/inetic/MaidSafe-Common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inetic/MaidSafe-Common/statuses/{sha}","languages_url":"https://api.github.com/repos/inetic/MaidSafe-Common/languages","stargazers_url":"https://api.github.com/repos/inetic/MaidSafe-Common/stargazers","contributors_url":"https://api.github.com/repos/inetic/MaidSafe-Common/contributors","subscribers_url":"https://api.github.com/repos/inetic/MaidSafe-Common/subscribers","subscription_url":"https://api.github.com/repos/inetic/MaidSafe-Common/subscription","commits_url":"https://api.github.com/repos/inetic/MaidSafe-Common/commits{/sha}","git_commits_url":"https://api.github.com/repos/inetic/MaidSafe-Common/git/commits{/sha}","comments_url":"https://api.github.com/repos/inetic/MaidSafe-Common/comments{/number}","issue_comment_url":"https://api.github.com/repos/inetic/MaidSafe-Common/issues/comments/{number}","contents_url":"https://api.github.com/repos/inetic/MaidSafe-Common/contents/{+path}","compare_url":"https://api.github.com/repos/inetic/MaidSafe-Common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inetic/MaidSafe-Common/merges","archive_url":"https://api.github.com/repos/inetic/MaidSafe-Common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inetic/MaidSafe-Common/downloads","issues_url":"https://api.github.com/repos/inetic/MaidSafe-Common/issues{/number}","pulls_url":"https://api.github.com/repos/inetic/MaidSafe-Common/pulls{/number}","milestones_url":"https://api.github.com/repos/inetic/MaidSafe-Common/milestones{/number}","notifications_url":"https://api.github.com/repos/inetic/MaidSafe-Common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inetic/MaidSafe-Common/labels{/name}","releases_url":"https://api.github.com/repos/inetic/MaidSafe-Common/releases{/id}","created_at":"2014-12-08T23:35:47Z","updated_at":"2014-12-08T23:35:48Z","pushed_at":"2015-02-09T17:07:19Z","git_url":"git://github.com/inetic/MaidSafe-Common.git","ssh_url":"git@github.com:inetic/MaidSafe-Common.git","clone_url":"https://github.com/inetic/MaidSafe-Common.git","svn_url":"https://github.com/inetic/MaidSafe-Common","homepage":"https://github.com/maidsafe/MaidSafe-Common/wiki","size":9905,"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":"next"}},"base":{"label":"maidsafe:routing_v2","ref":"routing_v2","sha":"a1d10bfc2c108552bbe7fbf6354674ad00bc1273","user":{"login":"maidsafe","id":536423,"avatar_url":"https://avatars.githubusercontent.com/u/536423?v=3","gravatar_id":"","url":"https://api.github.com/users/maidsafe","html_url":"https://github.com/maidsafe","followers_url":"https://api.github.com/users/maidsafe/followers","following_url":"https://api.github.com/users/maidsafe/following{/other_user}","gists_url":"https://api.github.com/users/maidsafe/gists{/gist_id}","starred_url":"https://api.github.com/users/maidsafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maidsafe/subscriptions","organizations_url":"https://api.github.com/users/maidsafe/orgs","repos_url":"https://api.github.com/users/maidsafe/repos","events_url":"https://api.github.com/users/maidsafe/events{/privacy}","received_events_url":"https://api.github.com/users/maidsafe/received_events","type":"Organization","site_admin":false},"repo":{"id":1428711,"name":"MaidSafe-Common","full_name":"maidsafe/MaidSafe-Common","owner":{"login":"maidsafe","id":536423,"avatar_url":"https://avatars.githubusercontent.com/u/536423?v=3","gravatar_id":"","url":"https://api.github.com/users/maidsafe","html_url":"https://github.com/maidsafe","followers_url":"https://api.github.com/users/maidsafe/followers","following_url":"https://api.github.com/users/maidsafe/following{/other_user}","gists_url":"https://api.github.com/users/maidsafe/gists{/gist_id}","starred_url":"https://api.github.com/users/maidsafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maidsafe/subscriptions","organizations_url":"https://api.github.com/users/maidsafe/orgs","repos_url":"https://api.github.com/users/maidsafe/repos","events_url":"https://api.github.com/users/maidsafe/events{/privacy}","received_events_url":"https://api.github.com/users/maidsafe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/maidsafe/MaidSafe-Common","description":"Library of utility functions","fork":false,"url":"https://api.github.com/repos/maidsafe/MaidSafe-Common","forks_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/forks","keys_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/teams","hooks_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/hooks","issue_events_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/issues/events{/number}","events_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/events","assignees_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/assignees{/user}","branches_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/branches{/branch}","tags_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/tags","blobs_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/git/refs{/sha}","trees_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/statuses/{sha}","languages_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/languages","stargazers_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/stargazers","contributors_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/contributors","subscribers_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/subscribers","subscription_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/subscription","commits_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/commits{/sha}","git_commits_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/git/commits{/sha}","comments_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/comments{/number}","issue_comment_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/issues/comments/{number}","contents_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/contents/{+path}","compare_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/merges","archive_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/downloads","issues_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/issues{/number}","pulls_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/pulls{/number}","milestones_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/milestones{/number}","notifications_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/labels{/name}","releases_url":"https://api.github.com/repos/maidsafe/MaidSafe-Common/releases{/id}","created_at":"2011-03-02T01:03:24Z","updated_at":"2015-02-07T10:46:16Z","pushed_at":"2015-02-07T10:46:15Z","git_url":"git://github.com/maidsafe/MaidSafe-Common.git","ssh_url":"git@github.com:maidsafe/MaidSafe-Common.git","clone_url":"https://github.com/maidsafe/MaidSafe-Common.git","svn_url":"https://github.com/maidsafe/MaidSafe-Common","homepage":"https://github.com/maidsafe/MaidSafe-Common/wiki","size":15337,"stargazers_count":35,"watchers_count":35,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":4,"forks":24,"open_issues":4,"watchers":35,"default_branch":"next"}},"_links":{"self":{"href":"https://api.github.com/repos/maidsafe/MaidSafe-Common/pulls/117"},"html":{"href":"https://github.com/maidsafe/MaidSafe-Common/pull/117"},"issue":{"href":"https://api.github.com/repos/maidsafe/MaidSafe-Common/issues/117"},"comments":{"href":"https://api.github.com/repos/maidsafe/MaidSafe-Common/issues/117/comments"},"review_comments":{"href":"https://api.github.com/repos/maidsafe/MaidSafe-Common/pulls/117/comments"},"review_comment":{"href":"https://api.github.com/repos/maidsafe/MaidSafe-Common/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/maidsafe/MaidSafe-Common/pulls/117/commits"},"statuses":{"href":"https://api.github.com/repos/maidsafe/MaidSafe-Common/statuses/255f2f6c6d0bf47bce7fdb60946b0830650fad65"}}}}