public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [committed][gdb] Add empty range unit test for gdb::parallel_for_each
@ 2022-07-22 15:19 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2022-07-22 15:19 UTC (permalink / raw)
  To: gdb-patches

Hi,

Add a unit test that verifies that we can call gdb::parallel_for_each with an
empty range.

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb] Add empty range unit test for gdb::parallel_for_each

---
 gdb/unittests/parallel-for-selftests.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gdb/unittests/parallel-for-selftests.c b/gdb/unittests/parallel-for-selftests.c
index e0c07e55e03..8a86b435fd3 100644
--- a/gdb/unittests/parallel-for-selftests.c
+++ b/gdb/unittests/parallel-for-selftests.c
@@ -60,6 +60,14 @@ test (int n_threads)
 
   SELF_CHECK (counter == NUMBER);
 
+  counter = 0;
+  gdb::parallel_for_each (1, 0, 0,
+			  [&] (int start, int end)
+			  {
+			    counter += end - start;
+			  });
+  SELF_CHECK (counter == 0);
+
 #undef NUMBER
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-22 15:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-22 15:19 [committed][gdb] Add empty range unit test for gdb::parallel_for_each Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).