Re: [PATCH v11 2/2] lib/test_bitmap: add tests for bitmap_{read,write}()

From: Alexander Potapenko
Date: Thu Nov 09 2023 - 09:36:33 EST


On Thu, Nov 9, 2023 at 3:32 PM Alexander Lobakin
<aleksander.lobakin@xxxxxxxxx> wrote:
>
> From: Alexander Potapenko <glider@xxxxxxxxxx>
> Date: Thu, 9 Nov 2023 15:28:56 +0100
>
> >>
> >> Could we maybe rather extend __check_eq_uint to take ulongs? Doesn't
> >> seem like they differ a lot.
> >
> > We could redefine expect_eq_uint as:
> >
> > #define expect_eq_uint(x, y) expect_eq_ulong((unsigned
> > int)(x), (unsigned int)(y))
>
> Do we need explicit casts here tho?

We do.
test_bitmap_arr64() passes u64 values to expect_eq_uint(), which
results in test failures.
We could add an explicit cast there instead, but I think it's more
natural to let the users rely on expect_eq_uint() taking uints.