diff options
author | Tom de Vries <tdevries@suse.de> | 2022-07-22 17:18:51 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2022-07-22 17:18:51 +0200 |
commit | 9083a323bc7f7bfbff754e2ce93a3940608e09a2 (patch) | |
tree | d6c76f73c39c927ed1833d8240bc025721f84f3d /gdb | |
parent | 6577f365ebdee7dda71cb996efa29d3714cbccd0 (diff) | |
download | gdb-9083a323bc7f7bfbff754e2ce93a3940608e09a2.zip gdb-9083a323bc7f7bfbff754e2ce93a3940608e09a2.tar.gz gdb-9083a323bc7f7bfbff754e2ce93a3940608e09a2.tar.bz2 |
[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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/unittests/parallel-for-selftests.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/unittests/parallel-for-selftests.c b/gdb/unittests/parallel-for-selftests.c index e0c07e5..8a86b43 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 } |