From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 3843FEBCB91; Wed, 29 Jan 2025 12:45:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3843FEBCB91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1738143949; bh=VWzM2rCzTSijhmVmeOWDxrey0siVqTg4llnEp+I6/kI=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=fcVW2u1YOliABjvn+lIJbA/vVJJgybnruoPtNRQaeQqUVfBJn8Dq/PwzoivGkR3pR UGBwNxB4iXKGvadVbGL/4ZbLC7Xo8KBuK8shWOqk3s3mXidGXLgTOwzKqfdP4lh3JL 5zGFzEvrt2XTbjLb7xSGuW3HXnuxoYqBpSKgMsp8= Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id EB318EBCB8C for ; Wed, 29 Jan 2025 12:45:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EB318EBCB8C Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-53f757134cdso7166547e87.2 for ; Wed, 29 Jan 2025 01:45:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738143947; x=1738748747; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rSJZTRAknxmXvPKvF8M15/AKfLGxr+7HC4m97wDjx3o=; b=eF/0vjCAq+Pai3L393oeocybtsvYJeZRQcdRC5teUp3wW/KG+R2EYCsZSkfLaCK1DO 5WEY6esS8wljWnSBI3rYI7fImdKXQiIkYSOjqO8qsWqbPMdJ1zg6srapqaCZpoACaPJV 2EcIvq6zbWaU5Fke5y+EzL6pNfEeSaNR6OghXaktzz+XdCkhOm24O1Fz6eOagJoN9C0t BANDxb8NnATus1uR4W8hkYWp7ENRDZghBOtKevn8mj4UhC9Mhr1PKyba8S6lonvvuC+R DBdqKuPiWIabghYduE2ZTtw7OH2gXxIUdH+KOtlxXv2tkBcGheTHHRHjonEeGTXJBFFk 3LEA== X-Gm-Message-State: AOJu0YxmEfWkpwKLP9BTEpfAi985jRuyaTidjhUeM/DxNvpKvwp30p9t q746/8MgimEqa7U3d+JYFNvk7Mo95YGeXXPKYFODlVutqs62VA6xnN/Gbg== X-Gm-Gg: ASbGncvEUS/vHKN12aUTtu04PJnfX7K6juNSzjnPxACqS/GtMXRgMpV/T/C8NR9BPRK YA1pLSLOdgpCFVKQXUM1q9n7pnrNaWk+gd/Xy3eRwFTBKqLsbvVAe8DVpXQ9HIZyND4PUAXH4b4 finNVPxZZ13dGqS+BXaE7KXIht2aTTCr/vYfJP7efy46yRp+AxlZVfzpecLab7IvFyw7TLm2m0n MVkHdlv5NgZGJ37ucpqVgmX+25vTVbdwa/yQTC1gKNoypSrWw/5JUvqFztOPC6tELcj3TpYD6vy rBewwg== X-Google-Smtp-Source: AGHT+IETSfjUCAQNIxLBCbSKug7HJKEUaHJafk4wKwUriIFsQVHf5Rbdt363QKm0Q1ooSjSE+JNXoQ== X-Received: by 2002:a05:6512:158f:b0:542:29a6:a063 with SMTP id 2adb3069b0e04-543e4c3a0cbmr746202e87.43.1738143946678; Wed, 29 Jan 2025 01:45:46 -0800 (PST) Received: from localhost ([5.181.62.98]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-543c837e290sm1935027e87.218.2025.01.29.01.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jan 2025 01:45:46 -0800 (PST) X-Google-Original-From: Sergey Bronnikov To: tarantool-patches@dev.tarantool.org, Sergey Kaplun Date: Wed, 29 Jan 2025 12:39:43 +0300 Message-Id: <9b29c3fc69a0245861959fe80a322dc84ba8160b.1738143566.git.sergeyb@tarantool.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit] test: define UNUSED macros only once X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" The macros `UNUSED` is widely used across the suite `tarantool-c-tests`. The patch defines macros only once in `test.h` to reuse it in other tests and removes definitions in tests. --- Branch: https://github.com/tarantool/luajit/tree/ligurio/gh-xxxx-define-unused test/tarantool-c-tests/fix-yield-c-hook.test.c | 2 -- test/tarantool-c-tests/gh-8594-sysprof-ffunc-crash.test.c | 2 -- test/tarantool-c-tests/lj-1168-unmarked-finalizer-tab.test.c | 2 -- test/tarantool-c-tests/lj-549-lua-load.test.c | 2 -- test/tarantool-c-tests/misclib-sysprof-capi.test.c | 2 -- test/tarantool-c-tests/test.h | 2 ++ test/tarantool-c-tests/unit-tap.test.c | 2 -- 7 files changed, 2 insertions(+), 12 deletions(-) diff --git a/test/tarantool-c-tests/fix-yield-c-hook.test.c b/test/tarantool-c-tests/fix-yield-c-hook.test.c index 0e9fa5d6..aff4a371 100644 --- a/test/tarantool-c-tests/fix-yield-c-hook.test.c +++ b/test/tarantool-c-tests/fix-yield-c-hook.test.c @@ -3,8 +3,6 @@ #include "test.h" #include "utils.h" -#define UNUSED(x) ((void)(x)) - /* * This test demonstrates LuaJIT's incorrect behaviour, when * calling `lua_yield()` inside a C hook. diff --git a/test/tarantool-c-tests/gh-8594-sysprof-ffunc-crash.test.c b/test/tarantool-c-tests/gh-8594-sysprof-ffunc-crash.test.c index 769d333a..2550f43c 100644 --- a/test/tarantool-c-tests/gh-8594-sysprof-ffunc-crash.test.c +++ b/test/tarantool-c-tests/gh-8594-sysprof-ffunc-crash.test.c @@ -46,8 +46,6 @@ * * https://github.com/tarantool/tarantool/issues/9387 */ -#define UNUSED(x) ((void)(x)) - #define MESSAGE "Canary is alive" #define LUACALL "local a = tostring('" MESSAGE "') return a" diff --git a/test/tarantool-c-tests/lj-1168-unmarked-finalizer-tab.test.c b/test/tarantool-c-tests/lj-1168-unmarked-finalizer-tab.test.c index 9e57efb8..2d54da89 100644 --- a/test/tarantool-c-tests/lj-1168-unmarked-finalizer-tab.test.c +++ b/test/tarantool-c-tests/lj-1168-unmarked-finalizer-tab.test.c @@ -3,8 +3,6 @@ #include "test.h" -#define UNUSED(x) ((void)(x)) - /* * This test demonstrates LuaJIT's incorrect behaviour on * loading Lua chunk with cdata numbers. diff --git a/test/tarantool-c-tests/lj-549-lua-load.test.c b/test/tarantool-c-tests/lj-549-lua-load.test.c index 42a14be5..b0e94f6f 100644 --- a/test/tarantool-c-tests/lj-549-lua-load.test.c +++ b/test/tarantool-c-tests/lj-549-lua-load.test.c @@ -3,8 +3,6 @@ #include "lj_def.h" -#define UNUSED(x) ((void)(x)) - /* * XXX: In C language, objects with static storage duration have * to be initialized with constant expressions or with aggregate diff --git a/test/tarantool-c-tests/misclib-sysprof-capi.test.c b/test/tarantool-c-tests/misclib-sysprof-capi.test.c index 21e40d22..f0dc4405 100644 --- a/test/tarantool-c-tests/misclib-sysprof-capi.test.c +++ b/test/tarantool-c-tests/misclib-sysprof-capi.test.c @@ -18,8 +18,6 @@ /* Need for skipcond for OS and ARCH. */ #include "lj_arch.h" -#define UNUSED(x) ((void)(x)) - /* --- utils -------------------------------------------------- */ #define SYSPROF_INTERVAL_DEFAULT 100 diff --git a/test/tarantool-c-tests/test.h b/test/tarantool-c-tests/test.h index 3b22fb92..c1717932 100644 --- a/test/tarantool-c-tests/test.h +++ b/test/tarantool-c-tests/test.h @@ -4,6 +4,8 @@ #include #include +#define UNUSED(x) ((void)(x)) + /* * Test module, based on TAP 14 specification [1]. * [1]: https://testanything.org/tap-version-14-specification.html diff --git a/test/tarantool-c-tests/unit-tap.test.c b/test/tarantool-c-tests/unit-tap.test.c index ca0709ca..1f9a37ef 100644 --- a/test/tarantool-c-tests/unit-tap.test.c +++ b/test/tarantool-c-tests/unit-tap.test.c @@ -1,7 +1,5 @@ #include "test.h" -#define UNUSED(x) ((void)(x)) - static int test_ok(void *test_state) { UNUSED(test_state); -- 2.34.1