[Spice-devel] [PATCH spice-server 1/2] tests: Check leaks registering migration interface
Christophe Fergeau
cfergeau at redhat.com
Fri Oct 13 14:39:28 UTC 2017
For the series,
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
though I would put the test after the fix, or squash both.
Christophe
On Thu, Oct 12, 2017 at 03:56:16PM +0100, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> 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();
> }
> --
> 2.13.6
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20171013/4ffca19e/attachment.sig>
More information about the Spice-devel
mailing list