PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Sat Nov 3 12:23:34 PDT 2007


 polkit/polkit-action.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit da35aa14239c9dcfa4948c07c9cc7d7271b87d88
Author: David Zeuthen <davidz at redhat.com>
Date:   Sat Nov 3 15:21:10 2007 -0400

    extend test coverage for PolKitAction
    
    It's now at 100%. Yay me.

diff --git a/polkit/polkit-action.c b/polkit/polkit-action.c
index 1ee09ba..1c0444d 100644
--- a/polkit/polkit-action.c
+++ b/polkit/polkit-action.c
@@ -257,6 +257,23 @@ _test_polkit_action (void)
                 g_assert (! polkit_action_validate_id (invalid_action_ids[n]));
         }
 
+        PolKitAction *a;
+        char *s;
+        a = polkit_action_new ();
+        g_assert (! polkit_action_get_action_id (a, &s));
+        g_assert (polkit_action_set_action_id (a, "org.example.action"));
+        g_assert (polkit_action_validate (a));
+        polkit_action_ref (a);
+        g_assert (polkit_action_validate (a));
+        polkit_action_unref (a);
+        g_assert (polkit_action_set_action_id (a, "org.example.action2"));
+        g_assert (polkit_action_validate (a));
+        g_assert (polkit_action_get_action_id (a, &s));
+        g_assert (strcmp (s, "org.example.action2") == 0);
+        polkit_action_debug (a);
+        polkit_action_unref (a);
+        a = NULL;
+
         return TRUE;
 }
 


More information about the hal-commit mailing list