Re: [PATCH next 2/8] test_hexdump: Create test output data from the binary input data buffer

Andy Shevchenko
2025-03-12T19:36:09Z

On Wed, Mar 12, 2025 at 07:28:11PM +0000, David Laight wrote:
> On Mon, 10 Mar 2025 10:31:10 +0200
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> > On Sat, Mar 08, 2025 at 09:34:46AM +0000, David Laight wrote:
> > > Using the same data that is passed to hex_dump_to_buffer() lets
> > > the tests be expanded to test different input data bytes.
> >
> > Do we really need to kill the static test cases?
> > Are they anyhow harmful?
>
> I was asked to add some extra tests for other byte values.

Right and thanks for doing that!

> The static result buffers just get in the way.
>
> They are also not necessary since the tests are comparing the output
> of two (hopefully) different implementations and checking they are
> the same.

Not necessary doesn't mean harmful or working wrong. I would leave them as is
and just add a dynamic test cases on top. Static data is kinda randomised, but
at the same time it's always the same through the test runs. IIRC your dynamic
case generates the expected output and hence uses the code that also needs to
be tested strictly speaking.

--
With Best Regards,
Andy Shevchenko