Re: [spice-common v3 3/7] log: Add test case for logging code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 18, 2015 at 11:40:51AM +0100, Christophe Fergeau wrote:
> On Thu, Dec 17, 2015 at 10:43:05PM +0100, Victor Toso wrote:
> > > +/* Checks that g_return_if_fail() does not abort by default */
> > > +static void test_spice_non_fatal_g_return_if_fail(void)
> > > +{
> > > +    char *pattern = g_strconcat ("*", G_STRFUNC, "*", NULL);
> > > +    g_test_log_set_fatal_handler(non_fatal_warnings_criticals, pattern);
> > > +
> > > +    if (g_test_subprocess()) {
> > > +        g_return_if_fail(FALSE);
> > 
> > pattern leaks here
> 
> I know, but I don't think I can easily free it unless I move the
> g_return_if_fail() to a separate helper function.

For the record, the leak could probably be handled with
g_test_queue_free() as well:
« Enqueue a pointer to be released with g_free() during the next
teardown phase. This is equivalent to calling g_test_queue_destroy()
with a destroy callback of g_free(). »

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]