fix typo in reading identity type from variant and updated tests
authorAmarnath Valluri <amarnath.valluri@linux.intel.com>
Fri, 6 Feb 2015 12:35:06 +0000 (14:35 +0200)
committerAmarnath Valluri <amarnath.valluri@linux.intel.com>
Fri, 6 Feb 2015 12:37:23 +0000 (14:37 +0200)
libgsignon-glib/signon-identity-info.c
tests/check_signon.c

index 9f035aa39321918d53bdb9fc81ada36d9332f7bc..3ab3350e0fdf9773443c3233bb77a1b8b6f8a551 100644 (file)
@@ -207,7 +207,7 @@ signon_identity_info_new_from_variant (GVariant *variant)
 
     g_variant_lookup (variant,
                       SIGNOND_IDENTITY_INFO_TYPE,
-                      "u",
+                      "i",
                       &info->type);
 
     return info;
index 56669158048823c1e24dec9e18e6b2a0e9c653d7..2381ede73b64d2c6fed0f6fc66f44ee95e25d66f 100644 (file)
@@ -1106,6 +1106,9 @@ static void identity_info_cb(SignonIdentity *self, SignonIdentityInfo *info, con
          fail_unless (g_strcmp0 (signon_identity_info_get_caption(info),
                                  signon_identity_info_get_caption(pattern)) == 0, "The info has wrong caption");
 
+         fail_unless (signon_identity_info_get_identity_type (info) == signon_identity_info_get_identity_type (pattern),
+            "Wrong identity type");
+
          GHashTable *methods = (GHashTable *)signon_identity_info_get_methods (info);
          gchar **mechs1 = g_hash_table_lookup (methods, "method1");
          gchar **mechs2 = g_hash_table_lookup (methods, "method2");
@@ -1197,7 +1200,7 @@ START_TEST(test_info_identity)
                                                  NULL,
                                                  NULL,
                                                  NULL,
-                                                 0,
+                                                 SIGNON_IDENTITY_TYPE_WEB,
                                                  store_credentials_identity_cb,
                                                  NULL);
     _run_mainloop ();
@@ -1218,6 +1221,7 @@ START_TEST(test_info_identity)
     signon_identity_info_set_method (info, "method1", (const gchar **)mechanisms);
     signon_identity_info_set_method (info, "method2", (const gchar **)mechanisms);
     signon_identity_info_set_method (info, "method3", (const gchar **)mechanisms);
+    signon_identity_info_set_identity_type (info, SIGNON_IDENTITY_TYPE_WEB);
 
     signon_identity_query_info (idty, identity_info_cb, &info);
     _run_mainloop ();