generic: fix internal APIs and tests for rebase
authorJussi Laako <jussi.laako@linux.intel.com>
Mon, 11 Feb 2013 14:28:58 +0000 (16:28 +0200)
committerJussi Laako <jussi.laako@linux.intel.com>
Fri, 31 May 2013 09:27:43 +0000 (12:27 +0300)
libsignon-glib/signon-auth-session.c
libsignon-glib/signon-auth-session.h
libsignon-glib/signon-identity-info.c
libsignon-glib/signon-identity-info.h
libsignon-glib/signon-identity.c
tests/check_signon.c

index 6349012c2346f2cfdfc80a6593441261785f9b1c..20fed1bfce5babae4f0f44607614e8b5dcdb2975 100644 (file)
@@ -123,7 +123,7 @@ typedef struct _AuthSessionProcessCbData
 static void auth_session_state_changed_cb (GDBusProxy *proxy, gint state, gchar *message, gpointer user_data);
 static void auth_session_remote_object_destroyed_cb (GDBusProxy *proxy, gpointer user_data);
 
-static gboolean auth_session_priv_init (SignonAuthSession *self, guint id, const gchar *method_name, GError **err);
+static gboolean auth_session_priv_init (SignonAuthSession *self, const gchar *method_name, GError **err);
 
 static void auth_session_query_available_mechanisms_ready_cb (gpointer object, const GError *error, gpointer user_data);
 static void auth_session_cancel_ready_cb (gpointer object, const GError *error, gpointer user_data);
@@ -421,7 +421,6 @@ signon_auth_session_class_init (SignonAuthSessionClass *klass)
  */
 SignonAuthSession *
 signon_auth_session_new (gpointer identity_proxy,
-                         gint id,
                          const gchar *method_name,
                          GError **err)
 {
@@ -433,7 +432,7 @@ signon_auth_session_new (gpointer identity_proxy,
                                      NULL));
     g_return_val_if_fail (self != NULL, NULL);
 
