Problem with counting code coverage lines - return statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

We use your tool gcov, exactly lcov, for code coverage. It is important to us.
We find a problem with counting lines, when in return statement call the
other function and the arguments of the function are on two lines, because of alignment.

Sometimes it counts only first line, sometimes it counts both lines.
In my current project first line is counted 109 times, the second one is counted 14 times.

I send you the example of return statement, please see attachment.

I tried to find where the problem is.
Can you help me to fix it?

Kind regards,
Sara Graovac
Contactor Syrmia
Software Engineer
Virtualization

Office:
Djordja Stanojevica 12
11070 Belgrade, Serbia
Phone: +(381)-21-4831-210
E-mail: sara.graovac@xxxxxxx<mailto:sara.graovac@xxxxxxx>
               sara.graovac@xxxxxxxxxx<mailto:sara.graovac@xxxxxxxxxx>

Headquarters:
Syrmia LLC @ Belgrade Office Park
Djordja Stanojevica 12,
11070 Belgrade, Serbia
www.syrmia.com<http://www.syrmia.com/>

#include  <iostream>

using namespace std;

int f1(const char *name, const char *surname, uint32_t ages,
        const char *curr_addr){
        
        return ages;
}

int f2(bool val){
        const char *name = "Mary";
        const char *surname = "Connor";
        const char *addr = "123 Main St, Apartment 2 New York, NY 11111";
        if(val){
                return -1;
        }else{
                return f1(name, surname, 42,
                                addr);
        }
}

int main(){
        int ret = 0;
        ret = f2(false);
        cout << ret << endl;
        return 0;
}

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux