From patchwork Thu Feb 22 20:07:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 205034 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp182190dyb; Thu, 22 Feb 2024 12:07:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWRNMdqp7vBoWqEIooEkTkRaW1Cm+wxCNUmUVywYBI1cRbqbf5YZy+gagw+5/e+3ofXfQRw75aKcofZMGpbacedVKx0Kw== X-Google-Smtp-Source: AGHT+IFlr0AEgqIkkX55LRnDuWIpSOMAOQ1Wc6VeD9bRZ+Dem8IwfTrNiB2toF7wO2Fv98xGOEm7 X-Received: by 2002:a17:902:db11:b0:1db:f03b:6f5b with SMTP id m17-20020a170902db1100b001dbf03b6f5bmr16429058plx.56.1708632459349; Thu, 22 Feb 2024 12:07:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708632459; cv=pass; d=google.com; s=arc-20160816; b=YssZ9ARATi16CTa2P/PMIqc3vN0oErzyj/1X+lRYAulTUv2d1ggU2VpOUDlK8lgSpC tDRg2phaaU0w4+drOXUkW6Hoq/k0iMk3/xNqA4dEQtO7kIey5L5ZtacLYdvOvR8cR+7e pzbDHOaS7U4K2A1n6KBE0ur+WOr/90ar7wjwRPQAcQ9ovPShPoP1i5SnfCv+ROYJ6b76 shvj8viXdBuYnDO8qdhOyslBHYi5QJdAColpeMFlV2au6kTujfTDrL4O2gJm6d8KS1Hl sszK63MPtYg0RdMY8kgeFHaQJ/G6dOn3sTSHznDcBOQA2m/tt4g8vnASV0DZXeUiGDUX jN9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=8kGAuGVBdXin76xkPx6uMJEAXevBzhriShwLpohqHyg=; fh=LHoRBkCV7YFtute1bxRvAv2KoY1+DE4brpr3wmlFNFk=; b=HFh28cQm13MZOPhT/455wuVtYlMoubFqU5shyDKU/OfNNuroB/y1uR/OExWxIwRuGa 8w+z2lHcw0qVYNCCpHK+7ls1q0vWsAvW/DWBcAAoVrCxXmsG+ywtLgg2VsadW7VXCsvq Ik6np9oXhuZHyNkHvzOlv4wXBnOW9WhejDws1C/ZyBQrB0M3YVAMoMEm2M4f+PkxOkfL 7S78Ur8ILSbe8YbB5oSenS9I4g5I/PoADvcCYMiChOBMUZ8QOzutEN41OzNb1e8bnPjT Cu9jLslvHf61WWG8OWTvFRVtr0P2eGMDXsR4HM+UhKft9Mc9z7mcA14RcnxTwAT8/7J+ rWmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IipYHtpi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77298-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77298-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b1-20020a170902d30100b001d917fa8be8si10696196plc.257.2024.02.22.12.07.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 12:07:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77298-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IipYHtpi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77298-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77298-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2EB4528A9B0 for ; Thu, 22 Feb 2024 20:07:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82FB26E5FF; Thu, 22 Feb 2024 20:07:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IipYHtpi" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DAC781DFD9; Thu, 22 Feb 2024 20:07:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708632443; cv=none; b=trxk4hWQf9fd4P8E3Lf62YhDiA2703viZJHQLRUKMg2C7h5f92onTOsPyJRGxxeVX0GFVSJvrnGWBZ0s/iRxQLVMn8Perl8WbQTK4+mTltCJCjkJSL9LW44japxmZT0/D/Dr5jCXJBfYCnnoccPsZfkKEgRmZ6lKcCsT6xoOWmQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708632443; c=relaxed/simple; bh=KVIBnT2LtbhcVP80MhdOB/x/YdmrcAklBvoJsn7DqUU=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=CknjpuMxgkW6H5xlhKvxFthV4JE6To0d1ihY8ExkMq7hVjB0uKooWL48lvTFbrIuVGSPhh2xZS6O9oBnwc+e6Tw8GNgE2cIoKeXS01z2mbj4XHPTbdh30aRv+nuty+QwwLcUcb7gkJjqksmipmj5v0X49hFVUJjyv4NREj0OyLU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IipYHtpi; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25506C433C7; Thu, 22 Feb 2024 20:07:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708632443; bh=KVIBnT2LtbhcVP80MhdOB/x/YdmrcAklBvoJsn7DqUU=; h=Date:From:To:Cc:Subject:From; b=IipYHtpidMTbQoEZw7xa2XR/0ci+6GjBFLQy0jm2yAYyWUA9JIU3ZnpOMpAtOQFFa wG88tHFznzmblRpm2W3+hoLyMVKiQ2HlMkbA/CsD6dUBmEIG/jkGlVCjsRc1GqDC7i xkAy3jwoxMP4n4Sx2EtffrWmpaY3OMh3y0Okj+OX1L6Cdp2V/0pqrva/y3Ci1wV+n8 ymgVTMDNXpZ5nct9VNIk/EkG4K2HSAwn+LTOFCvzD8Ea6X8m2vESOGJ90yv3k1QUGS DwBT9U0dKPFjdrUyYkGy/bgLpBvxJDeJPCclYgo6Mlu/Bz2khN29uPxfjJJVb9DZ3C 5HUnwJX9JPdvQ== Date: Thu, 22 Feb 2024 17:07:20 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Adrian Hunter , Ian Rogers , Jiri Olsa , Linux Kernel Mailing List , linux-perf-users@vger.kernel.org Subject: [PATCH 1/1] perf test: Use TEST_FAIL in the TEST_ASSERT macros instead of -1 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791630989653573071 X-GMAIL-MSGID: 1791630989653573071 Just to make things clearer, return TEST_FAIL (-1) instead of an open coded -1. Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo Reviewed-by: Ian Rogers --- tools/perf/tests/tests.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h index dad3d7414142d1be..3aa7701ee0e939f7 100644 --- a/tools/perf/tests/tests.h +++ b/tools/perf/tests/tests.h @@ -4,11 +4,17 @@ #include +enum { + TEST_OK = 0, + TEST_FAIL = -1, + TEST_SKIP = -2, +}; + #define TEST_ASSERT_VAL(text, cond) \ do { \ if (!(cond)) { \ pr_debug("FAILED %s:%d %s\n", __FILE__, __LINE__, text); \ - return -1; \ + return TEST_FAIL; \ } \ } while (0) @@ -17,16 +23,10 @@ do { \ if (val != expected) { \ pr_debug("FAILED %s:%d %s (%d != %d)\n", \ __FILE__, __LINE__, text, val, expected); \ - return -1; \ + return TEST_FAIL; \ } \ } while (0) -enum { - TEST_OK = 0, - TEST_FAIL = -1, - TEST_SKIP = -2, -}; - struct test_suite; typedef int (*test_fnptr)(struct test_suite *, int);