From: Derrick Stolee <stolee@gmail.com>
To: "René Scharfe" <l.s.r@web.de>, "Eric Sunshine" <sunshine@sunshineco.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>
Subject: Re: Git Test Coverage Report (Mon. Dec 9)
Date: Mon, 9 Dec 2019 13:23:22 -0500 [thread overview]
Message-ID: <676dc5c1-5823-ac83-878b-995f3793bfb8@gmail.com> (raw)
In-Reply-To: <a9c2c409-778c-48e2-e6d5-229eab45a707@web.de>
On 12/9/2019 1:10 PM, René Scharfe wrote:
> Am 09.12.19 um 18:44 schrieb Derrick Stolee:
>> On 12/9/2019 12:19 PM, Eric Sunshine wrote:
>>> On Mon, Dec 9, 2019 at 12:11 PM René Scharfe <l.s.r@web.de> wrote:
>>>> Am 09.12.19 um 16:36 schrieb Derrick Stolee:
>>>>> René Scharfe 0bb313a5 xdiff: unignore changes in function context
>>>>> xdiff/xemit.c
>>>>> 0bb313a5 223) xchp->i1 + xchp->chg1 <= s1 &&
>>>>> 0bb313a5 224) xchp->i2 + xchp->chg2 <= s2)
>>>>> 0bb313a5 225) xchp = xchp->next;
>>>>
>>>> Hmm, line 223 *is* exercised by t4015.85.
>>>
>>> This, along with Dscho's[1] review of an earlier coverage report,
>>> makes one wonder if there is some off-by-one error in the reporting
>>> logic, such that it is reporting the wrong lines as not covered.
>>
>> This is definitely possible. I'll see if I can locate the bug in
>> my report-generation code.
>>
>> However, line 222 is here [1]
>>
>> while (xchp != xch &&
>>
>> So if this is always false, then the rest of the while condition
>> will not be tested, nor will the body (line 225: xchp = xchp->next;).
>
> 0bb313a5 also added lines 228 and 229, which are not in the report, so
> xchp != xch must be true at least once (it is, in t4015.85).
>
> 222) while (xchp != xch &&
> 223) xchp->i1 + xchp->chg1 <= s1 &&
> 224) xchp->i2 + xchp->chg2 <= s2)
> 225) xchp = xchp->next;
> 226)
> 227) /* If so, show it after all. */
> 228) if (xchp != xch) {
> 229) xch = xchp;
Thanks for pointing out that context.
My guess is that gcov is marking the line as uncovered because the &&
operator is on that line. I'm testing [1] by breaking style conventions
and using the following:
while (xchp != xch
&& xchp->i1 + xchp->chg1 <= s1
&& xchp->i2 + xchp->chg2 <= s2)
xchp = xchp->next;
[1] https://dev.azure.com/git/git/_build/results?buildId=1453
next prev parent reply other threads:[~2019-12-09 18:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-09 15:36 Git Test Coverage Report (Mon. Dec 9) Derrick Stolee
2019-12-09 17:10 ` René Scharfe
2019-12-09 17:19 ` Eric Sunshine
2019-12-09 17:44 ` Derrick Stolee
2019-12-09 18:10 ` René Scharfe
2019-12-09 18:23 ` Derrick Stolee [this message]
2019-12-09 20:17 ` Derrick Stolee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=676dc5c1-5823-ac83-878b-995f3793bfb8@gmail.com \
--to=stolee@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=l.s.r@web.de \
--cc=peff@peff.net \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).