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 4C0E9C46467 for ; Sun, 8 Jan 2023 02:52:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9605F856A7; Sun, 8 Jan 2023 03:51:41 +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="SVSVaiPP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 325118565F; Sun, 8 Jan 2023 03:51:23 +0100 (CET) Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (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 77EA685602 for ; Sun, 8 Jan 2023 03:51:03 +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-il1-x12c.google.com with SMTP id h26so3279212ila.11 for ; Sat, 07 Jan 2023 18:51:03 -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=rBGdbz5xF6yzruSGRFe79XZLscPeOBNHWBKcFkIOSWo=; b=SVSVaiPPEMRHo93N4rmITHZprQg0e38JNM7MtjHsdOKtwx6Km8M0T/QqalqkRrTpff +8qOafkPi0zmjGwrTa96vAeNwspmeTUW1NGaKN516e4ABM46+axuii3y0mJxoKMRhQtW SbXfSjP666XRxju0+/yOTbUrYeBMTGZI6UJ/A= 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=rBGdbz5xF6yzruSGRFe79XZLscPeOBNHWBKcFkIOSWo=; b=i30nlqkMwaZODmW6006yqiAcoJknfZsIRaktH58cnId7DLUedLAR6U9oBlksrxr+i7 IZ+ZBvk4XCS3bzh6C5exhvfe9kt2RbnCAFhX68URXxsp8lbBlQCYv2Uoy/bJesPHYNl1 vEy/GTreuYSEDqUEJXIsKRkTjeTrZvlTdbhrp+ynsadm1PMQNi2feQbbAgJqKB14xqov 7D/i6jiGWsgwQOzEy5BkEa3HQzO56OSK6RFKfdR7vc0RZjP4GqxMCueL4y/uEc/uE9B8 eD3YU5FEiZ8rneoCUkqkv4d9Di5HPyUBCjw4mbdLMWQQnDKVcdXh8X3k5sgSuaFMmD+3 zKgg== X-Gm-Message-State: AFqh2koYDd86f8ndaS24T8XDFBvzPCITEahv+4/Tu6gjaDhkND1lxYsS IeD/mPdsP86tWCyKj1F+mAms2bTRHe8yIyav X-Google-Smtp-Source: AMrXdXusxASoqaFKl4+K41Fym+idZLgUH3Aj8Ml4p/ZhagCs6TlKtQyfOWZ4KM0UR+sH5Y6mVr+kHg== X-Received: by 2002:a92:cc82:0:b0:30b:d94a:db16 with SMTP id x2-20020a92cc82000000b0030bd94adb16mr37153298ilo.10.1673146261393; Sat, 07 Jan 2023 18:51:01 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-71-56-217-229.hsd1.co.comcast.net. [71.56.217.229]) by smtp.gmail.com with ESMTPSA id c17-20020a92bd11000000b00302a00aaefasm1622174ile.26.2023.01.07.18.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 18:51:01 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: U-Boot Custodians , Simon Glass , Marek Vasut , Pavel Herrmann Subject: [PATCH v2 03/71] dm: test: Correct assertion in dm_test_part() Date: Sat, 7 Jan 2023 19:49:39 -0700 Message-Id: <20230108025047.522240-4-sjg@chromium.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <20230108025047.522240-1-sjg@chromium.org> References: <20230108025047.522240-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 --- (no changes since v1) 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.314.g84b9a713c41-goog