Re: [PATCH v2] regmap: kunit: Ensure that changed bytes are actually different

From: Mark Brown
Date: Sat Feb 10 2024 - 07:44:19 EST


On Fri, Feb 09, 2024 at 03:20:40PM -0800, Guenter Roeck wrote:
> On 2/9/24 14:39, Mark Brown wrote:

> > > + // so anything might be in there, including the values from
> > > + // the val[] array.
> > > + hw_buf[2] = val[0];
> > > + hw_buf[3] = val[1];
> > > + hw_buf[4] = val[0];
> > > + hw_buf[5] = val[1];

> > I don't understand how this interacts with the pre-sync check?

> That is because the test expects the memory in hw_buf[] and val[] to be
> different (because hw_buf[] wasn't updated to the new values). The above
> cheat forces hw_buf[2,3] and val[0,1] to be the same, so the pre-sync test
> fails. The post-sync test passes because the values are expected to be
> the same at that time.

Ah, that was my read - I was thinking I was missing some way for both
tests to pass.

Attachment: signature.asc
Description: PGP signature