git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Michael Platings <michael@platin.gs>
To: Derrick Stolee <stolee@gmail.com>
Cc: GIT Mailing-list <git@vger.kernel.org>,
	Barret Rhoden <brho@google.com>,
	Jonathan Tan <jonathantanmy@google.com>
Subject: Re: Git Test Coverage Report (Thursday, May 30th)
Date: Sat, 1 Jun 2019 22:22:09 +0100	[thread overview]
Message-ID: <CAJDYR9QAWVJxn7cf1DQbnZTKeSGJPCXcTJT9FVNEDpf1bimtGg@mail.gmail.com> (raw)
In-Reply-To: <e18e4391-a574-1f4b-88c7-890ada116f51@gmail.com>

Thanks very much for this Derrick. I looked into it and it turns out
that the missing coverage in blame.c for "certainties[i] =
CERTAINTY_NOT_CALCULATED" was due to earlier code overwriting the same
value in most cases, thereby defeating an optimization. I've deleted
that earlier code and now coverage is as expected. I posted the patch
here: https://public-inbox.org/git/20190601210925.15339-1-michael@platin.gs/T/#u
I also deleted the other uncovered code that appeared in the same
patch as it was unreachable.

> On 5/30/2019 8:52 AM, Derrick Stolee wrote:
> > blame.c
> > 170072f9 846)     (result[i] >= most_certain_line_a ||
> > 170072f9 847)      second_best_result[i] >= most_certain_line_a)) {
> > 170072f9 848) certainties[i] = CERTAINTY_NOT_CALCULATED;
>
> This section appears in the following block:
>
>         /* More invalidating of results that may be affected by the choice of
>          * most certain line.
>          * Discard the matches for lines in B that are currently matched with a
>          * line in A such that their ordering contradicts the ordering imposed
>          * by the choice of most certain line.
>          */
>         for (i = most_certain_local_line_b - 1; i >= invalidate_min; --i) {
>                 /* In this loop we discard results for lines in B that are
>                  * before most-certain-line-B but are matched with a line in A
>                  * that is after most-certain-line-A.
>                  */
>                 if (certainties[i] >= 0 &&
>                     (result[i] >= most_certain_line_a ||
>                      second_best_result[i] >= most_certain_line_a)) {
>                         certainties[i] = CERTAINTY_NOT_CALCULATED;
>                 }
>         }
>         for (i = most_certain_local_line_b + 1; i < invalidate_max; ++i) {
>                 /* In this loop we discard results for lines in B that are
>                  * after most-certain-line-B but are matched with a line in A
>                  * that is before most-certain-line-A.
>                  */
>                 if (certainties[i] >= 0 &&
>                     (result[i] <= most_certain_line_a ||
>                      second_best_result[i] <= most_certain_line_a)) {
>                         certainties[i] = CERTAINTY_NOT_CALCULATED;
>                 }
>         }
>
> Note that the first for loop includes the uncovered lines. The logical operands
> are backwards of the conditions in the second for loop, which are covered. This
> seems non-trivial enough to merit a test.

  parent reply	other threads:[~2019-06-01 21:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30 12:52 Git Test Coverage Report (Thursday, May 30th) Derrick Stolee
2019-05-30 18:24 ` Derrick Stolee
2019-05-31 17:51   ` Derrick Stolee
2019-05-31 18:59     ` Johannes Schindelin
2019-06-01 21:22   ` Michael Platings [this message]
2019-06-03 18:11   ` Barret Rhoden
2019-06-03 18:40     ` Derrick Stolee
2019-06-04 16:38       ` Barret Rhoden
2019-06-04 20:41         ` Barret Rhoden
2019-06-05  0:57           ` Derrick Stolee
2019-06-10 15:15             ` Barret Rhoden

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJDYR9QAWVJxn7cf1DQbnZTKeSGJPCXcTJT9FVNEDpf1bimtGg@mail.gmail.com \
    --to=michael@platin.gs \
    --cc=brho@google.com \
    --cc=git@vger.kernel.org \
    --cc=jonathantanmy@google.com \
    --cc=stolee@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).