v4l2-compliance: fix broken test for V4L2_FRMIVAL_TYPE_CONTINUOUS
authorHans Verkuil <hans.verkuil@cisco.com>
Tue, 11 Feb 2014 08:58:23 +0000 (09:58 +0100)
committerHans Verkuil <hans.verkuil@cisco.com>
Tue, 11 Feb 2014 08:58:23 +0000 (09:58 +0100)
Don't test for 'step > (max - min)' for the continuous type. Step should
be ignored in that case.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
utils/v4l2-compliance/v4l2-test-formats.cpp

index db023f3..2f23ac5 100644 (file)
@@ -106,7 +106,8 @@ static int testEnumFrameIntervals(struct node *node, __u32 pixfmt, __u32 w, __u3
                                return fail("invalid min, max or step for frameinterval %d\n", f);
                        if (fract2f(&sw->min) > fract2f(&sw->max))
                                return fail("min > max\n");
-                       if (fract2f(&sw->step) > fract2f(&sw->max) - fract2f(&sw->min))
+                       if (frmival.type == V4L2_FRMIVAL_TYPE_STEPWISE &&
+                           fract2f(&sw->step) > fract2f(&sw->max) - fract2f(&sw->min))
                                return fail("step > (max - min)\n");
                        break;
                default: