aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2020-08-31 16:41:56 +0200
committerRobert Tari <robert@tari.in>2020-08-31 16:41:56 +0200
commitcacf569a9a95ea39c78b124987bf4dae72557f27 (patch)
tree6e58ce183724b17b1e89550dac80e51a4865b361 /tests
parenta8b9159200845d9ec6547e511379d8275cc11b2a (diff)
downloadayatana-indicator-session-cacf569a9a95ea39c78b124987bf4dae72557f27.tar.gz
ayatana-indicator-session-cacf569a9a95ea39c78b124987bf4dae72557f27.tar.bz2
ayatana-indicator-session-cacf569a9a95ea39c78b124987bf4dae72557f27.zip
Fix deprecated symbols and build warnings
Diffstat (limited to 'tests')
-rw-r--r--tests/backend-mock-guest.c14
-rw-r--r--tests/backend-mock-guest.h4
-rw-r--r--tests/backend-mock-users.c14
-rw-r--r--tests/backend-mock-users.h4
-rw-r--r--tests/test-service.cc9
5 files changed, 20 insertions, 25 deletions
diff --git a/tests/backend-mock-guest.c b/tests/backend-mock-guest.c
index 8bc188f..dc439c5 100644
--- a/tests/backend-mock-guest.c
+++ b/tests/backend-mock-guest.c
@@ -21,18 +21,16 @@
#include "backend-mock-guest.h"
-struct _IndicatorSessionGuestMockPriv
+struct _IndicatorSessionGuestMockPrivate
{
gboolean guest_is_active;
gboolean guest_is_logged_in;
gboolean guest_is_allowed;
};
-typedef IndicatorSessionGuestMockPriv priv_t;
+typedef IndicatorSessionGuestMockPrivate priv_t;
-G_DEFINE_TYPE (IndicatorSessionGuestMock,
- indicator_session_guest_mock,
- INDICATOR_TYPE_SESSION_GUEST)
+G_DEFINE_TYPE_WITH_PRIVATE(IndicatorSessionGuestMock, indicator_session_guest_mock, INDICATOR_TYPE_SESSION_GUEST)
/**
*** IndicatorSessionGuest virtual functions
@@ -100,8 +98,6 @@ indicator_session_guest_mock_class_init (IndicatorSessionGuestMockClass * klass)
guest_class->is_logged_in = my_is_logged_in;
guest_class->is_active = my_is_active;
guest_class->switch_to_guest = my_switch_to_guest;
-
- g_type_class_add_private (klass, sizeof (IndicatorSessionGuestMockPriv));
}
static void
@@ -110,9 +106,7 @@ indicator_session_guest_mock_init (IndicatorSessionGuestMock * self)
{
priv_t * p;
- p = G_TYPE_INSTANCE_GET_PRIVATE (self,
- INDICATOR_TYPE_SESSION_GUEST_MOCK,
- IndicatorSessionGuestMockPriv);
+ p = indicator_session_guest_mock_get_instance_private(self);
self->priv = p;
p->guest_is_allowed = TRUE;
diff --git a/tests/backend-mock-guest.h b/tests/backend-mock-guest.h
index 4a15c70..a320a45 100644
--- a/tests/backend-mock-guest.h
+++ b/tests/backend-mock-guest.h
@@ -33,7 +33,7 @@ G_BEGIN_DECLS
#define INDICATOR_IS_SESSION_GUEST_MOCK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), INDICATOR_TYPE_SESSION_GUEST_MOCK))
typedef struct _IndicatorSessionGuestMock IndicatorSessionGuestMock;
-typedef struct _IndicatorSessionGuestMockPriv IndicatorSessionGuestMockPriv;
+typedef struct _IndicatorSessionGuestMockPrivate IndicatorSessionGuestMockPrivate;
typedef struct _IndicatorSessionGuestMockClass IndicatorSessionGuestMockClass;
/**
@@ -43,7 +43,7 @@ struct _IndicatorSessionGuestMock
{
/*< private >*/
IndicatorSessionGuest parent;
- IndicatorSessionGuestMockPriv * priv;
+ IndicatorSessionGuestMockPrivate * priv;
};
struct _IndicatorSessionGuestMockClass
diff --git a/tests/backend-mock-users.c b/tests/backend-mock-users.c
index f2291cd..a891c69 100644
--- a/tests/backend-mock-users.c
+++ b/tests/backend-mock-users.c
@@ -20,16 +20,14 @@
#include "backend-mock.h"
#include "backend-mock-users.h"
-struct _IndicatorSessionUsersMockPriv
+struct _IndicatorSessionUsersMockPrivate
{
GHashTable * users;
};
-typedef IndicatorSessionUsersMockPriv priv_t;
+typedef IndicatorSessionUsersMockPrivate priv_t;
-G_DEFINE_TYPE (IndicatorSessionUsersMock,
- indicator_session_users_mock,
- INDICATOR_TYPE_SESSION_USERS)
+G_DEFINE_TYPE_WITH_PRIVATE(IndicatorSessionUsersMock, indicator_session_users_mock, INDICATOR_TYPE_SESSION_USERS)
/***
**** IndicatorSessionUsers virtual functions
@@ -120,8 +118,6 @@ indicator_session_users_mock_class_init (IndicatorSessionUsersMockClass * klass)
users_class->get_uids = my_get_uids;
users_class->get_user = my_get_user;
users_class->activate_user = my_activate_user;
-
- g_type_class_add_private (klass, sizeof (IndicatorSessionUsersMockPriv));
}
static void
@@ -130,9 +126,7 @@ indicator_session_users_mock_init (IndicatorSessionUsersMock * self)
{
priv_t * p;
- p = G_TYPE_INSTANCE_GET_PRIVATE (self,
- INDICATOR_TYPE_SESSION_USERS_MOCK,
- IndicatorSessionUsersMockPriv);
+ p = indicator_session_users_mock_get_instance_private(self);
self->priv = p;
p->users = g_hash_table_new_full (g_direct_hash,
diff --git a/tests/backend-mock-users.h b/tests/backend-mock-users.h
index 513e799..399afe8 100644
--- a/tests/backend-mock-users.h
+++ b/tests/backend-mock-users.h
@@ -33,7 +33,7 @@ G_BEGIN_DECLS
#define INDICATOR_IS_SESSION_USERS_MOCK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), INDICATOR_TYPE_SESSION_USERS_MOCK))
typedef struct _IndicatorSessionUsersMock IndicatorSessionUsersMock;
-typedef struct _IndicatorSessionUsersMockPriv IndicatorSessionUsersMockPriv;
+typedef struct _IndicatorSessionUsersMockPrivate IndicatorSessionUsersMockPrivate;
typedef struct _IndicatorSessionUsersMockClass IndicatorSessionUsersMockClass;
/**
@@ -43,7 +43,7 @@ struct _IndicatorSessionUsersMock
{
/*< private >*/
IndicatorSessionUsers parent;
- IndicatorSessionUsersMockPriv * priv;
+ IndicatorSessionUsersMockPrivate * priv;
};
struct _IndicatorSessionUsersMockClass
diff --git a/tests/test-service.cc b/tests/test-service.cc
index aad454a..196419b 100644
--- a/tests/test-service.cc
+++ b/tests/test-service.cc
@@ -24,6 +24,13 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "backend-mock-guest.h"
#include "backend-mock-actions.h"
+gboolean onMainLoopQuit(gpointer pUserData)
+{
+ g_main_loop_quit((GMainLoop*)pUserData);
+
+ return FALSE;
+}
+
/***
****
***/
@@ -169,7 +176,7 @@ class ServiceTest: public GTestDBusFixture
G_BUS_NAME_WATCHER_FLAGS_NONE,
on_name_appeared, // quits the loop
NULL, this, NULL);
- const guint timer_id = g_timeout_add_seconds (TIME_LIMIT_SEC, (GSourceFunc)g_main_loop_quit, loop);
+ const guint timer_id = g_timeout_add_seconds(TIME_LIMIT_SEC, onMainLoopQuit, loop);
g_main_loop_run (loop);
g_source_remove (timer_id);
g_bus_unwatch_name (watch_id);