Re: [PATCH v3 2/8] bitmap: add test for bitmap_*_region() functions
From: Andy Shevchenko
Date: Thu Aug 17 2023 - 05:44:42 EST
On Tue, Aug 15, 2023 at 04:36:22PM -0700, Yury Norov wrote:
> Test basic functionality of bitmap_{allocate,release,find_free}_region()
> functions.
...
> + for (order = 0; order < 10; order++) {
> + pos = bitmap_find_free_region(bmap, 1000, order);
> + if (order == 0)
> + expect_eq_uint(pos, 0);
> + else
> + expect_eq_uint(pos, BIT(order) < 512 ? BIT(order) : -ENOMEM);
expect_eq_uint(pos, order < 9 ? BIT(order) : -ENOMEM);
or if the intention to show the relation to 1000,
expect_eq_uint(pos, order < ilog2(1000) ? BIT(order) : -ENOMEM);
> + }
--
With Best Regards,
Andy Shevchenko