From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 70BF11F47C for ; Thu, 12 Jan 2023 15:57:55 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=clisp.org header.i=@clisp.org header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=WjWCf+ZD; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFzwO-0003MY-4F; Thu, 12 Jan 2023 10:56:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFzwK-0003Ln-5A for bug-gnulib@gnu.org; Thu, 12 Jan 2023 10:56:29 -0500 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.220]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFzwH-0001YE-UH for bug-gnulib@gnu.org; Thu, 12 Jan 2023 10:56:27 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1673538982; cv=none; d=strato.com; s=strato-dkim-0002; b=fFkCb10E8B482yEkt73qj+r8KxvtipWQRwV7RJHPhcD9gOVG42eKIXWKnROWfUe+xp Wj5ekmykJjt446nlmfykL8QH08PBurWsvCSMBaWcsQti+wesFqgg71X5FbbBs5K7Q4l8 ljHxegTGWzKLbl+4swIBJ3YcqdnaShAkhygMs7CVT4fD3KOFn0xy0dqGfEfU7+cX7ZYO 5pc4secxtHj6BdHvTWUsaHAUZqohW6qPPZzkw2FIMt8FqE5ppSwmCjwQFQhVkZeVTr7d H1DQTAKsOkEpFvEHvEYOv2kn0gz/ubl+cd1sVR3Ekpy79yQr75OiDdhLVjIAUNkJ0ydv I6lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1673538982; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From: Subject:Sender; bh=XuBbBIaIdy+Ni2GxaUCtTAkoZofwyZUTIW9nl7mfaCw=; b=Xy9khpOTMeeke5b5jvf0Ck5ZARrIomPArHu83EQwbqbFoXQ9io19FIktR8hOpJdYqd L60tStNd+wh5CA/oKu5YAYxCr/Ido9OPukle8EYPFB2rUPbSbnzplBCOx0uKf2Zngc+S LqUdQicjDppHaxzPL0Ombu929OLlfR43j7SUvnOsRI/GHNvcFqszIwOxaSfXf7A8E9B/ V9pJOXhOorx7J19Y0GOynzJMBNEaRY7GdchlqUDr4x/PEXSWF0rqJdlF47/RrAra3YjV 31+rLwbRkVk8ND9Y+76qIG8VHCurwTyRunm8tVzlbCBvvc8qe7oXv9rY+PWbgw6RKZ+G B7OA== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1673538982; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From: Subject:Sender; bh=XuBbBIaIdy+Ni2GxaUCtTAkoZofwyZUTIW9nl7mfaCw=; b=WjWCf+ZD+oP4gMHT+Ln7scWNEq5RY7fbpTZjzarg8X7mXcQTH/LEr2UPkZNe/tjXmj g3wvGbBoQ15SB078+fPsqMSM70BiQoOMMqhB6wEpd6pqt609F+dCL/CNUIc6WOFiTxKM jxBCiNfqkxkyMfXTEnIbU4HIOSaTijp48UPRfAQLTwY2INqP3usUWRIFRZ5aEesvu7nP ypJrERY1f+OlQgjIFDZ8nt6v/+Rz1Tbk/FqGBTbIqDgLiGVUMbG7fjTiEKW3x1AvRbS6 GKslEX2arWAResM+x9KDbqkH8tEN8jQl4plU4fVjsJXzoWoyXbbeoIGTZp35jhva39qq kmtg== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpOXjv2XTu3l95++Pe54Opj0GYzUnQ==" Received: from nimes.localnet by smtp.strato.de (RZmta 48.6.2 AUTH) with ESMTPSA id I8f358z0CFuM7pM (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 12 Jan 2023 16:56:22 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org Subject: Re: error, verror: Add tests Date: Thu, 12 Jan 2023 16:56:22 +0100 Message-ID: <2366769.aiPYRZItUj@nimes> In-Reply-To: <3640038.8FI41Ny9JD@nimes> References: <3640038.8FI41Ny9JD@nimes> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=81.169.146.220; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org > 2023-01-12 Bruno Haible > > verror: Add tests. > * tests/test-verror.sh: New file, based on tests/test-error.sh. > * tests/test-verror.c: New file, based on tests/test-error.c. > * modules/verror-tests: New file. > > 2023-01-12 Bruno Haible > > error: Add tests. > * tests/test-error.sh: New file. > * tests/test-error.c: New file. > * modules/error-tests: New file. Note that the tests do *not* test the situation of error_at_line with a NULL file name argument, since this is not described as supported in the glibc documentation. 2023-01-12 Bruno Haible error, verror tests: Add clarification. * tests/test-error.c (main): Clarify why we don't test error_at_line with a NULL filename. * tests/test-verror.c (main): Clarify why we don't test verror_at_line with a NULL filename. diff --git a/tests/test-error.c b/tests/test-error.c index 67600d34f9..697e783eee 100644 --- a/tests/test-error.c +++ b/tests/test-error.c @@ -66,6 +66,10 @@ main (int argc, char *argv[]) error_print_progname = print_no_progname; error (0, 0, "hammer"); error (0, 0, "boing %d%d%d is too large", 1, 2, 3); + #if 0 + /* The documentation does not describe the output if the file name is NULL. */ + error_at_line (0, 0, NULL, 42, "drummer too loud"); + #endif error_at_line (0, 0, "d2/bar.c", 11, "bark too loud"); /* Verify error_message_count. */ ASSERT (error_message_count == 11); diff --git a/tests/test-verror.c b/tests/test-verror.c index c5a62cddec..7c808d7908 100644 --- a/tests/test-verror.c +++ b/tests/test-verror.c @@ -109,6 +109,10 @@ main (int argc, char *argv[]) error_print_progname = print_no_progname; test_zero ("hammer"); test_zero ("boing %d%d%d is too large", 1, 2, 3); + #if 0 + /* The documentation does not describe the output if the file name is NULL. */ + test_zero_at_line (NULL, 42, "drummer too loud"); + #endif test_zero_at_line ("d2/bar.c", 11, "bark too loud"); /* Verify error_message_count. */ ASSERT (error_message_count == 11);