From: Hans Verkuil Date: Sat, 12 Jul 2014 10:35:54 +0000 (+0200) Subject: v4l2-compliance: fix control test X-Git-Tag: v4l-utils-1.3.90~117 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48bed38d5f0787739a6a9c6d1e5f79c466b47a68;p=platform%2Fupstream%2Fv4l-utils.git v4l2-compliance: fix control test The test 'step > max - min' doesn't make sense if min == max. So check for that corner case. Signed-off-by: Hans Verkuil --- diff --git a/utils/v4l2-compliance/v4l2-test-controls.cpp b/utils/v4l2-compliance/v4l2-test-controls.cpp index 2c97df5..70bf97e 100644 --- a/utils/v4l2-compliance/v4l2-test-controls.cpp +++ b/utils/v4l2-compliance/v4l2-test-controls.cpp @@ -79,7 +79,8 @@ static int checkQCtrl(struct node *node, struct test_queryctrl &qctrl) return fail("step == 0\n"); if (qctrl.step < 0) return fail("step < 0\n"); - if ((unsigned)qctrl.step > (unsigned)(qctrl.maximum - qctrl.minimum)) + if ((unsigned)qctrl.step > (unsigned)(qctrl.maximum - qctrl.minimum) && + qctrl.maximum != qctrl.minimum) return fail("step > max - min\n"); if ((qctrl.maximum - qctrl.minimum) % qctrl.step) { // This really should be a fail, but there are so few