{"action":"created","issue":{"url":"https://api.github.com/repos/citrix-openstack/git-coverage/issues/4","repository_url":"https://api.github.com/repos/citrix-openstack/git-coverage","labels_url":"https://api.github.com/repos/citrix-openstack/git-coverage/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/citrix-openstack/git-coverage/issues/4/comments","events_url":"https://api.github.com/repos/citrix-openstack/git-coverage/issues/4/events","html_url":"https://github.com/citrix-openstack/git-coverage/pull/4","id":188966768,"number":4,"title":"Fix always FULLY COVERED","user":{"login":"benjaminfuchs","id":17890112,"avatar_url":"https://avatars.githubusercontent.com/u/17890112?v=3","gravatar_id":"","url":"https://api.github.com/users/benjaminfuchs","html_url":"https://github.com/benjaminfuchs","followers_url":"https://api.github.com/users/benjaminfuchs/followers","following_url":"https://api.github.com/users/benjaminfuchs/following{/other_user}","gists_url":"https://api.github.com/users/benjaminfuchs/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminfuchs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminfuchs/subscriptions","organizations_url":"https://api.github.com/users/benjaminfuchs/orgs","repos_url":"https://api.github.com/users/benjaminfuchs/repos","events_url":"https://api.github.com/users/benjaminfuchs/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminfuchs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-13T12:06:32Z","updated_at":"2016-11-14T22:28:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/citrix-openstack/git-coverage/pulls/4","html_url":"https://github.com/citrix-openstack/git-coverage/pull/4","diff_url":"https://github.com/citrix-openstack/git-coverage/pull/4.diff","patch_url":"https://github.com/citrix-openstack/git-coverage/pull/4.patch"},"body":"First of all, very cool tool! :+1: \r\nI just tried it with a little gcov example today and always got the message *FULLY COVERED*. I tried my best and guess I found the bug:\r\n\r\n##### BEFORE CHANGE #####\r\n```\r\ngcov_example $ git-coverage  \r\nFULLY COVERED FILE: main.c\r\n```\r\n##### AFTER CHANGE #####\r\n```\r\ngcov_example $ git-coverage  \r\n--- a/main.c\r\n+++ b/main.c\r\n@@ -32,6 +32,7 @@ int main () {\r\n      }\r\n      else {\r\n!+        cout << \"NEW DEAD CODE\";\r\n      }\r\n  \r\n      return 0;\r\n```\r\n##### GCOV VERSION #####\r\n```\r\ngcov_example $ gcov -v  \r\ngcov (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609\r\nCopyright (C) 2015 Free Software Foundation, Inc.\r\nThis is free software; see the source for copying conditions.\r\nThere is NO warranty; not even for MERCHANTABILITY or \r\nFITNESS FOR A PARTICULAR PURPOSE.\r\n```"},"comment":{"url":"https://api.github.com/repos/citrix-openstack/git-coverage/issues/comments/260484151","html_url":"https://github.com/citrix-openstack/git-coverage/pull/4#issuecomment-260484151","issue_url":"https://api.github.com/repos/citrix-openstack/git-coverage/issues/4","id":260484151,"user":{"login":"benjaminfuchs","id":17890112,"avatar_url":"https://avatars.githubusercontent.com/u/17890112?v=3","gravatar_id":"","url":"https://api.github.com/users/benjaminfuchs","html_url":"https://github.com/benjaminfuchs","followers_url":"https://api.github.com/users/benjaminfuchs/followers","following_url":"https://api.github.com/users/benjaminfuchs/following{/other_user}","gists_url":"https://api.github.com/users/benjaminfuchs/gists{/gist_id}","starred_url":"https://api.github.com/users/benjaminfuchs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjaminfuchs/subscriptions","organizations_url":"https://api.github.com/users/benjaminfuchs/orgs","repos_url":"https://api.github.com/users/benjaminfuchs/repos","events_url":"https://api.github.com/users/benjaminfuchs/events{/privacy}","received_events_url":"https://api.github.com/users/benjaminfuchs/received_events","type":"User","site_admin":false},"created_at":"2016-11-14T22:28:41Z","updated_at":"2016-11-14T22:28:41Z","body":"Okay it seems to be a bit more tricky....\r\nHere is my file:\r\n```\r\n/*\r\n * Example for use of gcov\r\n * \r\n */\r\n\r\n#include <iostream>\r\n\r\nusing namespace std;\r\n\r\nclass Dummy {\r\npublic:\r\n    void func_a() { \r\n        cout << \"Hello \\n\";\r\n    }\r\n    void func_b() {\r\n        cout << \"World!\\n\";\r\n    }\r\n    int func_c() { return 1; }\r\n        \r\n};\r\n\r\nint main () {\r\n    Dummy oDummy;\r\n\r\n    int c = oDummy.func_c();\r\n\r\n    if(c)\r\n    {\r\n        oDummy.func_a();\r\n    } else if (c > 2) {\r\n        oDummy.func_b();\r\n    }\r\n    else {\r\n        cout << \"DEAD CODE\";\r\n        cout << \"DEAD CODE\";\r\n    }\r\n\r\n    return 0;\r\n}\r\n```\r\nIf I add a print(line) to the coverage function I get following output:\r\n\r\n```\r\n/home/fuchs/github/gcov_example/main.c.gcov\r\n        -:    0:Source:main.c\r\n        -:    0:Graph:/home/fuchs/github/gcov_example/main.gcno\r\n        -:    0:Data:/home/fuchs/github/gcov_example/main.gcda\r\n        -:    0:Runs:1\r\n        -:    0:Programs:1\r\n        -:    1:/*\r\n        -:    2: * Example for use of gcov\r\n        -:    3: *\r\n        -:    4: */\r\n        -:    5:\r\n        -:    6:#include <iostream>\r\n        -:    7:\r\n        -:    8:using namespace std;\r\n        -:    9:\r\n        -:   10:class Dummy {\r\n        -:   11:public:\r\n        1:   12:    void func_a() {\r\n        1:   13:        cout << \"Hello \\n\";\r\n        1:   14:    }\r\n    #####:   15:    void func_b() {\r\n    #####:   16:        cout << \"World!\\n\";\r\n    #####:   17:    }\r\n        1:   18:    int func_c() { return 1; }\r\n        -:   19:\r\n        -:   20:};\r\n        -:   21:\r\n        1:   22:int main () {\r\n        -:   23:    Dummy oDummy;\r\n        -:   24:\r\n        1:   25:    int c = oDummy.func_c();\r\n        -:   26:\r\n        1:   27:    if(c)\r\n        -:   28:    {\r\n        1:   29:        oDummy.func_a();\r\n    #####:   30:    } else if (c > 2) {\r\n    #####:   31:        oDummy.func_b();\r\n        -:   32:    }\r\n        -:   33:    else {\r\n    #####:   34:        cout << \"DEAD CODE\";\r\n    #####:   35:        cout << \"DEAD CODE\";\r\n        -:   36:    }\r\n        -:   37:\r\n        1:   38:    return 0;\r\n        3:   39:}\r\n/home/fuchs/github/gcov_example/#usr#include#c++#5#iostream.gcov\r\n        -:    0:Source:/usr/include/c++/5/iostream\r\n        -:    0:Graph:/home/fuchs/github/gcov_example/main.gcno\r\n        -:    0:Data:/home/fuchs/github/gcov_example/main.gcda\r\n        -:    0:Runs:1\r\n        -:    0:Programs:1\r\n        -:    1:// Standard iostream objects -*- C++ -*-\r\n        -:    2:\r\n        -:    3:// Copyright (C) 1997-2015 Free Software Foundation, Inc.\r\n        -:    4://\r\n        -:    5:// This file is part of the GNU ISO C++ Library.  This library is free\r\n        -:    6:// software; you can redistribute it and/or modify it under the\r\n        -:    7:// terms of the GNU General Public License as published by the\r\n        -:    8:// Free Software Foundation; either version 3, or (at your option)\r\n        -:    9:// any later version.\r\n        -:   10:\r\n        -:   11:// This library is distributed in the hope that it will be useful,\r\n        -:   12:// but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n        -:   13:// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n        -:   14:// GNU General Public License for more details.\r\n        -:   15:\r\n        -:   16:// Under Section 7 of GPL version 3, you are granted additional\r\n        -:   17:// permissions described in the GCC Runtime Library Exception, version\r\n        -:   18:// 3.1, as published by the Free Software Foundation.\r\n        -:   19:\r\n        -:   20:// You should have received a copy of the GNU General Public License and\r\n        -:   21:// a copy of the GCC Runtime Library Exception along with this program;\r\n        -:   22:// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see\r\n        -:   23:// <http://www.gnu.org/licenses/>.\r\n        -:   24:\r\n        -:   25:/** @file include/iostream\r\n        -:   26: *  This is a Standard C++ Library header.\r\n        -:   27: */\r\n        -:   28:\r\n        -:   29://\r\n        -:   30:// ISO C++ 14882: 27.3  Standard iostream objects\r\n        -:   31://\r\n        -:   32:\r\n        -:   33:#ifndef _GLIBCXX_IOSTREAM\r\n        -:   34:#define _GLIBCXX_IOSTREAM 1\r\n        -:   35:\r\n        -:   36:#pragma GCC system_header\r\n        -:   37:\r\n        -:   38:#include <bits/c++config.h>\r\n        -:   39:#include <ostream>\r\n        -:   40:#include <istream>\r\n        -:   41:\r\n        -:   42:namespace std _GLIBCXX_VISIBILITY(default)\r\n        -:   43:{\r\n        -:   44:_GLIBCXX_BEGIN_NAMESPACE_VERSION\r\n        -:   45:\r\n        -:   46:  /**\r\n        -:   47:   *  @name Standard Stream Objects\r\n        -:   48:   *\r\n        -:   49:   *  The &lt;iostream&gt; header declares the eight <em>standard stream\r\n        -:   50:   *  objects</em>.  For other declarations, see\r\n        -:   51:   *  http://gcc.gnu.org/onlinedocs/libstdc++/manual/io.html\r\n        -:   52:   *  and the @link iosfwd I/O forward declarations @endlink\r\n        -:   53:   *\r\n        -:   54:   *  They are required by default to cooperate with the global C\r\n        -:   55:   *  library's @c FILE streams, and to be available during program\r\n        -:   56:   *  startup and termination. For more information, see the section of the\r\n        -:   57:   *  manual linked to above.\r\n        -:   58:  */\r\n        -:   59:  //@{\r\n        -:   60:  extern istream cin;\t\t/// Linked to standard input\r\n        -:   61:  extern ostream cout;\t\t/// Linked to standard output\r\n        -:   62:  extern ostream cerr;\t\t/// Linked to standard error (unbuffered)\r\n        -:   63:  extern ostream clog;\t\t/// Linked to standard error (buffered)\r\n        -:   64:\r\n        -:   65:#ifdef _GLIBCXX_USE_WCHAR_T\r\n        -:   66:  extern wistream wcin;\t\t/// Linked to standard input\r\n        -:   67:  extern wostream wcout;\t/// Linked to standard output\r\n        -:   68:  extern wostream wcerr;\t/// Linked to standard error (unbuffered)\r\n        -:   69:  extern wostream wclog;\t/// Linked to standard error (buffered)\r\n        -:   70:#endif\r\n        -:   71:  //@}\r\n        -:   72:\r\n        -:   73:  // For construction of filebuffers for cout, cin, cerr, clog et. al.\r\n        1:   74:  static ios_base::Init __ioinit;\r\n        -:   75:\r\n        -:   76:_GLIBCXX_END_NAMESPACE_VERSION\r\n        -:   77:} // namespace\r\n        -:   78:\r\n        -:   79:#endif /* _GLIBCXX_IOSTREAM */\r\nFULLY COVERED FILE: main.c\r\n```\r\n\r\nSo seems my fix was fixing the wrong place.\r\nWhat confuese me is the *#usr#include#c++#5#iostream.gcov*\r\nMaybe there is a wrong coding or something like that."}}
{"actor":{"display_login":"benjaminfuchs"}}