From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id g1r1D7oc0WqyThMAWB0awg (envelope-from ) for ; Thu, 15 Oct 2026 14:34:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1792089274; bh=tI8aLgomZcIaCe7zUJvMkp/gBHeV+F/TZCgR+hPWvY8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LSDjHCT/0L+25cbLiTFnqD7U+mLlLiqWZ00+gjy8MfMEccXc6X8ncLwYboTqJaH/F FO81SvIdeiJGXg5YZ5l3tenVkxOJO1BwDvqV5HoC+K9pu2zTBrq1Fjynf4r/CsxFgz HvnyuynPHUOArBlmuJpfOeJcoNxPBZfD7oP/L/VY= Received: by simark.ca (Postfix, from userid 112) id 18B9B1E04E; Thu, 15 Oct 2026 14:34:34 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=eOf0Jtlp; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 76E1C1E04E for ; Thu, 15 Oct 2026 14:34:33 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0DCE84BA2E39 for ; Thu, 15 Oct 2026 18:34:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0DCE84BA2E39 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=eOf0Jtlp Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id ED0CA4BA2E0C; Thu, 15 Oct 2026 18:33:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ED0CA4BA2E0C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ED0CA4BA2E0C Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792089238; cv=none; b=wHj3TNqUBhtyrWgKF3/QpEFi1Fcz7gYYNxqFuqZcQPdv0ZjdU14Qo2VnVYmPc+TSEMY98NwFasR07rVS5eg5VKhHhWsVeCgdk4EG0xudE0X3j/5FZfUwFO0aLvAEckNwvOkkC2KtsB2pfOHMVYUwgG92YMJCTDNV7ZWY5IVnBPY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792089238; c=relaxed/simple; bh=tI8aLgomZcIaCe7zUJvMkp/gBHeV+F/TZCgR+hPWvY8=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Pq/oeWXHUHZC3C1PWerRLoSvF3isffdaIIFWukBzYI3OrvKZo4agOHApFOMy9uJA27VgQIbwt//Ss55E9TpZF15ogBGvyAOlyH5Kow1edLxgBY7iV2VppH2xaeSQ8ivQjasl2xux35wnoJPoxtBvONxa9N1DmD+NlUMNasv3xTs= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=eOf0Jtlp DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED0CA4BA2E0C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1792089237; bh=tI8aLgomZcIaCe7zUJvMkp/gBHeV+F/TZCgR+hPWvY8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=eOf0JtlpRj+s58OHK8fb7AicSpUG5oNgBxnPXjWwiHD5S1dszK3bndEJC6WHaLyYp JLeM1WlIXKxNsYQuANv6FrxEB06ueNiMoj4Eqf/CT3SGE+gZ8rxfRM1vk32zKyJWLY MxJFXIDWV6qsQZYcn4xIc/MMWnX9dDWRPn8hSwU4= Received: by simark.ca (Postfix) id F26D41E04E; Thu, 15 Oct 2026 14:33:55 -0400 (EDT) Message-ID: Date: Thu, 15 Oct 2026 14:33:55 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] gdb: add selftests for split_name To: Tom Tromey , Simon Marchi Cc: gcc-patches@sourceware.org, gdb-patches@sourceware.org References: <20261005052602.1288766-3-simon.marchi@polymtl.ca> <20261014164830.358677-2-simon.marchi@efficios.com> <878q3z2cd7.fsf@tromey.com> Content-Language: fr From: Simon Marchi In-Reply-To: <878q3z2cd7.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 10/15/26 11:48 AM, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> + if (result != expected) > Simon> + debug_printf ("split_name (\"%s\"): got %s, expected %s\n", name, > Simon> + components_to_string (result).c_str (), > Simon> + components_to_string (expected).c_str ()); > Simon> + > Simon> + SELF_CHECK (result == expected); > > I've often regretted not adding a SELF_CHECK variant that takes two > arguments, and then prints them both when the comparison fails. It's funny that you say that because yesterday I was thinking how our SELF_CHECK macro could do like catch2's CHECK/REQUIRE macro and automatically do that. I don't know if you have used catch2 before, but the output of a failing test is: catch2.cpp:26: FAILED: CHECK( reverse_string("hello") == "bonjour" ) with expansion: "olleh" == "bonjour" I dismissed the idea because I thought people would find it's too much complexity for nothing, but if you are interested I'd be happy to look into it. Simon