From: Christian Couder <christian.couder@gmail.com>
To: Derrick Stolee <stolee@gmail.com>
Cc: "Git List" <git@vger.kernel.org>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
"Jeff King" <peff@peff.net>
Subject: Re: Git Test Coverage Report (Thurs. June 27)
Date: Fri, 28 Jun 2019 15:39:03 +0200 [thread overview]
Message-ID: <CAP8UFD3VFdCUwDBTb9en22FO7HnWc4vgQ4h0hhariCB=om4b8A@mail.gmail.com> (raw)
In-Reply-To: <14689d27-eecd-2e0a-715d-796b20d573e5@gmail.com>
On Thu, Jun 27, 2019 at 7:35 PM Derrick Stolee <stolee@gmail.com> wrote:
>
> Here are some interesting sections I found when examining the test coverage
> report. I am only highlighting these sections because they seem to include
> non-trivial logic. In some cases, maybe the code isn't needed.
>
> On 6/27/2019 1:05 PM, Derrick Stolee wrote:
> > promisor-remote.c
> > db27dca5 25) die(_("Remote with no URL"));
> > 48de3158 61) warning(_("promisor remote name cannot begin with '/': %s"),
> > 48de3158 63) return NULL;
> > faf2abf4 93) previous->next = r->next;
> > 4ca9474e 108) return git_config_string(&core_partial_clone_filter_default,
> > fa3d1b63 139) return 0;
> > 9e27beaa 202) static int remove_fetched_oids(struct repository *repo,
> > 9e27beaa 206) int i, remaining_nr = 0;
> > 9e27beaa 207) int *remaining = xcalloc(oid_nr, sizeof(*remaining));
> > 9e27beaa 208) struct object_id *old_oids = *oids;
> > 9e27beaa 211) for (i = 0; i < oid_nr; i++)
> > 9e27beaa 212) if (oid_object_info_extended(repo, &old_oids[i], NULL,
> > 9e27beaa 214) remaining[i] = 1;
> > 9e27beaa 215) remaining_nr++;
> > 9e27beaa 218) if (remaining_nr) {
> > 9e27beaa 219) int j = 0;
> > 9e27beaa 220) new_oids = xcalloc(remaining_nr, sizeof(*new_oids));
> > 9e27beaa 221) for (i = 0; i < oid_nr; i++)
> > 9e27beaa 222) if (remaining[i])
> > 9e27beaa 223) oidcpy(&new_oids[j++], &old_oids[i]);
> > 9e27beaa 224) *oids = new_oids;
> > 9e27beaa 225) if (to_free)
> > 9e27beaa 226) free(old_oids);
> > 9e27beaa 229) free(remaining);
> > 9e27beaa 231) return remaining_nr;
> > 9e27beaa 248) if (remaining_nr == 1)
> > 9e27beaa 249) continue;
> > 9e27beaa 250) remaining_nr = remove_fetched_oids(repo, &remaining_oids,
> > 9e27beaa 252) if (remaining_nr) {
> > 9e27beaa 253) to_free = 1;
> > 9e27beaa 254) continue;
> > 9e27beaa 262) free(remaining_oids);
>
> Christian: this section continues to be untested, but I think you were
> working on creating tests for this.
Yeah, I am planning to work on this soon.
> > t/helper/test-oidmap.c
> > 11510dec 52) if (get_oid(p1, &oid)) {
> > 11510dec 53) printf("Unknown oid: %s\n", p1);
> > 11510dec 54) continue;
> > 11510dec 58) FLEX_ALLOC_STR(entry, name, p2);
> > 11510dec 59) oidcpy(&entry->entry.oid, &oid);
> > 11510dec 62) oidmap_put(&map, entry);
>
> Christian: this block looks like the test-oidmap helper never uses the "add"
> subcommand. Is that correct?
Yeah, I initially copied it from hashmap, but then I realized that it
was nearly identical as the "put" subcommand, so not worth testing
separately. I should have removed it and will do it soon.
> > 11510dec 97) if (get_oid(p1, &oid)) {
> > 11510dec 98) printf("Unknown oid: %s\n", p1);
> > 11510dec 99) continue;
> > 11510dec 103) entry = oidmap_remove(&map, &oid);
> > 11510dec 106) puts(entry ? entry->name : "NULL");
> > 11510dec 107) free(entry);
>
> Similarly, this block means we are not using the "remove" subcommand.
Yeah, it looks like I forgot to implement a test for that subcommand.
Will add it soon.
Thanks,
Christian.
prev parent reply other threads:[~2019-06-28 13:39 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-27 17:05 Git Test Coverage Report (Thurs. June 27) Derrick Stolee
2019-06-27 17:35 ` Derrick Stolee
2019-06-28 6:41 ` Jeff King
2019-06-28 9:37 ` [PATCH 0/6] easy bulk commit creation in tests Jeff King
2019-06-28 9:39 ` [PATCH 1/6] test-lib: introduce test_commit_bulk Jeff King
2019-06-28 12:35 ` Derrick Stolee
2019-06-28 18:05 ` Junio C Hamano
2019-06-29 0:09 ` Jeff King
2019-06-28 17:53 ` Junio C Hamano
2019-06-29 0:14 ` Jeff King
2019-06-28 18:44 ` Ævar Arnfjörð Bjarmason
2019-06-29 0:19 ` Jeff King
2019-06-28 21:32 ` Eric Sunshine
2019-06-28 23:04 ` SZEDER Gábor
2019-06-28 23:46 ` Eric Sunshine
2019-06-29 0:26 ` Jeff King
2019-06-29 8:24 ` SZEDER Gábor
2019-07-01 17:42 ` Junio C Hamano
2019-06-29 0:25 ` Jeff King
2019-06-28 9:39 ` [PATCH 2/6] t5310: increase the number of bitmapped commits Jeff King
2019-06-28 9:41 ` [PATCH 3/6] t3311: use test_commit_bulk Jeff King
2019-06-28 9:41 ` [PATCH 4/6] t5702: " Jeff King
2019-06-28 9:42 ` [PATCH 5/6] t5703: " Jeff King
2019-06-28 9:42 ` [PATCH 6/6] t6200: " Jeff King
2019-06-28 12:53 ` [PATCH 0/6] easy bulk commit creation in tests Johannes Schindelin
2019-06-29 0:30 ` Jeff King
2019-06-29 16:38 ` Elijah Newren
2019-06-30 6:34 ` Jeff King
2019-06-28 18:49 ` Ævar Arnfjörð Bjarmason
2019-06-29 0:45 ` Jeff King
2019-06-29 4:53 ` [PATCH v2 1/6] test-lib: introduce test_commit_bulk Jeff King
2019-07-01 22:24 ` Junio C Hamano
2019-07-02 5:16 ` Jeff King
2019-07-01 22:28 ` Junio C Hamano
2019-07-02 5:22 ` Jeff King
2019-06-28 6:45 ` Git Test Coverage Report (Thurs. June 27) Jeff King
2019-06-28 12:23 ` Derrick Stolee
2019-06-28 23:59 ` Jeff King
2019-06-29 1:36 ` Derrick Stolee
2019-06-29 5:15 ` Jeff King
2019-06-28 9:47 ` Duy Nguyen
2019-06-28 12:39 ` Derrick Stolee
2019-06-28 13:39 ` Christian Couder [this message]
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='CAP8UFD3VFdCUwDBTb9en22FO7HnWc4vgQ4h0hhariCB=om4b8A@mail.gmail.com' \
--to=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
--cc=peff@peff.net \
--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).