Sam Russell wrote:
> ran the tests just printing out the values from the current implementation
> and then put them into arrays that we now check against, the idea being
> that the current implementation is correct and we expect future
> implementations to match the current implementation

Yes, that's the point of extending the unit test before adding the
optimization :)

But this is a huge amount of expected values (32 x 32). Which is a
problem if we later want to support another polynomial too.

I'd opt for reducing this set of expected values to 32 values,
by reintroducing the memcpy() trick from your previous patch:

  for (i = 0; i < 32; i++)
    {
      memset (data, 0x55, sizeof (data));
      memcpy (data + i, randomb, ...);
      ...
    }

Then there are only 32 expected values to find via printf() and to fill in.

Bruno




Reply via email to