diff options
Diffstat (limited to 'tests/test-mock-gio.h')
-rw-r--r-- | tests/test-mock-gio.h | 92 |
1 files changed, 67 insertions, 25 deletions
diff --git a/tests/test-mock-gio.h b/tests/test-mock-gio.h index 2cc38f15..fae260ab 100644 --- a/tests/test-mock-gio.h +++ b/tests/test-mock-gio.h @@ -23,8 +23,8 @@ #pragma once #include <gio/gio.h> -#include <glib.h> #include <glib-object.h> +#include <glib.h> #include <libglnx.h> #include "ostree-types.h" @@ -35,24 +35,36 @@ G_BEGIN_DECLS /* Manually expanded version of the following, omitting autoptr support (for GLib < 2.44): G_GNUC_INTERNAL -G_DECLARE_FINAL_TYPE (OstreeMockVolumeMonitor, ostree_mock_volume_monitor, OSTREE, MOCK_VOLUME_MONITOR, GVolumeMonitor) */ +G_DECLARE_FINAL_TYPE (OstreeMockVolumeMonitor, ostree_mock_volume_monitor, OSTREE, +MOCK_VOLUME_MONITOR, GVolumeMonitor) */ G_GNUC_INTERNAL GType ostree_mock_volume_monitor_get_type (void); G_GNUC_BEGIN_IGNORE_DEPRECATIONS typedef struct _OstreeMockVolumeMonitor OstreeMockVolumeMonitor; -typedef struct { GVolumeMonitorClass parent_class; } OstreeMockVolumeMonitorClass; - -static inline OstreeMockVolumeMonitor *OSTREE_MOCK_VOLUME_MONITOR (gpointer ptr) { return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_mock_volume_monitor_get_type (), OstreeMockVolumeMonitor); } -static inline gboolean OSTREE_IS_MOCK_VOLUME_MONITOR (gpointer ptr) { return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_mock_volume_monitor_get_type ()); } +typedef struct +{ + GVolumeMonitorClass parent_class; +} OstreeMockVolumeMonitorClass; + +static inline OstreeMockVolumeMonitor * +OSTREE_MOCK_VOLUME_MONITOR (gpointer ptr) +{ + return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_mock_volume_monitor_get_type (), + OstreeMockVolumeMonitor); +} +static inline gboolean +OSTREE_IS_MOCK_VOLUME_MONITOR (gpointer ptr) +{ + return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_mock_volume_monitor_get_type ()); +} G_GNUC_END_IGNORE_DEPRECATIONS G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeMockVolumeMonitor, g_object_unref) G_GNUC_INTERNAL -GVolumeMonitor *ostree_mock_volume_monitor_new (GList *mounts, - GList *volumes); +GVolumeMonitor *ostree_mock_volume_monitor_new (GList *mounts, GList *volumes); #define OSTREE_TYPE_MOCK_VOLUME (ostree_mock_volume_get_type ()) @@ -65,18 +77,27 @@ GType ostree_mock_volume_get_type (void); G_GNUC_BEGIN_IGNORE_DEPRECATIONS typedef struct _OstreeMockVolume OstreeMockVolume; -typedef struct { GObjectClass parent_class; } OstreeMockVolumeClass; - -static inline OstreeMockVolume *OSTREE_MOCK_VOLUME (gpointer ptr) { return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_mock_volume_get_type (), OstreeMockVolume); } -static inline gboolean OSTREE_IS_MOCK_VOLUME (gpointer ptr) { return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_mock_volume_get_type ()); } +typedef struct +{ + GObjectClass parent_class; +} OstreeMockVolumeClass; + +static inline OstreeMockVolume * +OSTREE_MOCK_VOLUME (gpointer ptr) +{ + return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_mock_volume_get_type (), OstreeMockVolume); +} +static inline gboolean +OSTREE_IS_MOCK_VOLUME (gpointer ptr) +{ + return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_mock_volume_get_type ()); +} G_GNUC_END_IGNORE_DEPRECATIONS G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeMockVolume, g_object_unref) G_GNUC_INTERNAL -OstreeMockVolume *ostree_mock_volume_new (const gchar *name, - GDrive *drive, - GMount *mount); +OstreeMockVolume *ostree_mock_volume_new (const gchar *name, GDrive *drive, GMount *mount); #define OSTREE_TYPE_MOCK_DRIVE (ostree_mock_drive_get_type ()) @@ -89,10 +110,21 @@ GType ostree_mock_drive_get_type (void); G_GNUC_BEGIN_IGNORE_DEPRECATIONS typedef struct _OstreeMockDrive OstreeMockDrive; -typedef struct { GObjectClass parent_class; } OstreeMockDriveClass; - -static inline OstreeMockDrive *OSTREE_MOCK_DRIVE (gpointer ptr) { return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_mock_drive_get_type (), OstreeMockDrive); } -static inline gboolean OSTREE_IS_MOCK_DRIVE (gpointer ptr) { return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_mock_drive_get_type ()); } +typedef struct +{ + GObjectClass parent_class; +} OstreeMockDriveClass; + +static inline OstreeMockDrive * +OSTREE_MOCK_DRIVE (gpointer ptr) +{ + return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_mock_drive_get_type (), OstreeMockDrive); +} +static inline gboolean +OSTREE_IS_MOCK_DRIVE (gpointer ptr) +{ + return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_mock_drive_get_type ()); +} G_GNUC_END_IGNORE_DEPRECATIONS G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeMockDrive, g_object_unref) @@ -111,16 +143,26 @@ GType ostree_mock_mount_get_type (void); G_GNUC_BEGIN_IGNORE_DEPRECATIONS typedef struct _OstreeMockMount OstreeMockMount; -typedef struct { GObjectClass parent_class; } OstreeMockMountClass; - -static inline OstreeMockMount *OSTREE_MOCK_MOUNT (gpointer ptr) { return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_mock_mount_get_type (), OstreeMockMount); } -static inline gboolean OSTREE_IS_MOCK_MOUNT (gpointer ptr) { return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_mock_mount_get_type ()); } +typedef struct +{ + GObjectClass parent_class; +} OstreeMockMountClass; + +static inline OstreeMockMount * +OSTREE_MOCK_MOUNT (gpointer ptr) +{ + return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_mock_mount_get_type (), OstreeMockMount); +} +static inline gboolean +OSTREE_IS_MOCK_MOUNT (gpointer ptr) +{ + return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_mock_mount_get_type ()); +} G_GNUC_END_IGNORE_DEPRECATIONS G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeMockMount, g_object_unref) G_GNUC_INTERNAL -OstreeMockMount *ostree_mock_mount_new (const gchar *name, - GFile *root); +OstreeMockMount *ostree_mock_mount_new (const gchar *name, GFile *root); G_END_DECLS |