lib/interval_tree: add some test cases and cleanup
Status from this message: [merged mm-nonmm-stable] lib-interval_tree-fix-the-comment-of-interval_tree_span_iter_next_gap.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest7 patches 0 repliesApplied 7/7
- v17 patches 6 repliesSuperseded
Changes in v2 from the cover letter
* move definition of container_of() into container_of.h
* fix compile warning by defining seed with ullong
Patches in v2 All 7 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | lib/rbtree: enable userland test suite for rbtree related data structuretools/ tools/ tools/ +16 more | +288 | 0 replies | Applied |
| 2/7 | lib/rbtree: split testslib/ lib/ | +59 | 0 replies | Applied |
| 3/7 | lib/rbtree: add random seedinclude/ lib/ lib/ +3 more | +15 | 0 replies | Applied |
| 4/7 | lib/interval_tree: add test case for interval_tree_iter_xxx() helperslib/ tools/ tools/ | +110 | 0 replies | Applied |
| 5/7 | lib/interval_tree: add test case for span iterationlib/ tools/ tools/ | +123 | 0 replies | Applied |
| 6/7 | lib/interval_tree: skip the check before go to the right subtreeinclude/ | +2 | 0 replies | Applied |
| 7/7 | lib/interval_tree: fix the comment of interval_tree_span_iter_next_gap()lib/ | +9 | 0 replies | Applied |
Reviews trailers per patch
1 of 7 patches has a Reviewed-by or Acked-by.
| Patch | Jason Gunthorpe |
|---|---|
| 1/7 | |
| 2/7 | |
| 3/7 | |
| 4/7 | |
| 5/7 | |
| 6/7 | |
| 7/7 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [Patch v2 0/7] lib/interval_tree: add some test cases and cleanup
Originally, I sent an interval tree cleanup[1], but lack of reasonable test.
As Matthew suggested, this patch set includes proper test to exercise the change in interval tree.
Since rbtree/augmented tree/interval tree share similar data structure, besides new cases for interval tree, this patch set also does cleanup for others.
Patch 1: There are test cases as kernel module, this patch enable them in
userland. This would help for testing and debugging.
Patch 2: Split cases for better reading. And prepare for new cases adding. Patch 3: Add random seed to cover different situations
Patch 4: Add case for interval_tree_iter_xxx() helper
Patch 5: Add case for span iteration
Patch 6: is the original cleanup
Patch 7: fix the comment of interval_tree_span_iter_next_gap()
v2:
* move definition of container_of() into container_of.h
* fix compile warning by defining seed with ullong
[1]: https://lkml.kernel.org/r/[email protected]
Wei Yang (7):
lib/rbtree: enable userland test suite for rbtree related data
structure
lib/rbtree: split tests
lib/rbtree: add random seed
lib/interval_tree: add test case for interval_tree_iter_xxx() helpers lib/interval_tree: add test case for span iteration lib/interval_tree: skip the check before go to the right subtree lib/interval_tree: fix the comment of
interval_tree_span_iter_next_gap()
include/linux/interval_tree_generic.h | 8 +- include/linux/types.h | 1 + lib/interval_tree.c | 12 +- lib/interval_tree_test.c | 237 ++++++++++++++++-- lib/rbtree_test.c | 30 ++- tools/include/asm/timex.h | 13 + tools/include/linux/bitmap.h | 21 ++ tools/include/linux/container_of.h | 18 ++ tools/include/linux/kernel.h | 14 +- tools/include/linux/math64.h | 5 + tools/include/linux/moduleparam.h | 7 + tools/include/linux/prandom.h | 51 ++++ tools/include/linux/slab.h | 1 + tools/include/linux/types.h | 2 + tools/lib/bitmap.c | 20 ++ tools/lib/slab.c | 16 ++ tools/testing/rbtree/Makefile | 33 +++ tools/testing/rbtree/interval_tree_test.c | 58 +++++ tools/testing/rbtree/rbtree_test.c | 48 ++++ tools/testing/rbtree/test.h | 4 + tools/testing/shared/interval_tree-shim.c | 5 + tools/testing/shared/linux/interval_tree.h | 7 + .../shared/linux/interval_tree_generic.h | 2 + tools/testing/shared/linux/rbtree.h | 8 + tools/testing/shared/linux/rbtree_augmented.h | 7 + tools/testing/shared/linux/rbtree_types.h | 8 + tools/testing/shared/rbtree-shim.c | 6 + 27 files changed, 600 insertions(+), 42 deletions(-) create mode 100644 tools/include/asm/timex.h create mode 100644 tools/include/linux/container_of.h create mode 100644 tools/include/linux/moduleparam.h create mode 100644 tools/include/linux/prandom.h create mode 100644 tools/testing/rbtree/Makefile create mode 100644 tools/testing/rbtree/interval_tree_test.c create mode 100644 tools/testing/rbtree/rbtree_test.c create mode 100644 tools/testing/rbtree/test.h create mode 100644 tools/testing/shared/interval_tree-shim.c create mode 100644 tools/testing/shared/linux/interval_tree.h create mode 100644 tools/testing/shared/linux/interval_tree_generic.h create mode 100644 tools/testing/shared/linux/rbtree.h create mode 100644 tools/testing/shared/linux/rbtree_augmented.h create mode 100644 tools/testing/shared/linux/rbtree_types.h create mode 100644 tools/testing/shared/rbtree-shim.c
Signature · 1 line
2.34.1