mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-03 07:53:39 +02:00
Improve test coverage
Various test additions, mainly in GObject
This commit is contained in:
@@ -221,12 +221,44 @@ basic (void)
|
||||
session_bus_down ();
|
||||
}
|
||||
|
||||
static void
|
||||
properties (void)
|
||||
{
|
||||
GObject *app;
|
||||
gchar *id;
|
||||
GApplicationFlags flags;
|
||||
gboolean registered;
|
||||
guint timeout;
|
||||
|
||||
app = g_object_new (G_TYPE_APPLICATION,
|
||||
"application-id", "org.gtk.TestApplication",
|
||||
NULL);
|
||||
|
||||
g_object_get (app,
|
||||
"application-id", &id,
|
||||
"flags", &flags,
|
||||
"is-registered", ®istered,
|
||||
"inactivity-timeout", &timeout,
|
||||
NULL);
|
||||
|
||||
g_assert_cmpstr (id, ==, "org.gtk.TestApplication");
|
||||
g_assert_cmpint (flags, ==, G_APPLICATION_FLAGS_NONE);
|
||||
g_assert (!registered);
|
||||
g_assert_cmpint (timeout, ==, 0);
|
||||
|
||||
g_object_unref (app);
|
||||
g_free (id);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
g_type_init ();
|
||||
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
|
||||
g_test_add_func ("/gapplication/basic", basic);
|
||||
g_test_add_func ("/gapplication/properties", properties);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
|
@@ -158,7 +158,7 @@ test_wrong_path (void)
|
||||
{
|
||||
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR))
|
||||
{
|
||||
GSettings *settings;
|
||||
GSettings *settings G_GNUC_UNUSED;
|
||||
|
||||
settings = g_settings_new_with_path ("org.gtk.test", "/wrong-path/");
|
||||
}
|
||||
@@ -172,7 +172,7 @@ test_no_path (void)
|
||||
{
|
||||
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR))
|
||||
{
|
||||
GSettings *settings;
|
||||
GSettings *settings G_GNUC_UNUSED;
|
||||
|
||||
settings = g_settings_new ("org.gtk.test.no-path");
|
||||
}
|
||||
|
Reference in New Issue
Block a user