From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb] Add empty range unit test for gdb::parallel_for_each
Date: Fri, 22 Jul 2022 17:19:20 +0200 [thread overview]
Message-ID: <20220722151918.GA7272@delia.home> (raw)
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
}
reply other threads:[~2022-07-22 15:19 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=20220722151918.GA7272@delia.home \
--to=tdevries@suse.de \
--cc=gdb-patches@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).