Re: [PATCH bpf-next v1 2/4] selftests/bpf: Modernize resolve_btfids test scaffolding

Eduard Zingerman <[email protected]>
Newsgroups org.kernel.vger.linux-kbuild,org.kernel.vger.bpf
Message-ID <[email protected]>
On Wed, 2026-06-17 at 14:06 -0700, Ihor Solodrai wrote:
> Refactor resolve_btfids test in order to:
>   * use newer ASSERT_* macros instead of CHECK
>   * extend the lifetime of loaded BTF to enable additional checks
>   * cleanup unused/unnecessary code
> 
> Reviewed-by: Emil Tsalapatis <[email protected]>
> Signed-off-by: Ihor Solodrai <[email protected]>
> ---

Acked-by: Eduard Zingerman <[email protected]>

> @@ -153,15 +136,12 @@ void test_resolve_btfids(void)
>  			break;
>  		}
>  
> -		ret = CHECK(!found, "id_check",
> -			    "ID %d not found in test_symbols\n",
> -			    test_set.ids[i]);
> -		if (ret)
> -			break;
> +		ASSERT_TRUE(found, "id_in_test_symbols");

Nit: 'break' is missing.

>  
> -		if (i > 0) {
> -			if (!ASSERT_LE(test_set.ids[i - 1], test_set.ids[i], "sort_check"))
> -				return;
> -		}
> +		if (i > 0)
> +			ASSERT_LE(test_set.ids[i - 1], test_set.ids[i], "sort_check");
>  	}
> +
> +out:
> +	btf__free(btf);
>  }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.