1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-14 00:17:35 +00:00
Purism-Calls/tests/setup-origin.c
Evangelos Ribeiro Tzaras 85c6ac2ff8 tests: dummy origin: Use correct origin
And unref it after we're done. Otherwise we're leaking memory because the dummy
provider only keeps actively unrefs the origin it added itself.
2022-01-20 10:23:09 +00:00

34 lines
903 B
C

/*
* Copyright (C) 2018 Purism SPC
*
* SPDX-License-Identifier: GPL-3.0+
*/
#include "setup-origin.h"
#include "calls-provider.h"
void
test_dummy_origin_set_up (OriginFixture *fixture,
gconstpointer user_data)
{
GListModel *origins;
test_dummy_provider_set_up (&fixture->parent, user_data);
/* provider adds an origin with name "Dummy origin" by itself... */
calls_dummy_provider_add_origin (fixture->parent.dummy_provider,
TEST_ORIGIN_NAME);
origins = calls_provider_get_origins
(CALLS_PROVIDER (fixture->parent.dummy_provider));
fixture->dummy_origin = g_list_model_get_item (origins, 1);
}
void
test_dummy_origin_tear_down (OriginFixture *fixture,
gconstpointer user_data)
{
g_clear_object (&fixture->dummy_origin);
test_dummy_provider_tear_down (&fixture->parent, user_data);
}