public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ 1/2] unit: Add unit test for new MIN/MAX macros
Date: Thu, 16 Apr 2026 21:17:34 +0200	[thread overview]
Message-ID: <9d448d86c41020c2b820568aa0ee981d6437b798.camel@hadess.net> (raw)
In-Reply-To: <20260401204527.148077-1-hadess@hadess.net>

Hey Luiz,

I believe those 2 patches are also ready for review.

Cheers

On Wed, 2026-04-01 at 22:45 +0200, Bastien Nocera wrote:
> ---
>  Makefile.am      |  4 ++++
>  unit/test-util.c | 34 ++++++++++++++++++++++++++++++++++
>  2 files changed, 38 insertions(+)
>  create mode 100644 unit/test-util.c
> 
> diff --git a/Makefile.am b/Makefile.am
> index 2cfb884f1851..d9de71d587d8 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -696,6 +696,10 @@ unit_test_lib_SOURCES = unit/test-lib.c
>  unit_test_lib_LDADD = src/libshared-glib.la \
>  				lib/libbluetooth-internal.la
> $(GLIB_LIBS)
>  
> +unit_tests += unit/test-util
> +unit_test_util_LDADD = src/libshared-glib.la \
> +				lib/libbluetooth-internal.la
> $(GLIB_LIBS)
> +
>  unit_tests += unit/test-gatt
>  
>  unit_test_gatt_SOURCES = unit/test-gatt.c
> diff --git a/unit/test-util.c b/unit/test-util.c
> new file mode 100644
> index 000000000000..8ab16cc083ba
> --- /dev/null
> +++ b/unit/test-util.c
> @@ -0,0 +1,34 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + *
> + *  BlueZ - Bluetooth protocol stack for Linux
> + *
> + *  Copyright (C) 2026  Bastien Nocera <hadess@hadess.net>
> + *
> + *
> + */
> +
> +#include <assert.h>
> +
> +#include "src/shared/util.h"
> +#include "src/shared/tester.h"
> +
> +/* XXX glib.h must not be included, or it will clobber the
> + * MIN/MAX macros */
> +
> +static void test_min_max(const void *data)
> +{
> +	assert(MIN(3, 4) == 3);
> +	assert(MAX(3, 4) == 4);
> +	tester_test_passed();
> +}
> +
> +int main(int argc, char *argv[])
> +{
> +	tester_init(&argc, &argv);
> +
> +	tester_add("/util/min_max", NULL, NULL,
> +			test_min_max, NULL);
> +
> +	return tester_run();
> +}

  parent reply	other threads:[~2026-04-16 19:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-01 20:45 [PATCH BlueZ 1/2] unit: Add unit test for new MIN/MAX macros Bastien Nocera
2026-04-01 20:45 ` [PATCH BlueZ 2/2] all: Remove redundant MIN/MAX macro definitions Bastien Nocera
2026-04-01 22:06 ` [BlueZ,1/2] unit: Add unit test for new MIN/MAX macros bluez.test.bot
2026-04-16 19:17 ` Bastien Nocera [this message]
2026-04-17 18:10 ` [PATCH BlueZ 1/2] " patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d448d86c41020c2b820568aa0ee981d6437b798.camel@hadess.net \
    --to=hadess@hadess.net \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox