Re: [PATCH spice-server 1/2] tests: Check leaks registering migration interface

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

 



> 
> For the series,
> Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>
> though I would put the test after the fix, or squash both.
> 
> Christophe
> 

Some TDD methodologies suggest that test should first fail.
But this does not work well with git blame.
I reverted the order.

Frediano

> On Thu, Oct 12, 2017 at 03:56:16PM +0100, Frediano Ziglio wrote:
> > Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> > ---
> >  server/tests/test-leaks.c | 36 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 36 insertions(+)
> > 
> > diff --git a/server/tests/test-leaks.c b/server/tests/test-leaks.c
> > index 04dcac4f4..7032000aa 100644
> > --- a/server/tests/test-leaks.c
> > +++ b/server/tests/test-leaks.c
> > @@ -143,12 +143,48 @@ static void vmc_leaks(void)
> >      basic_event_loop_destroy();
> >  }
> >  
> > +static void migrate_cb(SpiceMigrateInstance *sin)
> > +{
> > +}
> > +
> > +static const SpiceMigrateInterface migrate_interface = {
> > +    .base = {
> > +        .type          = SPICE_INTERFACE_MIGRATION,
> > +        .description   = "migration",
> > +        .major_version = SPICE_INTERFACE_MIGRATION_MAJOR,
> > +        .minor_version = SPICE_INTERFACE_MIGRATION_MINOR,
> > +    },
> > +    .migrate_connect_complete = migrate_cb,
> > +    .migrate_end_complete = migrate_cb,
> > +};
> > +
> > +static void migration_leaks(void)
> > +{
> > +    SpiceCoreInterface *core;
> > +    SpiceServer *server = spice_server_new();
> > +    SpiceMigrateInstance migrate;
> > +
> > +    g_assert_nonnull(server);
> > +
> > +    core = basic_event_loop_init();
> > +    g_assert_nonnull(core);
> > +
> > +    g_assert_cmpint(spice_server_init(server, core), ==, 0);
> > +
> > +    migrate.base.sif = &migrate_interface.base;
> > +    spice_server_add_interface(server, &migrate.base);
> > +
> > +    spice_server_destroy(server);
> > +    basic_event_loop_destroy();
> > +}
> > +
> >  int main(int argc, char *argv[])
> >  {
> >      g_test_init(&argc, &argv, NULL);
> >  
> >      g_test_add_func("/server/server leaks", server_leaks);
> >      g_test_add_func("/server/vmc leaks", vmc_leaks);
> > +    g_test_add_func("/server/migration leaks", migration_leaks);
> >  
> >      return g_test_run();
> >  }
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://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]