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

Re: [Outreachy][PATCH] Port helper/test-advise.c to unit-tests/t-advise.c

From
Rubén Justo <rjusto@gmail.com>
Date
Jan 16, 2024, 11:30 UTC
Message-ID
<8774e3a1-3362-4ba4-9eb9-012bd9665d83@gmail.com>
In-Reply-To
<6b6b455e-26b8-442e-828e-506f9a152407@gmail.com>
On 15-ene-2024 20:24:47, Rubén Justo wrote:
Show 14 quoted lines
> -	check_str(actual.buf, expect);
> +	check_str_len(actual.buf, expect, strlen(expect));
> +	if (!conf_val && skip_prefix(actual.buf, expect, &hint))
> +		check_str_len(hint, expect_hint_msg, strlen(expect_hint_msg));
>  	strbuf_release(&actual);
>  
>  	if (!check(remove(out_file) == 0))
> 
> This implies a new check_str_len() helper, which I'm not including here
> but it's a trivial copy of check_str() but using strncmp().
> 
> Maybe we can turn the screw a little more.
> 
> I'm still not sure of the value in the changes in this series, though.

I hope, no one has wasted time with the code above. It is not testing correctly the conditions being probed in t-advice.c.

Take it as a way to see if this is how we want to avoid multiple instances of similar literals that might be tempting to refactor.

Previous: Rubén Justo
Message 6 of 6 in “Port helper/test-advise.c to unit-tests/t-advise.c”
  1. Achu LumaJan 12, 2024
  2. Junio C HamanoJan 12, 2024
  3. Rubén JustoJan 15, 2024
  4. Junio C HamanoJan 15, 2024
  5. Rubén JustoJan 15, 2024
  6. Rubén JustoJan 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.