{"action":"created","comment":{"url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/comments/63832685","id":63832685,"diff_hunk":"@@ -35,12 +38,201 @@ TEST_CASE(\"Query can pass the settings to the dns level\") {\n     std::string tool = \"neubot\";\n \n     loop_with_initial_event([=]() {\n-        mlabns::query(\n-            tool, [](Error error, mlabns::Reply reply) {\n-                REQUIRE(error);\n+        mlabns::query(tool,\n+                      [](Error error, mlabns::Reply) {\n+                          REQUIRE(error);\n+                          break_loop();\n+                      },\n+                      settings);\n+    });\n+}\n+\n+TEST_CASE(\"Make sure that an error is passed to callback with invalid \"\n+          \"address_family settings\") {\n+    Settings settings;\n+    settings[\"mlabns/address_family\"] = \"ip4\"; // Invalid\n+    settings[\"mlabns/metro\"] = \"trn\";\n+    settings[\"mlabns/policy\"] = \"random\";\n+    std::string tool = \"neubot\";\n+\n+    loop_with_initial_event([=]() {\n+        mlabns::query(tool,\n+                      [](Error error, mlabns::Reply) {\n+                          REQUIRE(error);\n+                          break_loop();\n+                      },\n+                      settings);\n+    });\n+}\n+\n+TEST_CASE(\"Make sure that an error is passed to callback with invalid metro \"\n+          \"settings\") {\n+    Settings settings;\n+    settings[\"mlabns/address_family\"] = \"ipv4\";\n+    settings[\"mlabns/metro\"] = \"trno\"; // Invalid\n+    settings[\"mlabns/policy\"] = \"random\";\n+    std::string tool = \"neubot\";\n+\n+    loop_with_initial_event([=]() {\n+        mlabns::query(tool,\n+                      [](Error error, mlabns::Reply) {\n+                          REQUIRE(error);\n+                          break_loop();\n+                      },\n+                      settings);\n+    });\n+}\n+\n+TEST_CASE(\"Make sure that an error is passed to callback with invalid policy \"\n+          \"settings\") {\n+    Settings settings;\n+    settings[\"mlabns/address_family\"] = \"ipv4\";\n+    settings[\"mlabns/metro\"] = \"trn\";\n+    settings[\"mlabns/policy\"] = \"antani\"; // Invalid\n+    std::string tool = \"neubot\";\n+\n+    loop_with_initial_event([=]() {\n+        mlabns::query(tool,\n+                      [](Error error, mlabns::Reply) {\n+                          REQUIRE(error);\n+                          break_loop();\n+                      },\n+                      settings);\n+    });\n+}\n+\n+TEST_CASE(\"Make sure that an error is passed to callback with invalid tool \"\n+          \"settings\") {\n+    Settings settings;\n+    settings[\"mlabns/address_family\"] = \"ipv4\";\n+    settings[\"mlabns/metro\"] = \"trn\";\n+    settings[\"mlabns/policy\"] = \"random\";\n+    std::string tool = \"antani\"; // Invalid\n+\n+    loop_with_initial_event([=]() {\n+        mlabns::query(tool,\n+                      [](Error error, mlabns::Reply) {\n+                          REQUIRE(error);\n+                          break_loop();\n+                      },\n+                      settings);\n+    });\n+}\n+\n+MK_DEFINE_ERR(0001, MockError, \"mock_error 0001\")","path":"test/mlabns/mlabns.cpp","position":116,"original_position":116,"commit_id":"bb0283f567c9d59f549556a6481d444992d91a22","original_commit_id":"bb0283f567c9d59f549556a6481d444992d91a22","user":{"login":"bassosimone","id":337298,"avatar_url":"https://avatars.githubusercontent.com/u/337298?v=3","gravatar_id":"","url":"https://api.github.com/users/bassosimone","html_url":"https://github.com/bassosimone","followers_url":"https://api.github.com/users/bassosimone/followers","following_url":"https://api.github.com/users/bassosimone/following{/other_user}","gists_url":"https://api.github.com/users/bassosimone/gists{/gist_id}","starred_url":"https://api.github.com/users/bassosimone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bassosimone/subscriptions","organizations_url":"https://api.github.com/users/bassosimone/orgs","repos_url":"https://api.github.com/users/bassosimone/repos","events_url":"https://api.github.com/users/bassosimone/events{/privacy}","received_events_url":"https://api.github.com/users/bassosimone/received_events","type":"User","site_admin":false},"body":"Actually there is a `MockError` class defined in `<common/error.hpp>` that we should instead use here. I will apply this change as part of merging the pull request.","created_at":"2016-05-19T07:23:27Z","updated_at":"2016-05-19T07:23:27Z","html_url":"https://github.com/measurement-kit/measurement-kit/pull/606#discussion_r63832685","pull_request_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/606","_links":{"self":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/comments/63832685"},"html":{"href":"https://github.com/measurement-kit/measurement-kit/pull/606#discussion_r63832685"},"pull_request":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/606"}}},"pull_request":{"url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/606","id":70334030,"html_url":"https://github.com/measurement-kit/measurement-kit/pull/606","diff_url":"https://github.com/measurement-kit/measurement-kit/pull/606.diff","patch_url":"https://github.com/measurement-kit/measurement-kit/pull/606.patch","issue_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/606","number":606,"state":"open","locked":false,"title":"Add some mlabns tests","user":{"login":"AntonioLangiu","id":4649406,"avatar_url":"https://avatars.githubusercontent.com/u/4649406?v=3","gravatar_id":"","url":"https://api.github.com/users/AntonioLangiu","html_url":"https://github.com/AntonioLangiu","followers_url":"https://api.github.com/users/AntonioLangiu/followers","following_url":"https://api.github.com/users/AntonioLangiu/following{/other_user}","gists_url":"https://api.github.com/users/AntonioLangiu/gists{/gist_id}","starred_url":"https://api.github.com/users/AntonioLangiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AntonioLangiu/subscriptions","organizations_url":"https://api.github.com/users/AntonioLangiu/orgs","repos_url":"https://api.github.com/users/AntonioLangiu/repos","events_url":"https://api.github.com/users/AntonioLangiu/events{/privacy}","received_events_url":"https://api.github.com/users/AntonioLangiu/received_events","type":"User","site_admin":false},"body":"I added the tests listed in #465 \r\nI applyed clang-format as last commit.\r\n\r\nThis closes #465 and #399.","created_at":"2016-05-17T10:33:34Z","updated_at":"2016-05-19T07:23:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"070d2c3db87c472a1b9199c017e6172ec436c812","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/606/commits","review_comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/606/comments","review_comment_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/606/comments","statuses_url":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/bb0283f567c9d59f549556a6481d444992d91a22","head":{"label":"measurement-kit:feature/add-mlabns-tests","ref":"feature/add-mlabns-tests","sha":"bb0283f567c9d59f549556a6481d444992d91a22","user":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"repo":{"id":20287787,"name":"measurement-kit","full_name":"measurement-kit/measurement-kit","owner":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/measurement-kit/measurement-kit","description":"Portable C++11 network measurement library","fork":false,"url":"https://api.github.com/repos/measurement-kit/measurement-kit","forks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/forks","keys_url":"https://api.github.com/repos/measurement-kit/measurement-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/measurement-kit/measurement-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/measurement-kit/measurement-kit/teams","hooks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/hooks","issue_events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/events{/number}","events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/events","assignees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/assignees{/user}","branches_url":"https://api.github.com/repos/measurement-kit/measurement-kit/branches{/branch}","tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/tags","blobs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/measurement-kit/measurement-kit/languages","stargazers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/stargazers","contributors_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contributors","subscribers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscribers","subscription_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscription","commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contents/{+path}","compare_url":"https://api.github.com/repos/measurement-kit/measurement-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/measurement-kit/measurement-kit/merges","archive_url":"https://api.github.com/repos/measurement-kit/measurement-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/measurement-kit/measurement-kit/downloads","issues_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues{/number}","pulls_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/measurement-kit/measurement-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/measurement-kit/measurement-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/measurement-kit/measurement-kit/labels{/name}","releases_url":"https://api.github.com/repos/measurement-kit/measurement-kit/releases{/id}","deployments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/deployments","created_at":"2014-05-29T08:44:43Z","updated_at":"2016-05-16T09:38:04Z","pushed_at":"2016-05-19T07:15:47Z","git_url":"git://github.com/measurement-kit/measurement-kit.git","ssh_url":"git@github.com:measurement-kit/measurement-kit.git","clone_url":"https://github.com/measurement-kit/measurement-kit.git","svn_url":"https://github.com/measurement-kit/measurement-kit","homepage":"https://measurement-kit.github.io/","size":10829,"stargazers_count":17,"watchers_count":17,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":44,"forks":5,"open_issues":44,"watchers":17,"default_branch":"master"}},"base":{"label":"measurement-kit:master","ref":"master","sha":"f4bedc7abeedc6437f429546b13c5b7ea09ea055","user":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"repo":{"id":20287787,"name":"measurement-kit","full_name":"measurement-kit/measurement-kit","owner":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/measurement-kit/measurement-kit","description":"Portable C++11 network measurement library","fork":false,"url":"https://api.github.com/repos/measurement-kit/measurement-kit","forks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/forks","keys_url":"https://api.github.com/repos/measurement-kit/measurement-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/measurement-kit/measurement-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/measurement-kit/measurement-kit/teams","hooks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/hooks","issue_events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/events{/number}","events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/events","assignees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/assignees{/user}","branches_url":"https://api.github.com/repos/measurement-kit/measurement-kit/branches{/branch}","tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/tags","blobs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/measurement-kit/measurement-kit/languages","stargazers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/stargazers","contributors_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contributors","subscribers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscribers","subscription_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscription","commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contents/{+path}","compare_url":"https://api.github.com/repos/measurement-kit/measurement-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/measurement-kit/measurement-kit/merges","archive_url":"https://api.github.com/repos/measurement-kit/measurement-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/measurement-kit/measurement-kit/downloads","issues_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues{/number}","pulls_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/measurement-kit/measurement-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/measurement-kit/measurement-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/measurement-kit/measurement-kit/labels{/name}","releases_url":"https://api.github.com/repos/measurement-kit/measurement-kit/releases{/id}","deployments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/deployments","created_at":"2014-05-29T08:44:43Z","updated_at":"2016-05-16T09:38:04Z","pushed_at":"2016-05-19T07:15:47Z","git_url":"git://github.com/measurement-kit/measurement-kit.git","ssh_url":"git@github.com:measurement-kit/measurement-kit.git","clone_url":"https://github.com/measurement-kit/measurement-kit.git","svn_url":"https://github.com/measurement-kit/measurement-kit","homepage":"https://measurement-kit.github.io/","size":10829,"stargazers_count":17,"watchers_count":17,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":44,"forks":5,"open_issues":44,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/606"},"html":{"href":"https://github.com/measurement-kit/measurement-kit/pull/606"},"issue":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/606"},"comments":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/606/comments"},"review_comments":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/606/comments"},"review_comment":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/606/commits"},"statuses":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/bb0283f567c9d59f549556a6481d444992d91a22"}}}}