[kdbus] KDBUS_ITEM_PAYLOAD_OFF items are (once again) relative to msg header
[platform/upstream/glib.git] / gio / tests / gdbus-test-codegen.c
index 8af2ca6..62c17e0 100644 (file)
@@ -13,9 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  *
  * Author: David Zeuthen <davidz@redhat.com>
  */
@@ -93,7 +91,7 @@ on_handle_hello_world (FooiGenBar             *object,
                        gpointer                user_data)
 {
   gchar *response;
-  response = g_strdup_printf ("Word! You said `%s'. I'm Skeleton, btw!", greeting);
+  response = g_strdup_printf ("Word! You said '%s'. I'm Skeleton, btw!", greeting);
   foo_igen_bar_complete_hello_world (object, invocation, response);
   g_free (response);
   return TRUE;
@@ -120,7 +118,7 @@ on_handle_test_primitive_types (FooiGenBar            *object,
   gchar *s1;
   gchar *s2;
   gchar *s3;
-  s1 = g_strdup_printf ("Word! You said `%s'. Rock'n'roll!", val_string);
+  s1 = g_strdup_printf ("Word! You said '%s'. Rock'n'roll!", val_string);
   s2 = g_strdup_printf ("/modified%s", val_objpath);
   s3 = g_strdup_printf ("assgit%s", val_signature);
   foo_igen_bar_complete_test_primitive_types (object,
@@ -699,6 +697,10 @@ static void
 check_bar_proxy (FooiGenBar *proxy,
                  GMainLoop  *thread_loop)
 {
+  const gchar *array_of_strings[3] = {"one", "two", NULL};
+  const gchar *array_of_strings_2[3] = {"one2", "two2", NULL};
+  const gchar *array_of_objpaths[3] = {"/one", "/one/two", NULL};
+  const gchar *array_of_bytestrings[3] = {"one\xff", "two\xff", NULL};
   guchar ret_val_byte;
   gboolean ret_val_boolean;
   gint16 ret_val_int16;
@@ -744,6 +746,9 @@ check_bar_proxy (FooiGenBar *proxy,
   gchar *val_finally_normal_name;
   GVariant *v;
   gchar *s;
+  const gchar *const *read_as;
+  const gchar *const *read_as2;
+  const gchar *const *read_as3;
 
   data = g_new0 (ClientData, 1);
   data->thread_loop = thread_loop;
@@ -838,10 +843,6 @@ check_bar_proxy (FooiGenBar *proxy,
   /* Try setting properties that requires memory management. This
    * is to exercise the paths that frees the references.
    */
-  const gchar *array_of_strings[3] = {"one", "two", NULL};
-  const gchar *array_of_strings_2[3] = {"one2", "two2", NULL};
-  const gchar *array_of_objpaths[3] = {"/one", "/one/two", NULL};
-  const gchar *array_of_bytestrings[3] = {"one\xff", "two\xff", NULL};
 
   g_object_set (proxy,
                 "s", "a string",
@@ -939,9 +940,6 @@ check_bar_proxy (FooiGenBar *proxy,
    * updates on them works as well (See comment for "property vfuncs"
    * in gio/gdbus-codegen/codegen.py for details)
    */
-  const gchar *const *read_as;
-  const gchar *const *read_as2;
-  const gchar *const *read_as3;
   read_as = foo_igen_bar_get_as (proxy);
   read_as2 = foo_igen_bar_get_as (proxy);
   g_assert_cmpint (g_strv_length ((gchar **) read_as), ==, 2);
@@ -2352,21 +2350,12 @@ int
 main (int   argc,
       char *argv[])
 {
-  gint ret;
-
   g_test_init (&argc, &argv, NULL);
 
-  session_bus_up ();
-
   g_test_add_func ("/gdbus/codegen/annotations", test_annotations);
   g_test_add_func ("/gdbus/codegen/interface_stability", test_interface_stability);
   g_test_add_func ("/gdbus/codegen/object-manager", test_object_manager);
   g_test_add_func ("/gdbus/codegen/property-naming", test_property_naming);
 
-  ret = g_test_run();
-
-  /* tear down bus */
-  session_bus_down ();
-
-  return ret;
+  return session_bus_run ();
 }