Uploaded image for project: 'SonarCFamily'
  1. SonarCFamily
  2. CPP-2879

Visual Studio coverage: Ignore coverage entries regarding lines exceeding the file length

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.17
    • Component/s: Code Coverage
    • Labels:
      None

      Description

      Visual Studio coverage can sometimes report on implicit generated code, this generated code for some reason is generated with line numbers exceeding the original file length.

      It can be reproduced by using fakeit.hpp with the following example:

      #include "fakeit.hpp"
      
      using namespace fakeit;
      ...
      TEST_METHOD(fakeItTest) {
        Mock<SomeInterface> mock;
        When(Method(mock,foo)).Return(1);
      }
      ...
      

      The code example leads to generate a coverage report which has some implicitly generated destructors having start_line = file lines number + 1.

        Attachments

          Activity

            People

            • Assignee:
              massimo.paladin Massimo PALADIN
              Reporter:
              massimo.paladin Massimo PALADIN
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: