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

Pavan Nikhilesh pbhagavatula at caviumnetworks.com
Wed Apr 4 14:54:11 CEST 2018


On Wed, Apr 04, 2018 at 02:49:28PM +0200, Thomas Monjalon wrote:
> 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
>

Thanks for the headsup will send out next version with suggested changes.

Pavan.

>
>


More information about the dev mailing list