[dpdk-dev] [PATCH v3 2/2] test: update common auto test

Thomas Monjalon thomas at monjalon.net
Wed Apr 4 14:49:28 CEST 2018


04/04/2018 12:16, Pavan Nikhilesh:
> Update common auto test to include test for previous power of 2 for both
> 32 and 64bit integers.

This patch can be merged with previous one (related lib change).

[...]
> +	for (i = 1, p = 1; i <= MAX_NUM; i++) {
> +		if (rte_align32prevpow2(i) != p)
> +			FAIL_ALIGN("rte_align32prevpow2", i, p);
> +		if (rte_is_power_of_2(i + 1))
> +			p = i + 1;
> +	}
> +
> +	for (j = 1, q = 1; j <= MAX_NUM ; j++) {
> +		if (rte_align64pow2(j) != q)

You could create FAIL_ALIGN64 for consistency.

> +			printf("rte_align64pow2() test failed: %lu %lu\n", j,

%lu does not work on 32-bit machines.
Please use PRIu64.

See http://dpdk.org/ml/archives/dev/2018-February/090882.html





More information about the dev mailing list