projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6577f36
)
[gdb] Add empty range unit test for gdb::parallel_for_each
author
Tom de Vries
<tdevries@suse.de>
Fri, 22 Jul 2022 15:18:51 +0000
(17:18 +0200)
committer
Tom de Vries
<tdevries@suse.de>
Fri, 22 Jul 2022 15:18:51 +0000
(17:18 +0200)
Add a unit test that verifies that we can call gdb::parallel_for_each with an
empty range.
Tested on x86_64-linux.
gdb/unittests/parallel-for-selftests.c
patch
|
blob
|
history
diff --git
a/gdb/unittests/parallel-for-selftests.c
b/gdb/unittests/parallel-for-selftests.c
index e0c07e55e0385457a35c7f38df5b53720e22f972..8a86b435fd347e7039767585676a2960bd84b9e5 100644
(file)
--- 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
}