From: Marcel Holtmann <marcel@holtmann.org>
To: Syam Sidhardhan <syamsidhardh@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: usage of g_test_fail() which is introduced in Glib 2.30
Date: Mon, 07 Jan 2013 19:26:57 -0800 [thread overview]
Message-ID: <1357615617.1806.24.camel@aeonflux> (raw)
In-Reply-To: <CAFBvHie6nCYJpR1VJWdg+ki=TiZcvpR7R43xGrox_Z5pf0pCiw@mail.gmail.com>
Hi Syam,
> In the latest Bluez snapshot I'm getting the g_test_fail compilation
> error. The problem
> happens because we use the Glib minimum version requirement
> as 2.28 and this API is introduced in GLib version 2.30.
> Do we need to use the g_test_fail() now with Glib 2.28?
> I guess we cannot replace it with a wrapper function.
>
>
> Possible Patch:
>
> From: Syam Sidhardhan <s.syam@samsung.com>
> Date: Mon, 7 Jan 2013 17:22:00 -0300
> Subject: [PATCH 1/1] unit: Remove g_test_fail()
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> g_test_fail() is introduced in Glib v2.30 and we are using
> Glib v2.28 as the minimum requirement for the build.
> This patch resolves the compilation error that happen with
> Glib version < 2.30.
>
> Error log:
> CC unit/test-mgmt.o
> unit/test-mgmt.c: In function ‘check_actions’:
> unit/test-mgmt.c:100:2: error: implicit declaration of
> function ‘g_test_fail’ [-Werror=implicit-function-declaration]
> cc1: all warnings being treated as errors
> make[1]: *** [unit/test-mgmt.o] Error 1
> make: *** [all] Error 2
> ---
> unit/test-mgmt.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/unit/test-mgmt.c b/unit/test-mgmt.c
> index 2d1a5d6..6b3689c 100644
> --- a/unit/test-mgmt.c
> +++ b/unit/test-mgmt.c
> @@ -97,7 +97,6 @@ static void check_actions(struct context *context,
> }
>
> g_test_message("Command not handled\n");
> - g_test_fail();
> }
lets just use g_assert to fail here.
I assumed g_test_fail lets you gracefully fail, but that is just bogus
as I learned the hard way. So no point in bothering here.
Regards
Marcel
prev parent reply other threads:[~2013-01-08 3:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-07 20:35 usage of g_test_fail() which is introduced in Glib 2.30 Syam Sidhardhan
2013-01-08 3:26 ` Marcel Holtmann [this message]
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=1357615617.1806.24.camel@aeonflux \
--to=marcel@holtmann.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=syamsidhardh@gmail.com \
/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