1 /* Test out of order operations with {set,get,end}pwent */
4 Unix SMB/Netbios implementation.
7 Copyright (C) Tim Potter 2000
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 int main (int argc
, char **argv
)
32 /* Test getpwent() without setpwent() */
34 for (i
= 0; i
< 100; i
++) {
37 /* This is supposed to work */
41 printf("FAIL: getpwent() with no setpwent()\n");
47 /* Work out how many user till first domain user */
56 if (pw
== NULL
) break;
58 if (strchr(pw
->pw_name
, '/')) {
66 printf("FAIL: could not find any domain users\n");
70 /* Test stopping getpwent in the middle of a set of users */
74 /* Test setpwent() without any getpwent() calls */
78 for (i
= 0; i
< (num_users
- 1); i
++) {
84 /* Test lots of setpwent() calls */
88 for (i
= 0; i
< (num_users
- 1); i
++) {
92 for (i
= 0; i
< 100; i
++) {
96 /* Test lots of endpwent() calls */
100 for (i
= 0; i
< (num_users
- 1); i
++) {
104 for (i
= 0; i
< 100; i
++) {
108 /* Everything's cool */