Mercurial > hg > octave-shane > gnulib-hg
annotate tests/test-fseterr.c @ 17622:71e733c62cee
savedir: add sorting arg to savedir, streamsavedir; remove fdsavedir
Patch based on an idea by Dick Streefland in
<https://savannah.gnu.org/patch/?7892>.
* NEWS: Document this.
* lib/savedir.c (NAME_SIZE_DEFAULT): Remove.
(direntry_t, comparison_function): New types.
(direntry_cmp_name): New function.
(direntry_cmp_inode) [D_INO_IN_DIRENT]: New function.
(streamsavedir, savedir): New arg OPTION.
(streamsavedir): Simplify memory allocation.
(fdsavedir): Remove.
* lib/savedir.h (enum savedir_option): New type.
(streamsavedir, savedir): New arg OPTION.
(fdsavedir): Remove.
author | Sergey Poznyakoff <gray@gnu.org.ua> |
---|---|
date | Thu, 13 Feb 2014 22:01:39 +0200 |
parents | 344018b6e5d7 |
children |
rev | line source |
---|---|
8388 | 1 /* Test setting the error indicator of a stream. |
17587 | 2 Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc. |
8388 | 3 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8388
diff
changeset
|
4 This program is free software: you can redistribute it and/or modify |
8388 | 5 it under the terms of the GNU General Public License as published by |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8388
diff
changeset
|
6 the Free Software Foundation; either version 3 of the License, or |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8388
diff
changeset
|
7 (at your option) any later version. |
8388 | 8 |
9 This program 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 | |
12 GNU General Public License for more details. | |
13 | |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8388
diff
changeset
|
14 You should have received a copy of the GNU General Public License |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8388
diff
changeset
|
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
8388 | 16 |
17 /* Written by Bruno Haible <bruno@clisp.org>, 2007. */ | |
18 | |
19 #include <config.h> | |
20 | |
21 #include "fseterr.h" | |
22 | |
23 #include <stdio.h> | |
24 #include <stdlib.h> | |
25 | |
26 int | |
27 main () | |
28 { | |
29 /* All streams are initially created with the error indicator cleared. */ | |
30 if (ferror (stdout)) | |
31 abort (); | |
32 | |
33 /* Verify that fseterr() works. */ | |
34 fseterr (stdout); | |
35 if (!ferror (stdout)) | |
36 abort (); | |
37 | |
38 /* Verify fseterr's effect can be undone by clearerr(). */ | |
39 clearerr (stdout); | |
40 if (ferror (stdout)) | |
41 abort (); | |
42 | |
43 return 0; | |
44 } |