All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] xen/rangeset: one bugfix and unit testing
@ 2025-04-11  7:55 Roger Pau Monne
  2025-04-11  7:55 ` [PATCH 1/2] xen/rangeset: fix incorrect subtraction Roger Pau Monne
  2025-04-11  7:55 ` [PATCH 2/2] tootls/tests: introduce unit tests for rangesets Roger Pau Monne
  0 siblings, 2 replies; 6+ messages in thread
From: Roger Pau Monne @ 2025-04-11  7:55 UTC (permalink / raw)
  To: xen-devel
  Cc: Roger Pau Monne, Andrew Cooper, Anthony PERARD, Michal Orzel,
	Jan Beulich, Julien Grall, Stefano Stabellini

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-04-11  9:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-11  7:55 [PATCH 0/2] xen/rangeset: one bugfix and unit testing Roger Pau Monne
2025-04-11  7:55 ` [PATCH 1/2] xen/rangeset: fix incorrect subtraction Roger Pau Monne
2025-04-11  8:16   ` Jan Beulich
2025-04-11  7:55 ` [PATCH 2/2] tootls/tests: introduce unit tests for rangesets Roger Pau Monne
2025-04-11  8:21   ` Jan Beulich
2025-04-11  9:00     ` Roger Pau Monné

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.