Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E97D8EB64DC for ; Wed, 12 Jul 2023 01:49:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EF4B98691B; Wed, 12 Jul 2023 03:49:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1689126545; bh=iLqsLXXt+BYlDYB70/+qCbZlLSfTsqlTQRPyRdq1Iew=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=r8lbk+aRWgtGNGySkxaMcd37oG2vVabNQirG+/GSAGGiu+iM5E6zeWXADuLXqKN1I OOI3dqU4w2p+iWWmn/+YWayD3WD/I/HbZswqYHCyVX6Mdmntv9Wqx8j/MRXh5Okydj O+qPchd31IY1Tah3Xatg8DUnJKXNgJbJanPe87iQ9vmRU9zvRjSDAmQ3To+kITf7J6 8Y04x3vmkXa3sfUj/piLsH1R2HMbL7RjHGyfq+RzMfHH0u6t3ULJWSt+Pzrf426d8l ckxy369+ZqjWI8/s9yA77vh2xcpV9hLYgIlaesNky59zb22+cJtgbZbCHWObE6d7yP fjHKKh2P8pNUw== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 1148A86903; Wed, 12 Jul 2023 03:49:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1689126542; bh=iLqsLXXt+BYlDYB70/+qCbZlLSfTsqlTQRPyRdq1Iew=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=orARoYMyiTRcM27fbirkMWluFfMxz5oNsXGB14bqc9T+kxmJ1BrUb/A59fKlZwbR1 g2apo1itx8XdLwYmtGLeMrxDrdBiT+2tHaEcyzQtMoUFB6GfqtNyDerVoHHwu6Emcj 1cIWNxJRuevHXA+psO8B5kn9sp4CWginTg5EYKuYwnbb2b2Uuy5VGa0++wDdyOIDsD c37lT1qn1w9jY9TAmm0euSXBRnyA5u9TTmrSGB5S4R/cxijORqXBT9z8MRHH8hFo1z SvgmyBzPf74rV6uXVKJAYFdz/La2+0JDFBQECEO9/PNALX2QFZEEkgyG3RhWHq8Unp BoIMI5i8KS2sg== Message-ID: <9ed32867-065c-07a0-35bf-a3f3db0387f2@denx.de> Date: Wed, 12 Jul 2023 03:49:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] bdinfo: Correct use of assertions Content-Language: en-US To: Simon Glass Cc: U-Boot Mailing List , Tom Rini , Marek Vasut References: <20230711225159.2328495-1-sjg@chromium.org> From: Marek Vasut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 7/12/23 02:24, Simon Glass wrote: > Hi Marek, Hi, > On Tue, 11 Jul 2023 at 17:10, Marek Vasut wrote: >> >> On 7/12/23 00:51, Simon Glass wrote: >>> This test was written for the incorrect use of assertions. Update it to >>> build with the previous approach, where tests fail at the first >>> assertion. >> >> So basically ut_assert_nextline() does not automatically bail, you have >> to make it expand to return -ERRNO and check for that errno again with >> ut_assertok() at the callsite ? > > Yes, or any non-zero value. The call stack unwinds since each function > that fails returns a non-zero value. It would be nice to spell this out explicitly in the commit message. This behavior really is inobvious.