diff options
Diffstat (limited to 'gio')
-rw-r--r-- | gio/tests/gapplication.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/gio/tests/gapplication.c b/gio/tests/gapplication.c index 044bb3714..6e247a859 100644 --- a/gio/tests/gapplication.c +++ b/gio/tests/gapplication.c @@ -448,6 +448,61 @@ test_actions (void) g_object_unref (app); } +typedef GApplication TestLocCmdApp; +typedef GApplicationClass TestLocCmdAppClass; + +static GType test_loc_cmd_app_get_type (void); +G_DEFINE_TYPE (TestLocCmdApp, test_loc_cmd_app, G_TYPE_APPLICATION) + +static void +test_loc_cmd_app_init (TestLocCmdApp *app) +{ +} + +static void +test_loc_cmd_app_startup (GApplication *app) +{ + g_assert_not_reached (); +} + +static void +test_loc_cmd_app_shutdown (GApplication *app) +{ + g_assert_not_reached (); +} + +static gboolean +test_loc_cmd_app_local_command_line (GApplication *application, + gchar ***arguments, + gint *exit_status) +{ + return TRUE; +} + +static void +test_loc_cmd_app_class_init (TestLocCmdAppClass *klass) +{ + G_APPLICATION_CLASS (klass)->startup = test_loc_cmd_app_startup; + G_APPLICATION_CLASS (klass)->shutdown = test_loc_cmd_app_shutdown; + G_APPLICATION_CLASS (klass)->local_command_line = test_loc_cmd_app_local_command_line; +} + +static void +test_local_command_line (void) +{ + gchar *argv[] = { "./unimportant", "-invalid", NULL }; + GApplication *app; + + g_unsetenv ("DBUS_SESSION_BUS_ADDRESS"); + + app = g_object_new (test_loc_cmd_app_get_type (), + "application-id", "org.gtk.Unimportant", + "flags", G_APPLICATION_FLAGS_NONE, + NULL); + g_application_run (app, 1, argv); + g_object_unref (app); +} + int main (int argc, char **argv) { @@ -463,6 +518,7 @@ main (int argc, char **argv) g_test_add_func ("/gapplication/app-id", appid); g_test_add_func ("/gapplication/quit", test_quit); g_test_add_func ("/gapplication/actions", test_actions); + g_test_add_func ("/gapplication/local-command-line", test_local_command_line); return g_test_run (); } |