[Ltp-coverage] Lcov issue

View: New views
2 Messages — Rating Filter:   Alert me  

[Ltp-coverage] Lcov issue

by vanson.dang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Dear All.

When I use Lcov to test code coverage. I see that. in some function, It return a value.
But return line never hit. I'm sure that return line hit. Why this error.
Ex
     162                 : sint16_t _scaling_4x4_dc(sint32_t* dc_values,   uint32_t* coded_level,  sint16_t* coded_run, sint16_t* coded_sign, const sint16_t* scan,
                                    _all_struct_t* _all_structs)
     163            1734 : {

     164                 :
     165             867 :     sint16_t i, j, coeffcnt = 0;

     166             867 :     sint32_t Level;

     167             867 :     sint16_t run = 0;

     168                 :
     169           14739 :     for (i = 0; i < 16 ; i++) { /* The part is designed to be one dimensional process */

     170           13872 :         j = scan[i];  /* mapping */

     171           13872 :         Level = (sint32_t)(abs((sint32_t) dc_values[j]));

     172           13872 :         if (Level != 0) {

     173            1357 :             coded_level[coeffcnt] = Level;

     174            1357 :             coded_sign[coeffcnt] = _sign(dc_values[j], _all_structs);

     175            1357 :             coded_run[coeffcnt] = run;

     176            1357 :             run = 0;

     177            1357 :             coeffcnt++;

     178                 :         } else {
     179                 :
     180           12515 :             run++;

     181                 :         }
     182                 :
     183                 :     }
     184             867 :     coded_level[coeffcnt] = 0;

     185                 :
     186               0 :     return coeffcnt;                         /* <-- why it not hit ? */

     187                 : }


Thank !
=========================================================
Dang, VAN SON, (Mr) <vanson.dang@...>
Embedded Software (ESW) Engineer
Panasonic Hanoi Laboratory
Panasonic R&D Center Vietnam Co., Ltd.
No.1 Lang Hoa-Lac Rd., Me Tri, Tu Liem, Hanoi, Vietnam
Tel: +84 4 3553 7211 Ext 115
Fax: +84 4 3553 7210
Tax code: 01 01 824243-003
==========================================================


"The information in this e-mail (including attachments) is confidential and is only intended for use by the addressee. If you are not the intended recipient or addressee, please notify us immediately. Any unauthorized disclosure, use or dissemination either in whole or in part is prohibited. Opinions, conclusions and other information contained in this message are personal opinions of the sender and do not necessarily represent the views of the Panasonic Group of companies."

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-coverage mailing list
Ltp-coverage@...
https://lists.sourceforge.net/lists/listinfo/ltp-coverage

Re: [Ltp-coverage] Lcov issue

by Peter Oberparleiter-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

vanson.dang@... wrote:
> Dear All.
>
> When I use Lcov to test code coverage. I see that. in some function, It return a value.
> But return line never hit. I'm sure that return line hit. Why this error.
[...]
>      184             867 :     coded_level[coeffcnt] = 0;
>
>      185                 :
>      186               0 :     return coeffcnt;                         /* <-- why it not hit ? */
>
>      187                 : }

If you specify optimization flags (-O) during compilation, try removing
those. GCC's code coverage instrumentation does not work well with code
optimization. See also the gcov man page for more information on the
possible effects of using optimization while testing code coverage.


Regards,
   Peter Oberparleiter


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-coverage mailing list
Ltp-coverage@...
https://lists.sourceforge.net/lists/listinfo/ltp-coverage