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

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9083a323bc7f7bfbff754e2ce93a3940608e09a2

commit 9083a323bc7f7bfbff754e2ce93a3940608e09a2
Author: Tom de Vries <tdevries@suse.de>
Date:   Fri Jul 22 17:18:51 2022 +0200

    [gdb] Add empty range unit test for gdb::parallel_for_each
    
    Add a unit test that verifies that we can call gdb::parallel_for_each with an
    empty range.
    
    Tested on x86_64-linux.

Diff:
---
 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:18 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:18 [binutils-gdb] [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).