[PATCH 0/2] xen/rangeset: one bugfix and unit testing

Roger Pau Monne posted 2 patches 6 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20250411075502.19926-1-roger.pau@citrix.com
tools/tests/Makefile                 |   1 +
tools/tests/rangeset/Makefile        |  45 ++++++
tools/tests/rangeset/harness.h       |  71 +++++++++
tools/tests/rangeset/test-rangeset.c | 228 +++++++++++++++++++++++++++
xen/common/rangeset.c                |   3 +-
5 files changed, 347 insertions(+), 1 deletion(-)
create mode 100644 tools/tests/rangeset/Makefile
create mode 100644 tools/tests/rangeset/harness.h
create mode 100644 tools/tests/rangeset/test-rangeset.c
[PATCH 0/2] xen/rangeset: one bugfix and unit testing
Posted by Roger Pau Monne 6 months, 3 weeks ago
Hello,

Rangesets are extensively used inside of Xen, yet we had no
unit tests to ensure it's correctness.  rangeset_remove_range() is in
fact bogus and will generate an incorrect output rangeset depending on
the inputs.

Patch 1 fixes the bug, patch 2 adds some basic unit testing to ensure
the fix done by patch 1 is correct.  The unit testing should likely be
expanded (in a different series) to further assert the correctness of
other rangeset operations.

Thanks, Roger.

Roger Pau Monne (2):
  xen/rangeset: fix incorrect subtraction
  tootls/tests: introduce unit tests for rangesets

 tools/tests/Makefile                 |   1 +
 tools/tests/rangeset/Makefile        |  45 ++++++
 tools/tests/rangeset/harness.h       |  71 +++++++++
 tools/tests/rangeset/test-rangeset.c | 228 +++++++++++++++++++++++++++
 xen/common/rangeset.c                |   3 +-
 5 files changed, 347 insertions(+), 1 deletion(-)
 create mode 100644 tools/tests/rangeset/Makefile
 create mode 100644 tools/tests/rangeset/harness.h
 create mode 100644 tools/tests/rangeset/test-rangeset.c

-- 
2.48.1