diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-06-03 13:08:33 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-06-03 13:08:33 -0700 |
| commit | 03b0e7d3a72a4a9be97b742fc3119ebb70ed9731 (patch) | |
| tree | 1627f9966e3c187c3b266ece71f79944a8e0a911 /t/unit-tests/test-lib.c | |
| parent | Sync with 'maint' (diff) | |
| parent | builtin/mv: fix leaks for submodule gitfile paths (diff) | |
| download | git-03b0e7d3a72a4a9be97b742fc3119ebb70ed9731.tar.gz git-03b0e7d3a72a4a9be97b742fc3119ebb70ed9731.zip | |
Merge branch 'ps/leakfixes' into ps/leakfixes-more
* ps/leakfixes:
builtin/mv: fix leaks for submodule gitfile paths
builtin/mv: refactor to use `struct strvec`
builtin/mv duplicate string list memory
builtin/mv: refactor `add_slash()` to always return allocated strings
strvec: add functions to replace and remove strings
submodule: fix leaking memory for submodule entries
commit-reach: fix memory leak in `ahead_behind()`
builtin/credential: clear credential before exit
config: plug various memory leaks
config: clarify memory ownership in `git_config_string()`
builtin/log: stop using globals for format config
builtin/log: stop using globals for log config
convert: refactor code to clarify ownership of check_roundtrip_encoding
diff: refactor code to clarify memory ownership of prefixes
config: clarify memory ownership in `git_config_pathname()`
http: refactor code to clarify memory ownership
checkout: clarify memory ownership in `unique_tracking_name()`
strbuf: fix leak when `appendwholeline()` fails with EOF
transport-helper: fix leaking helper name
Diffstat (limited to 't/unit-tests/test-lib.c')
| -rw-r--r-- | t/unit-tests/test-lib.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/unit-tests/test-lib.c b/t/unit-tests/test-lib.c index 66d6980ffb..3c513ce59a 100644 --- a/t/unit-tests/test-lib.c +++ b/t/unit-tests/test-lib.c @@ -318,6 +318,19 @@ int check_bool_loc(const char *loc, const char *check, int ok) union test__tmp test__tmp[2]; +int check_pointer_eq_loc(const char *loc, const char *check, int ok, + const void *a, const void *b) +{ + int ret = test_assert(loc, check, ok); + + if (!ret) { + test_msg(" left: %p", a); + test_msg(" right: %p", b); + } + + return ret; +} + int check_int_loc(const char *loc, const char *check, int ok, intmax_t a, intmax_t b) { |
