From 2b7fc33ac0200b5a827d40315b7045433cb44860 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 3 May 2011 14:49:29 +0100 Subject: [PATCH 1/6] Rename test/core/unregister to registrations (no source changes) --- .gitignore | 2 +- test/core/Makefile.am | 6 ++-- test/core/registrations.c | 71 +++++++++++++++++++++++++++++++++++++++++++++ test/core/unregister.c | 71 --------------------------------------------- 4 files changed, 75 insertions(+), 75 deletions(-) create mode 100644 test/core/registrations.c delete mode 100644 test/core/unregister.c diff --git a/.gitignore b/.gitignore index 3bbaf2a..b8655f8 100644 --- a/.gitignore +++ b/.gitignore @@ -107,7 +107,7 @@ test/core/test-service-glib-glue.h /test/core/test-service-glib-subclass-glue.h test/core/test-thread-client test/core/test-thread-server -/test/core/test-unregister +/test/core/test-registrations /test/core/test-variant-recursion test/data/valid-service-files/debug-echo.service test/data/valid-service-files/debug-glib.service diff --git a/test/core/Makefile.am b/test/core/Makefile.am index ccb17f6..82fb8f7 100644 --- a/test/core/Makefile.am +++ b/test/core/Makefile.am @@ -55,7 +55,7 @@ noinst_PROGRAMS = \ test-types \ test-5688 \ test-30574 \ - test-unregister \ + test-registrations \ test-variant-recursion \ test-gvariant @@ -70,13 +70,13 @@ test_5688_SOURCES = \ test_30574_SOURCES = \ 30574.c -test_unregister_SOURCES = \ +test_registrations_SOURCES = \ my-object.c \ my-object.h \ my-object-subclass.c \ my-object-subclass.h \ my-object-marshal.c \ - unregister.c + registrations.c test_dbus_glib_SOURCES= \ my-object-marshal.c \ diff --git a/test/core/registrations.c b/test/core/registrations.c new file mode 100644 index 0000000..0091444 --- /dev/null +++ b/test/core/registrations.c @@ -0,0 +1,71 @@ +/* Feature test for freedesktop.org #21219. + * + * Copyright © 2009 Collabora Ltd. + * Copyright © 2009 Nokia Corporation + * + * In preparation for dbus-glib relicensing (if it ever happens), this file is + * licensed under (at your option) either the AFL v2.1, the GPL v2 or later, + * or an MIT/X11-style license: + * + * Licensed under the Academic Free License version 2.1 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include + +#include "my-object.h" + +GMainLoop *loop; + +int +main (int argc, char **argv) +{ + DBusGConnection *connection; + GError *error = NULL; + GObject *obj; + + loop = g_main_loop_new (NULL, FALSE); + + g_type_init (); + g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL); + + connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); + + if (connection == NULL) + g_error ("failed to get bus: %s %d: %s", g_quark_to_string (error->domain), + error->code, error->message); + + obj = g_object_new (MY_TYPE_OBJECT, NULL); + dbus_g_connection_register_g_object (connection, "/foo", obj); + g_assert (dbus_g_connection_lookup_g_object (connection, "/foo") == obj); + dbus_g_connection_unregister_g_object (connection, obj); + g_assert (dbus_g_connection_lookup_g_object (connection, "/foo") == NULL); + + g_object_unref (obj); + + return 0; +} diff --git a/test/core/unregister.c b/test/core/unregister.c deleted file mode 100644 index 0091444..0000000 --- a/test/core/unregister.c +++ /dev/null @@ -1,71 +0,0 @@ -/* Feature test for freedesktop.org #21219. - * - * Copyright © 2009 Collabora Ltd. - * Copyright © 2009 Nokia Corporation - * - * In preparation for dbus-glib relicensing (if it ever happens), this file is - * licensed under (at your option) either the AFL v2.1, the GPL v2 or later, - * or an MIT/X11-style license: - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#include - -#include "my-object.h" - -GMainLoop *loop; - -int -main (int argc, char **argv) -{ - DBusGConnection *connection; - GError *error = NULL; - GObject *obj; - - loop = g_main_loop_new (NULL, FALSE); - - g_type_init (); - g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL); - - connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); - - if (connection == NULL) - g_error ("failed to get bus: %s %d: %s", g_quark_to_string (error->domain), - error->code, error->message); - - obj = g_object_new (MY_TYPE_OBJECT, NULL); - dbus_g_connection_register_g_object (connection, "/foo", obj); - g_assert (dbus_g_connection_lookup_g_object (connection, "/foo") == obj); - dbus_g_connection_unregister_g_object (connection, obj); - g_assert (dbus_g_connection_lookup_g_object (connection, "/foo") == NULL); - - g_object_unref (obj); - - return 0; -} -- 1.7.4.4