-    if (!auth_session_priv_init(self, id, method_name, err))
+    if (!auth_session_priv_init(self, method_name, err))
     {
         if (*err)
             g_warning ("%s returned error: %s", G_STRFUNC, (*err)->message);
@@ -792,14 +791,13 @@ static void auth_session_remote_object_destroyed_cb (GDBusProxy *proxy,
 }
 
 static gboolean
-auth_session_priv_init (SignonAuthSession *self, guint id,
+auth_session_priv_init (SignonAuthSession *self,
                         const gchar *method_name, GError **err)
 {
     g_return_val_if_fail (SIGNON_IS_AUTH_SESSION (self), FALSE);
     SignonAuthSessionPrivate *priv = SIGNON_AUTH_SESSION_PRIV (self);
     g_return_val_if_fail (priv, FALSE);
 
-    priv->id = id;
     priv->method_name = g_strdup (method_name);
 
     priv->registering = TRUE;
index d9379045ce44b33bf9a87966783e73ff07d5e3d3..c828b8a49709db4193c9bc640539ff322509153e 100644 (file)
@@ -145,7 +145,6 @@ struct _SignonAuthSessionClass {
 GType signon_auth_session_get_type (void) G_GNUC_CONST;
 
 SignonAuthSession *signon_auth_session_new(gpointer identity_proxy,
-                                           gint id,
                                            const gchar *method_name,
                                            GError **err);
 
index 29064d5b558ebccb41abe47ae7f537b0d8237852..5839736582992bb075e3e2377a2318e488c889d5 100644 (file)
@@ -5,8 +5,10 @@
  *
  * Copyright (C) 2009-2010 Nokia Corporation.
  * Copyright (C) 2011-2012 Canonical Ltd.
+ * Copyright (C) 2012-2013 Intel Corporation.
  *
  * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
+ * Contact: Jussi Laako <jussi.laako@linux.intel.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
index fc35dfecce63876088387b28722fc32adf3dd905..2dcd7443a6b0f61c841e8d7a15ba9c74e9028784 100644 (file)
@@ -5,8 +5,10 @@
  *
  * Copyright (C) 2009-2010 Nokia Corporation.
  * Copyright (C) 2011 Canonical Ltd.
+ * Copyright (C) 2012-2013 Intel Corporation.
  *
  * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
+ * Contact: Jussi Laako <jussi.laako@linux.intel.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
index 77a8b7a0ac18c9db779582ad89b0f0c978da8b7f..295e0155ff7cc194c68e822010ebb1625e871414 100644 (file)
@@ -693,7 +693,6 @@ signon_identity_create_session(SignonIdentity *self,
     }
 
     SignonAuthSession *session = signon_auth_session_new (priv->proxy,
-                                                          priv->id,
                                                           method,
                                                           error);
     if (session)
index 3873f6ce7f601386756c54faa121aef1e0daf0a4..8f15b4fa2143a45ad09c0dfdbe3533ae2942d859 100644 (file)
@@ -261,7 +261,7 @@ START_TEST(test_auth_session_query_mechanisms)
     GError *err = NULL;
 
     g_debug("%s", G_STRFUNC);
-    SignonIdentity *idty = signon_identity_new(NULL, NULL);
+    SignonIdentity *idty = signon_identity_new(NULL);
     fail_unless (idty != NULL, "Cannot create Iddentity object");
 
     SignonAuthSession *auth_session = signon_identity_create_session(idty,
@@ -336,7 +336,7 @@ START_TEST(test_auth_session_query_mechanisms_nonexisting)
     GError *err = NULL;
 
     g_debug("%s", G_STRFUNC);
-    SignonIdentity *idty = signon_identity_new(NULL, NULL);
+    SignonIdentity *idty = signon_identity_new(NULL);
     fail_unless (idty != NULL, "Cannot create Iddentity object");
 
     SignonAuthSession *auth_session = signon_identity_create_session(idty,
@@ -419,7 +419,7 @@ START_TEST(test_auth_session_creation)
     GError *err = NULL;
 
     g_debug("%s", G_STRFUNC);
-    SignonIdentity *idty = signon_identity_new(NULL, NULL);
+    SignonIdentity *idty = signon_identity_new(NULL);
     fail_unless (idty != NULL, "Cannot create Iddentity object");
 
     SignonAuthSession *auth_session = signon_identity_create_session(idty,
@@ -446,7 +446,7 @@ START_TEST(test_auth_session_process)
     GError *err = NULL;
 
     g_debug("%s", G_STRFUNC);
-    SignonIdentity *idty = signon_identity_new(NULL, NULL);
+    SignonIdentity *idty = signon_identity_new(NULL);
     fail_unless (idty != NULL, "Cannot create Iddentity object");
 
     SignonAuthSession *auth_session = signon_identity_create_session(idty,
@@ -548,6 +548,7 @@ test_auth_session_process_failure_cb (GObject *source_object,
 
 START_TEST(test_auth_session_process_failure)
 {
+    SignonIdentity *identity;
     SignonAuthSession *auth_session;
     GVariantBuilder builder;
     GVariant *session_data;
@@ -557,7 +558,11 @@ START_TEST(test_auth_session_process_failure)
 
     g_type_init ();
 
-    auth_session = signon_auth_session_new (0, "nonexisting-method", &error);
+    identity = signon_identity_new_from_db (0, NULL);
+    fail_unless (identity != NULL, "Cannot create Identity object");
+    auth_session = signon_auth_session_new (identity,
+                                            "nonexisting-method",
+                                            &error);
     fail_unless (auth_session != NULL, "Cannot create AuthSession object");
     fail_unless (error == NULL);
 
@@ -581,6 +586,7 @@ START_TEST(test_auth_session_process_failure)
     fail_unless (error->code == SIGNON_ERROR_METHOD_NOT_KNOWN);
 
     g_object_unref (auth_session);
+    g_object_unref (identity);
 
     end_test ();
 }
@@ -736,7 +742,7 @@ new_identity()
     if (main_loop == NULL)
         main_loop = g_main_loop_new (NULL, FALSE);
 
-    identity = signon_identity_new (NULL, NULL);
+    identity = signon_identity_new (NULL);
     fail_unless (SIGNON_IS_IDENTITY (identity));
     methods = g_hash_table_new (g_str_hash, g_str_equal);
     signon_identity_store_credentials_with_args (identity,
@@ -747,6 +753,7 @@ new_identity()
                                                  "caption",
                                                  NULL,
                                                  NULL,
+                                                 NULL,
                                                  0,
                                                  new_identity_store_credentials_cb,
                                                  &id);
@@ -847,7 +854,7 @@ START_TEST(test_store_credentials_identity)
 {
     g_type_init ();
     g_debug("%s", G_STRFUNC);
-    SignonIdentity *idty = signon_identity_new(NULL, NULL);
+    SignonIdentity *idty = signon_identity_new(NULL);
     fail_unless (idty != NULL);
     fail_unless (SIGNON_IS_IDENTITY (idty),
                  "Failed to initialize the Identity.");
@@ -864,6 +871,7 @@ START_TEST(test_store_credentials_identity)
                                                  "caption",
                                                  NULL,
                                                  NULL,
+                                                 NULL,
                                                  0,
                                                  store_credentials_identity_cb,
                                                  &last_id);
@@ -904,7 +912,7 @@ START_TEST(test_verify_secret_identity)
 {
     g_type_init ();
     g_debug("%s", G_STRFUNC);
-    SignonIdentity *idty = signon_identity_new(NULL, NULL);
+    SignonIdentity *idty = signon_identity_new(NULL);
     fail_unless (idty != NULL);
     fail_unless (SIGNON_IS_IDENTITY (idty),
                  "Failed to initialize the Identity.");
@@ -923,6 +931,7 @@ START_TEST(test_verify_secret_identity)
                                                  caption,
                                                  NULL,
                                                  NULL,
+                                                 NULL,
                                                  0,
                                                  store_credentials_identity_cb,
                                                  NULL);
@@ -1418,6 +1427,7 @@ test_regression_unref_process_cb (SignonAuthSession *self,
 
 START_TEST(test_regression_unref)
 {
+    SignonIdentity *identity;
     SignonAuthSession *auth_session;
     GHashTable *session_data;
     GError *error = NULL;
@@ -1428,7 +1438,9 @@ START_TEST(test_regression_unref)
     g_type_init ();
     main_loop = g_main_loop_new (NULL, FALSE);
 
-    auth_session = signon_auth_session_new (0, "ssotest", &error);
+    identity = signon_identity_new_from_db (0, NULL);
+    fail_unless (identity != NULL);
+    auth_session = signon_auth_session_new (identity, "ssotest", &error);
     fail_unless (auth_session != NULL);
 
     session_data = g_hash_table_new (g_str_hash, g_str_equal);
@@ -1443,6 +1455,9 @@ START_TEST(test_regression_unref)
                                  g_strdup ("Hi there!"));
     g_main_loop_run (main_loop);
 
+    g_object_unref (auth_session);
+    g_object_unref (identity);
+
     end_test ();
 }
 END_TEST