git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git Test Coverage Report (Thursday, May 30th)

From
BRBarret Rhoden <brho@google.com>
Date
Jun 3, 2019, 18:11 UTC
Message-ID
<b4ce9cbc-71d3-4d7f-1ee2-e4e3fc23b015@google.com>
In-Reply-To
<e18e4391-a574-1f4b-88c7-890ada116f51@gmail.com>
Hi -
On 5/30/19 2:24 PM, Derrick Stolee wrote:
Show 22 quoted lines
>> 8934ac8c 1190)     ent->ignored == next->ignored &&
>> 8934ac8c 1191)     ent->unblamable == next->unblamable) {
> These lines are part of this diff:
> 
> --- a/blame.c
> +++ b/blame.c
> @@ -479,7 +479,9 @@ void blame_coalesce(struct blame_scoreboard *sb)
> 
>          for (ent = sb->ent; ent && (next = ent->next); ent = next) {
>                  if (ent->suspect == next->suspect &&
> -                   ent->s_lno + ent->num_lines == next->s_lno) {
> +                   ent->s_lno + ent->num_lines == next->s_lno &&
> +                   ent->ignored == next->ignored &&
> +                   ent->unblamable == next->unblamable) {
>                          ent->num_lines += next->num_lines;
>                          ent->next = next->next;
>                          blame_origin_decref(next->suspect);
> 
> The fact that they are uncovered means that the && chain is short-circuited at
> "ent->s_lno + ent->num_lines == next->s_lno" before the new conditions can be
> checked. So, the block inside is never covered. It includes a call to
> blame_origin_decref() and free(), so it would be good to try and exercise this region.

What is your setup for determining if a line is uncovered? Are you running something like gcov for all of the tests in t/?

I removed this change, and none of the other blame tests appeared to trigger this code block either, independently of this change. (I put an assert(0) inside the block).

However, two of our blame-ignore tests do get past the first two checks in the if clause, (the suspects are equal and the s_lno chunks are adjacent) and we do check the ignored/unblamable conditions.

Specifically, if I undo this change and put an assert(0) in that block, two of our tests hit that code, and one of our tests fails if I don't do the check for ignored/unblamable.

Thanks, Barret

Previous: Michael PlatingsNext: Derrick Stolee
Message 6 of 11 in “Git Test Coverage Report (Thursday, May 30th)”
  1. Derrick StoleeMay 30, 2019
  2. Derrick StoleeMay 30, 2019
  3. Derrick StoleeMay 31, 2019
  4. Johannes SchindelinMay 31, 2019
  5. Michael PlatingsJun 1, 2019
  6. Barret RhodenJun 3, 2019
  7. Derrick StoleeJun 3, 2019
  8. Barret RhodenJun 4, 2019
  9. Barret RhodenJun 4, 2019
  10. Derrick StoleeJun 5, 2019
  11. Barret RhodenJun 10, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.