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

Re: [PATCH v2] t-strvec: use test_msg()

From
Jeff King <peff@peff.net>
Date
Jul 9, 2024, 11:32 UTC
Message-ID
<20240709113201.GA994226@coredump.intra.peff.net>
In-Reply-To
<983be396-f47c-4573-8c33-af8367f8ddbe@web.de>
On Fri, Jul 05, 2024 at 07:03:36PM +0200, René Scharfe wrote:
Show 23 quoted lines
> diff --git a/t/unit-tests/t-strvec.c b/t/unit-tests/t-strvec.c
> index d4615ab06d..236203af61 100644
> --- a/t/unit-tests/t-strvec.c
> +++ b/t/unit-tests/t-strvec.c
> @@ -17,12 +17,12 @@ static void check_strvec_loc(const char *loc, struct strvec *vec, ...)
>  			break;
> 
>  		if (!check_uint(vec->nr, >, nr) ||
> -		    !check_uint(vec->alloc, >, nr) ||
> -		    !check_str(vec->v[nr], str)) {
> -			struct strbuf msg = STRBUF_INIT;
> -			strbuf_addf(&msg, "strvec index %"PRIuMAX, (uintmax_t) nr);
> -			test_assert(loc, msg.buf, 0);
> -			strbuf_release(&msg);
> +		    !check_uint(vec->alloc, >, nr)) {
> +			va_end(ap);
> +			return;
> +		}
> +		if (!check_str(vec->v[nr], str)) {
> +			test_msg("     nr: %"PRIuMAX, (uintmax_t)nr);
>  			va_end(ap);
>  			return;
>  		}

The "loc" parameter to the function is now unused. Should it be removed, or is it a bug that we are no longer reporting the caller's location? Should we be using check_str_loc() in the post-image?

-Peff
Previous: René ScharfeNext: René Scharfe
Message 5 of 20 in “t-strvec: use test_msg()”
  1. t-strvec: use test_msg()René Scharfe, Jul 4, 2024
  2. Eric SunshineJul 4, 2024
  3. Phillip WoodJul 5, 2024
  4. t-strvec: use test_msg()René Scharfe, Jul 5, 2024
  5. Jeff KingJul 9, 2024
  6. René ScharfeJul 14, 2024
  7. Jeff KingJul 16, 2024
  8. René ScharfeJul 16, 2024
  9. 2/1 t-strvec: improve check_strvec() outputRené Scharfe, Jul 14, 2024
  10. Junio C HamanoJul 15, 2024
  11. 3/1 t-strvec: tighten .alloc check in check_strvecRené Scharfe, Jul 14, 2024
  12. Junio C HamanoJul 15, 2024
  13. René ScharfeJul 15, 2024
  14. Junio C HamanoJul 15, 2024
  15. t-strvec: improve check_strvec() outputRené Scharfe, Jul 14, 2024
  16. René ScharfeJul 14, 2024
  17. Jeff KingJul 16, 2024
  18. Junio C HamanoJul 16, 2024
  19. t-strvec: fix type mismatch in check_strvecRené Scharfe, Jul 16, 2024
  20. Junio C HamanoJul 16, 2024

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.