mbox series

[libgpiod,0/2] tests: improve wait_multiple coverage

Message ID 20201014034758.19427-1-warthog618@gmail.com
Headers show
Series tests: improve wait_multiple coverage | expand

Message

Kent Gibson Oct. 14, 2020, 3:47 a.m. UTC
A couple of patches for the v2 branch that improve the coverage of the
wait_multiple test case.

The first creates a mismatch between the chip offsets and bulk offsets
to highlight the problem with my initial implementation of
gpiod_line_event_wait_bulk() for uAPI v2.

The second adds a check on the event.offset field added for uAPI v2.

Kent Gibson (2):
  tests: create mismatch between chip and bulk offsets in wait_multiple
  tests: add check of event offset to wait_multiple

 tests/tests-event.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Bartosz Golaszewski Oct. 14, 2020, 7:50 a.m. UTC | #1
On Wed, Oct 14, 2020 at 5:48 AM Kent Gibson <warthog618@gmail.com> wrote:
>
> A couple of patches for the v2 branch that improve the coverage of the
> wait_multiple test case.
>
> The first creates a mismatch between the chip offsets and bulk offsets
> to highlight the problem with my initial implementation of
> gpiod_line_event_wait_bulk() for uAPI v2.
>
> The second adds a check on the event.offset field added for uAPI v2.
>
> Kent Gibson (2):
>   tests: create mismatch between chip and bulk offsets in wait_multiple
>   tests: add check of event offset to wait_multiple
>
>  tests/tests-event.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> --
> 2.28.0
>

I suppose that, if we don't want to do the backward compatible port
for now, these can be ignored?

Bartosz
Kent Gibson Oct. 14, 2020, 8:37 a.m. UTC | #2
On Wed, Oct 14, 2020 at 09:50:08AM +0200, Bartosz Golaszewski wrote:
> On Wed, Oct 14, 2020 at 5:48 AM Kent Gibson <warthog618@gmail.com> wrote:
> >
> > A couple of patches for the v2 branch that improve the coverage of the
> > wait_multiple test case.
> >
> > The first creates a mismatch between the chip offsets and bulk offsets
> > to highlight the problem with my initial implementation of
> > gpiod_line_event_wait_bulk() for uAPI v2.
> >
> > The second adds a check on the event.offset field added for uAPI v2.
> >
> > Kent Gibson (2):
> >   tests: create mismatch between chip and bulk offsets in wait_multiple
> >   tests: add check of event offset to wait_multiple
> >
> >  tests/tests-event.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > --
> > 2.28.0
> >
> 
> I suppose that, if we don't want to do the backward compatible port
> for now, these can be ignored?
> 

It wouldn't hurt to have them either way - in my book it never hurts
to increase test coverage.

Cheers,
Kent.
Bartosz Golaszewski Oct. 14, 2020, 8:39 a.m. UTC | #3
On Wed, Oct 14, 2020 at 10:37 AM Kent Gibson <warthog618@gmail.com> wrote:
>
> On Wed, Oct 14, 2020 at 09:50:08AM +0200, Bartosz Golaszewski wrote:
> > On Wed, Oct 14, 2020 at 5:48 AM Kent Gibson <warthog618@gmail.com> wrote:
> > >
> > > A couple of patches for the v2 branch that improve the coverage of the
> > > wait_multiple test case.
> > >
> > > The first creates a mismatch between the chip offsets and bulk offsets
> > > to highlight the problem with my initial implementation of
> > > gpiod_line_event_wait_bulk() for uAPI v2.
> > >
> > > The second adds a check on the event.offset field added for uAPI v2.
> > >
> > > Kent Gibson (2):
> > >   tests: create mismatch between chip and bulk offsets in wait_multiple
> > >   tests: add check of event offset to wait_multiple
> > >
> > >  tests/tests-event.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > --
> > > 2.28.0
> > >
> >
> > I suppose that, if we don't want to do the backward compatible port
> > for now, these can be ignored?
> >
>
> It wouldn't hurt to have them either way - in my book it never hurts
> to increase test coverage.
>
> Cheers,
> Kent.

Ok I thought they only apply to your v2 port but I see they'll work in
master too.

Bartosz
Kent Gibson Oct. 14, 2020, 8:46 a.m. UTC | #4
On Wed, Oct 14, 2020 at 10:39:49AM +0200, Bartosz Golaszewski wrote:
> On Wed, Oct 14, 2020 at 10:37 AM Kent Gibson <warthog618@gmail.com> wrote:
> >
> > On Wed, Oct 14, 2020 at 09:50:08AM +0200, Bartosz Golaszewski wrote:
> > > On Wed, Oct 14, 2020 at 5:48 AM Kent Gibson <warthog618@gmail.com> wrote:
> > > >
> > > > A couple of patches for the v2 branch that improve the coverage of the
> > > > wait_multiple test case.
> > > >
> > > > The first creates a mismatch between the chip offsets and bulk offsets
> > > > to highlight the problem with my initial implementation of
> > > > gpiod_line_event_wait_bulk() for uAPI v2.
> > > >
> > > > The second adds a check on the event.offset field added for uAPI v2.
> > > >
> > > > Kent Gibson (2):
> > > >   tests: create mismatch between chip and bulk offsets in wait_multiple
> > > >   tests: add check of event offset to wait_multiple
> > > >
> > > >  tests/tests-event.c | 3 ++-
> > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > >
> > > > --
> > > > 2.28.0
> > > >
> > >
> > > I suppose that, if we don't want to do the backward compatible port
> > > for now, these can be ignored?
> > >
> >
> > It wouldn't hurt to have them either way - in my book it never hurts
> > to increase test coverage.
> >
> > Cheers,
> > Kent.
> 
> Ok I thought they only apply to your v2 port but I see they'll work in
> master too.
> 

Yes and No, i.e. the first is general, the second is requires the offset
field in the event, and so only works for a uAPI v2 port.

Kent.