[PATCH v2 3/6] nss: Add tests for the nss_hash in nss_hash.h

Noah Goldstein goldstein.w.n@gmail.com
Tue Apr 26 21:39:06 GMT 2022


On Tue, Apr 26, 2022 at 3:36 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Noah Goldstein:
>
> > On Mon, Apr 25, 2022 at 10:38 AM Florian Weimer <fweimer@redhat.com> wrote:
> >>
> >> * Noah Goldstein via Libc-alpha:
> >>
> >> > +static int
> >> > +do_fill_tests (size_t len, int fill)
> >> > +{
> >> > +  uint32_t expec, res;
> >> > +  char buf[len];
> >> > +  memset (buf, fill, len);
> >> > +
> >> > +  expec = simple_nss_hash (buf, len);
> >> > +  res = __nss_hash (buf, len);
> >> > +  if (expec != res)
> >> > +    {
> >> > +      printf ("FAIL: fill(%d) (%lu), %x != %x\n", fill, len, expec, res);
> >> > +      return 1;
> >> > +    }
> >> > +
> >> > +  return 0;
> >> > +}
> >>
> >> %lu needs to be %zu, otherwise this fails to build on various
> >> architectures.
> >
> > Fixed in v3.
>
> Thanks; I can confirm the new version builds fine.
>
> Florian

Thanks, good to push?
>


More information about the Libc-alpha mailing list