Mercurial > hg > octave-lojdl > gnulib-hg
annotate tests/test-freopen.c @ 12421:e8d2c6fc33ad
Use spaces for indentation, not tabs.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Thu, 10 Dec 2009 20:28:30 +0100 |
parents | 0be6f1ab456d |
children | 33ab12a7cea2 |
rev | line source |
---|---|
9303 | 1 /* Test of opening a file stream. |
9889
0be6f1ab456d
Flush the standard error stream before aborting.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
2 Copyright (C) 2007-2008 Free Software Foundation, Inc. |
9303 | 3 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9303
diff
changeset
|
4 This program is free software: you can redistribute it and/or modify |
9303 | 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:
9303
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:
9303
diff
changeset
|
7 (at your option) any later version. |
9303 | 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 | |
14 You should have received a copy of the GNU General Public License | |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9303
diff
changeset
|
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
9303 | 16 |
17 /* Written by Bruno Haible <bruno@clisp.org>, 2007. */ | |
18 | |
19 #include <config.h> | |
20 | |
21 #include <stdio.h> | |
22 #include <stdlib.h> | |
23 | |
24 #define ASSERT(expr) \ | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9889
diff
changeset
|
25 do \ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9889
diff
changeset
|
26 { \ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9889
diff
changeset
|
27 if (!(expr)) \ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9889
diff
changeset
|
28 { \ |
9303 | 29 fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9889
diff
changeset
|
30 fflush (stderr); \ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9889
diff
changeset
|
31 abort (); \ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9889
diff
changeset
|
32 } \ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9889
diff
changeset
|
33 } \ |
9303 | 34 while (0) |
35 | |
36 int | |
37 main () | |
38 { | |
39 ASSERT (freopen ("/dev/null", "r", stdin) != NULL); | |
40 | |
41 return 0; | |
42 } |