From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19693 invoked by alias); 6 Aug 2019 18:43:31 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 19683 invoked by uid 89); 6 Aug 2019 18:43:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway22.websitewelcome.com Received: from gateway22.websitewelcome.com (HELO gateway22.websitewelcome.com) (192.185.46.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Aug 2019 18:43:30 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 6D73796BD77 for ; Tue, 6 Aug 2019 13:33:11 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id v4GlhedOXiQerv4Glh2BzI; Tue, 06 Aug 2019 13:33:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=pgGzOCl4FuF5JfMwq7Ec9+8SRfeS2z/JyKm6ogseY/w=; b=NQWiLhA5SGIzlmjrq1gj8uYeUY WCCk1djIUbTfg6+jZbKq//xokv+M+hKJ5yN0n/oWlx5+5X0G9poEr7D3a0YU9qjinQBxTdvSjBb35 hLk2ZnXo5LGvjW4XdPEmaLKkN; Received: from 97-122-178-82.hlrn.qwest.net ([97.122.178.82]:54374 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hv4Gl-002uK8-5H; Tue, 06 Aug 2019 13:33:11 -0500 From: Tom Tromey To: Philippe Waroquiers Cc: gdb-patches@sourceware.org Subject: Re: [RFAv2 2/2] Add a selftest that checks documentation invariants. References: <20190803133921.20154-1-philippe.waroquiers@skynet.be> <20190803133921.20154-3-philippe.waroquiers@skynet.be> Date: Tue, 06 Aug 2019 18:43:00 -0000 In-Reply-To: <20190803133921.20154-3-philippe.waroquiers@skynet.be> (Philippe Waroquiers's message of "Sat, 3 Aug 2019 15:39:21 +0200") Message-ID: <874l2u9mah.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-08/txt/msg00145.txt.bz2 >>>>> "Philippe" == Philippe Waroquiers writes: Philippe> gdb/ChangeLog Philippe> * unittests/help-doc-selftests.c: New file. Philippe> * Makefile.in: Add the new file. Thanks for doing this. Philippe> +static void Philippe> +broken_doc_invariant (const char *prefix, const char *name, const char *msg) Philippe> +{ Philippe> + fprintf_filtered (gdb_stdout, Philippe> + "help doc broken invariant: command '%s%s' help doc %s\n", Philippe> + prefix, name, msg); Normally I'd probably complain about being i18n-unfriendly here, but TBH I don't think that matters much for unit tests. Philippe> + /* Walk through the commands. */ Philippe> + for (c=commandlist;c;c=c->next) This needs some spaces. Philippe> + while (*p && *p != '\n') Philippe> + p++; I think this could just be "p = strchr (p, '\n')". This is ok with those things fixed. Tom