public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom de Vries <vries@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] [gdb] Add empty range unit test for gdb::parallel_for_each
Date: Fri, 22 Jul 2022 15:18:54 +0000 (GMT)	[thread overview]
Message-ID: <20220722151854.EECEF3857C5D@sourceware.org> (raw)

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
 }


                 reply	other threads:[~2022-07-22 15:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220722151854.EECEF3857C5D@sourceware.org \
    --to=vries@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).