{"action":"created","issue":{"url":"https://api.github.com/repos/kinetiknz/cubeb/issues/274","repository_url":"https://api.github.com/repos/kinetiknz/cubeb","labels_url":"https://api.github.com/repos/kinetiknz/cubeb/issues/274/labels{/name}","comments_url":"https://api.github.com/repos/kinetiknz/cubeb/issues/274/comments","events_url":"https://api.github.com/repos/kinetiknz/cubeb/issues/274/events","html_url":"https://github.com/kinetiknz/cubeb/pull/274","id":219826846,"number":274,"title":"Using gtest style's error message in cubeb","user":{"login":"ChunMinChang","id":5111652,"avatar_url":"https://avatars0.githubusercontent.com/u/5111652?v=3","gravatar_id":"","url":"https://api.github.com/users/ChunMinChang","html_url":"https://github.com/ChunMinChang","followers_url":"https://api.github.com/users/ChunMinChang/followers","following_url":"https://api.github.com/users/ChunMinChang/following{/other_user}","gists_url":"https://api.github.com/users/ChunMinChang/gists{/gist_id}","starred_url":"https://api.github.com/users/ChunMinChang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChunMinChang/subscriptions","organizations_url":"https://api.github.com/users/ChunMinChang/orgs","repos_url":"https://api.github.com/users/ChunMinChang/repos","events_url":"https://api.github.com/users/ChunMinChang/events{/privacy}","received_events_url":"https://api.github.com/users/ChunMinChang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-06T08:46:44Z","updated_at":"2017-04-07T02:40:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kinetiknz/cubeb/pulls/274","html_url":"https://github.com/kinetiknz/cubeb/pull/274","diff_url":"https://github.com/kinetiknz/cubeb/pull/274.diff","patch_url":"https://github.com/kinetiknz/cubeb/pull/274.patch"},"body":"- Perfer ```fprintf(stderr, ...)``` instead of ```printf(...)```\r\n- Turn the error message into gtest's style\r\n\r\nWe have many patterns like the following:\r\n```\r\nif (r != CUBEB_OK) {\r\n    fprintf(stderr, \"Error initializing cubeb stream\\n\");\r\n    ASSERT_EQ(r, CUBEB_OK);\r\n}\r\n```\r\nWe should replace them by:\r\n```\r\nASSERT_EQ(r, CUBEB_OK) << \"Error initializing cubeb stream\";\r\n```"},"comment":{"url":"https://api.github.com/repos/kinetiknz/cubeb/issues/comments/292408416","html_url":"https://github.com/kinetiknz/cubeb/pull/274#issuecomment-292408416","issue_url":"https://api.github.com/repos/kinetiknz/cubeb/issues/274","id":292408416,"user":{"login":"kinetiknz","id":67343,"avatar_url":"https://avatars1.githubusercontent.com/u/67343?v=3","gravatar_id":"","url":"https://api.github.com/users/kinetiknz","html_url":"https://github.com/kinetiknz","followers_url":"https://api.github.com/users/kinetiknz/followers","following_url":"https://api.github.com/users/kinetiknz/following{/other_user}","gists_url":"https://api.github.com/users/kinetiknz/gists{/gist_id}","starred_url":"https://api.github.com/users/kinetiknz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinetiknz/subscriptions","organizations_url":"https://api.github.com/users/kinetiknz/orgs","repos_url":"https://api.github.com/users/kinetiknz/repos","events_url":"https://api.github.com/users/kinetiknz/events{/privacy}","received_events_url":"https://api.github.com/users/kinetiknz/received_events","type":"User","site_admin":false},"created_at":"2017-04-07T02:40:58Z","updated_at":"2017-04-07T02:40:58Z","body":"> For reasons not immediately obvious to me, scan-build on Travis is complaining about one of the changes\r\n\r\nI guess this is because the failure side of the assert returns from the test function and the analyzer can't see into (or doesn't understand) the guts of the success side (::testing::internal::CmpHelperNE) enough to realize that it should boil down to something equivalent to `!=` meaning the failure path is never taken if user_data is non-null.\r\n\r\nAnyway, the simple solution is to change the allocation of user_data to a unique_ptr, which makes the code slightly nicer anyway."}}
{"actor":{"display_login":"kinetiknz"}}