OSDN Git Service

lib: test_bitmap: add more start-end:offset/len tests
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Sun, 21 Feb 2021 08:08:22 +0000 (03:08 -0500)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 8 Mar 2021 22:16:58 +0000 (14:16 -0800)
commit97330db3af9a41302d1ccb0f495fcb5b5da2cc44
treeeff37f6f777b0f596da59aeba56fdc0280648acf
parent6fef5905fbd691aeb91093056b27d5ee7b106097
lib: test_bitmap: add more start-end:offset/len tests

There are inputs to bitmap_parselist() that would probably never
be entered manually by a person, but might result from some kind of
automated input generator.  Things like ranges of length 1, or group
lengths longer than nbits, overlaps, or offsets of zero.

Adding these tests serve two purposes:

1) document what might seem odd but nonetheless valid input.

2) don't regress from what we currently accept as valid.

Cc: Yury Norov <yury.norov@gmail.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Yury Norov <yury.norov@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
lib/test_bitmap.c