annotate tests/test-set-mode-acl.c @ 12496:a48d3d749ca5

Refactor common macros used in tests.
author Bruno Haible <bruno@clisp.org>
date Thu, 24 Dec 2009 21:01:42 +0100
parents e8d2c6fc33ad
children c2cbabec01dd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Test of setting an ACL equivalent to a mode.
12496
a48d3d749ca5 Refactor common macros used in tests.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
2 Copyright (C) 2008-2009 Free Software Foundation, Inc.
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 (at your option) any later version.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2008. */
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #include <config.h>
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include "acl.h"
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #include <stdlib.h>
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 #include "progname.h"
12496
a48d3d749ca5 Refactor common macros used in tests.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
26 #include "macros.h"
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 int
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 main (int argc, char *argv[])
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 {
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 const char *file;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 int mode;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 set_program_name (argv[0]);
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 ASSERT (argc == 3);
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 file = argv[1];
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 mode = strtol (argv[2], NULL, 8);
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 set_acl (file, -1, mode);
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 return 0;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 }