Subject: Re: [PATCH 4/4] t-reftable-merged: check realloc errors

From: Patrick Steinhardt <[email-masked]>
Date: Fri, 27 Dec 2024 11:34:01 +0100

On Thu, Dec 26, 2024 at 09:46:51PM -0800, Junio C Hamano wrote:
> René Scharfe <[email-masked]> writes:
> 
> > Report reallocation errors in unit tests, like everywhere else.
> 
> OK.  That's good for consistency if anything else.
> 
> We have a test framework for doing unit test at such low level, yet
> we cannot really write tests that validates that the right thing
> happens when a particular realloc() call returns NULL, which feels
> somewhat disappointing, but that is not a fault of this series.

In the context of the reftable library we can because we've got
pluggable allocators. We could in theory swap them out against variants
that fail, but it's not easy to make them fail in one specific code
path. For the case at hand though it would work alright.

Patrick