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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 15-ene-2024 20:24:47, Rubén Justo wrote:

> -	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.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux