From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id q+2FIw/A2mIcqRgAWB0awg (envelope-from ) for ; Fri, 22 Jul 2022 11:19:43 -0400 Received: by simark.ca (Postfix, from userid 112) id 8369B1E5EA; Fri, 22 Jul 2022 11:19:43 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=AoYU6vX6; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 355711E13B for ; Fri, 22 Jul 2022 11:19:43 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4A22C3835428 for ; Fri, 22 Jul 2022 15:19:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4A22C3835428 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1658503182; bh=5liN74wGa1EG0RP0py9E8RLZ72bjsfsrOKUgLU/MzmM=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=AoYU6vX6EAwu76Iy9QH/X+WAgAtSQhNl2ifPJm34ia98gcLzviB/8A3mv2uDwwJ/f Xg1gsPsYJ+1rjLc2JaZ7Gs4gebXCoCMp5Cm81yMQTYuK+JpztBjSiyDEpMuurz4Hhg TVUBwnJM89FRqAPUdl02jydAXR+aodfkyhEEj7xA= Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 7A2003857C5D for ; Fri, 22 Jul 2022 15:19:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A2003857C5D Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B6CCB1FFAB for ; Fri, 22 Jul 2022 15:19:21 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A552313AB3 for ; Fri, 22 Jul 2022 15:19:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EWtJJ/m/2mK7BgAAMHmgww (envelope-from ) for ; Fri, 22 Jul 2022 15:19:21 +0000 Date: Fri, 22 Jul 2022 17:19:20 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb] Add empty range unit test for gdb::parallel_for_each Message-ID: <20220722151918.GA7272@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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 }