2
* Copyright (C) 2011 Google Inc.
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
14
* You should have received a copy of the GNU Lesser General
15
* Public License along with this library; if not, write to the
16
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
17
* Boston, MA 02111-1307, USA.
19
* Author: Nikki VonHollen <vonhollen@google.com>
23
#include <polkit/polkit.h>
29
PolkitUnixGroup *group;
31
group = POLKIT_UNIX_GROUP (polkit_unix_group_new (0));
34
gint group_gid = polkit_unix_group_get_gid (group);
35
g_assert_cmpint (group_gid, ==, 0);
37
g_object_unref (group);
42
test_new_for_name (void)
45
PolkitUnixGroup *group;
47
group = POLKIT_UNIX_GROUP (polkit_unix_group_new_for_name ("root", &error));
49
g_assert_no_error (error);
51
gint group_gid = polkit_unix_group_get_gid (group);
52
g_assert_cmpint (group_gid, ==, 0);
54
g_object_unref (group);
61
PolkitUnixGroup *group;
62
group = POLKIT_UNIX_GROUP (polkit_unix_group_new (0));
64
polkit_unix_group_set_gid (group, 5);
66
gint group_gid = polkit_unix_group_get_gid (group);
67
g_assert_cmpint (group_gid, ==, 5);
69
g_object_unref (group);
74
main (int argc, char *argv[])
77
g_test_init (&argc, &argv, NULL);
78
g_test_add_func ("/PolkitUnixGroup/new", test_new);
79
g_test_add_func ("/PolkitUnixGroup/new_for_name", test_new_for_name);
80
g_test_add_func ("/PolkitUnixGroup/set_gid", test_set_gid);