Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp565895rdb; Thu, 22 Feb 2024 12:07:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW+Diw8CTCoYNy/eqEWMlLOEoaU32e/Th42bu34EV5mqSJpH5sJ4fN2dI+sHkuk9cDcSAvyl/ufpz7YcbrW4zvyfoDTbO7yhjSVGRImFw== X-Google-Smtp-Source: AGHT+IGuQILZMChlrisuF8ZYcOIQqGEKCWbABDhrbUDIionTmxMjaAHhYqu92DzcaJSPXDJ189x2 X-Received: by 2002:a05:6871:a58e:b0:21f:898c:90d2 with SMTP id wd14-20020a056871a58e00b0021f898c90d2mr1877560oab.17.1708632451508; Thu, 22 Feb 2024 12:07:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708632451; cv=pass; d=google.com; s=arc-20160816; b=cy2BmELwsqV4FYbEmVutvkxjp9k9dwKBjFeNUd3QHB27HvfxASfba6CS/7WvG0orGh AyW0akqbM1ugMw05vCDLZ6tDNerZx7quArYql9iIjWIg8rGAWFBQSQuGCcROPXL5Se5V Na8u2KnMfLe9ynxEL4l6sk23inV/rLsjoQxBJLmqexko6MMcG/0H3/Od/ypKfysZksyc IkMdU6h+3l7vV78TrPnPR96FQx6SS4qIEX1DuwkxdyaLqB9N55U8tw3gwtc50s4CV8v2 gx/wqR6ea5jskRuN9m6Y8w4sxm2ukxdE1n/HsR78bEB5pj525LBkuEW9JcmnNQRUSvHQ 6SHg== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77298-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v18-20020ab05b52000000b007d952bdee65si2216013uae.22.2024.02.22.12.07.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 12:07:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77298-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77298-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3A4FE1C249F1 for ; Thu, 22 Feb 2024 20:07:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B12E66E5E1; Thu, 22 Feb 2024 20:07:24 +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-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --- 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); -- 2.43.0