1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-11-16 20:35:40 +00:00
Purism-Calls/tests/test-settings.c
Evangelos Ribeiro Tzaras e052201553 tests: Add testing for sideeffects of using CallsSettings
When setting up a binding between GSettings and GObject properties the
CallsSetting used to set the value from the GSetting to the property and
back to the GSetting.

While the value was still the default value it was marked as non default
because it had explicitly been set without any user interaction.
2022-05-13 19:58:07 +02:00

40 lines
993 B
C

/*
* Copyright (C) 2022 Purism SPC
*
* SPDX-License-Identifier: GPL-3.0+
*/
#include "calls-settings.h"
#define G_SETTINGS_ENABLE_BACKEND
#include <gio/gsettingsbackend.h>
#include <gtk/gtk.h>
static void
test_default (void)
{
g_autoptr (GSettings) gsettings = g_settings_new ("org.gnome.Calls");
g_autoptr (CallsSettings) calls_settings = NULL;
g_assert_null (g_settings_get_user_value (gsettings, "autoload-plugins"));
g_assert_null (g_settings_get_user_value (gsettings, "preferred-audio-codecs"));
/* we're testing if CallsSettings has the sideeffect of writing to the settings */
calls_settings = calls_settings_get_default ();
g_assert_null (g_settings_get_user_value (gsettings, "autoload-plugins"));
g_assert_null (g_settings_get_user_value (gsettings, "preferred-audio-codecs"));
}
int
main (gint argc,
gchar *argv[])
{
gtk_test_init (&argc, &argv, NULL);
g_test_add_func ("/Calls/Settings/default", test_default);
return g_test_run ();
}