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 2861CC352A1 for ; Wed, 7 Dec 2022 08:54:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B4D0A85431; Wed, 7 Dec 2022 09:54:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="kG1MSRQg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6674E84EA1; Wed, 7 Dec 2022 09:54:01 +0100 (CET) Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1F5C385161 for ; Wed, 7 Dec 2022 09:53:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pj1-x1032.google.com with SMTP id t11-20020a17090a024b00b0021932afece4so826458pje.5 for ; Wed, 07 Dec 2022 00:53:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eZ3tErvXiVeiSPiye429rzGPINDBdPT1Y6xSqnQXPzw=; b=kG1MSRQgvhIkAXyHobeD7g7YHaMpqyJpbR8vFdOpo9QeWFhTICJbubG65mzm65ejDM bAzIQlDc9MLiss5GZ7R2RKIoPKTCizyVrpZwRxS96+j2ZhjQFQCrxgHjLG12Nhh1PjFk nN8nk7j3ltFskYfdF8/+Le85GwDgEP6BIKkJ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eZ3tErvXiVeiSPiye429rzGPINDBdPT1Y6xSqnQXPzw=; b=NnZqY70WhCPfGKFU0FBO+hWM2/MiY/0Cv6ZYOW+o/kOQxXoK2JIsKnc4S9oRYogtrV 7axXE1IEOG0po3FFIz+8Cjuxar35uzZMjco03WWfdAS4/f0hVmHibzdCjxcEEr34OMwU b9bvIli8hc36qpNQudxKRCIc9sIIXdFy1xij8lx1D7ph6CUAHybySlM05RxwBavaG/lL B5yWVCF7gRv22j+9nSOLxsGYYMW6mIsy/PiweZ9otCBx8tboQlzieLlg3hAfs2lmbnJg FnuPiO24m3aMxmMlLsbQ4YLoECqJhCEDMooopnqfk32FOu+tm5aJlFg3yX43epX02uiQ Esjw== X-Gm-Message-State: ANoB5plUir0G1C5m4YgDkDm31H1f7yirapnPT90Y97O85iXIJQmylQfq J7u8knqQzp97TROigBEM5V0wK8CvgtRjaRMZ X-Google-Smtp-Source: AA0mqf5kATosQVtNQQ49EhmkVn174RUcHKKLogNLuRrH+/nx+BPnbk6tTrwZ/jAWVqhubAMobfC1pA== X-Received: by 2002:a17:902:7482:b0:189:855c:eb56 with SMTP id h2-20020a170902748200b00189855ceb56mr44261108pll.54.1670403236261; Wed, 07 Dec 2022 00:53:56 -0800 (PST) Received: from localhost.localdomain ([27.110.126.54]) by smtp.gmail.com with ESMTPSA id l16-20020a170903121000b0018157b415dbsm14145514plh.63.2022.12.07.00.53.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 00:53:56 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: U-Boot Custodians , Simon Glass , Marek Vasut , Pavel Herrmann Subject: [PATCH 03/71] dm: test: Correct assertion in dm_test_part() Date: Wed, 7 Dec 2022 21:50:29 +1300 Message-Id: <20221207085137.445249-4-sjg@chromium.org> X-Mailer: git-send-email 2.39.0.rc0.267.gcb52ba06e7-goog In-Reply-To: <20221207085137.445249-1-sjg@chromium.org> References: <20221207085137.445249-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.6 at phobos.denx.de X-Virus-Status: Clean This obscures the line number. Update the test to avoid make sure that the line which failed is displayed, so it is possible to diagnose the failure. Signed-off-by: Simon Glass --- test/dm/part.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/dm/part.c b/test/dm/part.c index 78dd8472c2e..5e4efa587c3 100644 --- a/test/dm/part.c +++ b/test/dm/part.c @@ -11,8 +11,8 @@ #include #include -static inline int do_test(struct unit_test_state *uts, int expected, - const char *part_str, bool whole) +static int do_test(struct unit_test_state *uts, int expected, + const char *part_str, bool whole) { struct blk_desc *mmc_dev_desc; struct disk_partition part_info; @@ -54,11 +54,8 @@ static int dm_test_part(struct unit_test_state *uts) oldbootdevice = env_get("bootdevice"); -#define test(expected, part_str, whole) do { \ - ret = do_test(uts, expected, part_str, whole); \ - if (ret) \ - goto out; \ -} while (0) +#define test(expected, part_str, whole) \ + ut_assertok(do_test(uts, expected, part_str, whole)) env_set("bootdevice", NULL); test(-ENODEV, NULL, true); @@ -92,7 +89,6 @@ static int dm_test_part(struct unit_test_state *uts) test(2, "1#test2", false); ret = 0; -out: env_set("bootdevice", oldbootdevice); return ret; } -- 2.39.0.rc0.267.gcb52ba06e7-goog