1
0
mirror of https://github.com/git/git.git synced 2024-10-20 21:38:38 +02:00
git/t/helper
Jeff King 7daa825d67 test-hashmap: simplify alloc_test_entry
This function takes two ptr/len pairs, which implies that
they can be arbitrary buffers. But internally, it assumes
that each "ptr" is NUL-terminated at "len" (because we
memcpy an extra byte to pick up the NUL terminator).

In practice this works because each caller only ever passes
strlen(ptr) as the length. But let's drop the "len"
parameters to make our expectations clear.

Note that we can get rid of the "l1" and "l2" variables from
cmd_main() as a further cleanup, since they are now mostly
used to check whether the p1 and p2 arguments are present
(technically the length parameters conflated NULL with the
empty string, which we no longer do, but I think that is
actually an improvement).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-02-14 10:31:10 -08:00
..
.gitignore
test-chmtime.c
test-config.c
test-ctype.c
test-date.c
test-delta.c
test-dump-cache-tree.c
test-dump-split-index.c
test-dump-untracked-cache.c
test-fake-ssh.c
test-genrandom.c
test-hashmap.c test-hashmap: simplify alloc_test_entry 2018-02-14 10:31:10 -08:00
test-index-version.c
test-lazy-init-name-hash.c
test-line-buffer.c
test-match-trees.c
test-mergesort.c
test-mktemp.c
test-online-cpus.c
test-parse-options.c
test-path-utils.c
test-prio-queue.c
test-read-cache.c
test-ref-store.c test-ref-store: avoid passing NULL to printf 2017-10-21 21:29:00 +09:00
test-regex.c
test-revision-walking.c
test-run-command.c
test-scrap-cache-tree.c
test-sha1-array.c
test-sha1.c
test-sha1.sh
test-sigchain.c
test-strcmp-offset.c
test-string-list.c test-stringlist: avoid buffer underrun when sorting nothing 2017-10-04 13:41:49 +09:00
test-submodule-config.c
test-subprocess.c
test-svn-fe.c
test-urlmatch-normalization.c
test-wildmatch.c
test-write-cache.c