Mercurial > gnulib
annotate tests/test-getpass.c @ 40196:e63f5d3edab5
relocatable-prog: Update documentation.
* doc/relocatable-maint.texi (Supporting Relocation): Update to match
the recent changes.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 24 Feb 2019 01:49:15 +0100 |
parents | b06060465f09 |
children |
rev | line source |
---|---|
6090
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
1 /* Test getpass implementation. |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
2 Copyright (C) 2005, 2009-2019 Free Software Foundation, Inc. |
6090
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
3 Written by Simon Josefsson. |
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
4 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8891
diff
changeset
|
5 This program is free software: you can redistribute it and/or modify |
6090
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
6 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:
8891
diff
changeset
|
7 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:
8891
diff
changeset
|
8 (at your option) any later version. |
6090
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
9 |
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
10 This program is distributed in the hope that it will be useful, |
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
13 GNU General Public License for more details. |
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
14 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8891
diff
changeset
|
15 You should have received a copy of the GNU General Public License |
19190 | 16 along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
6090
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
17 |
8891
633babea5f62
Unconditionally include <config.h> in unit tests.
Eric Blake <ebb9@byu.net>
parents:
6094
diff
changeset
|
18 #include <config.h> |
6091
f2bbccdb1856
Include config.h too.
Simon Josefsson <simon@josefsson.org>
parents:
6090
diff
changeset
|
19 |
6090
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
20 #include <stdio.h> |
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
21 #include "getpass.h" |
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
22 |
6094 | 23 int |
24 main (int argc, char *argv[]) | |
6090
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
25 { |
6092 | 26 char *pass = getpass ("Enter password: "); |
6090
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
27 |
16234
f9b906545e2f
Use ', not `, for quoting output.
Paul Eggert <eggert@cs.ucla.edu>
parents:
16201
diff
changeset
|
28 printf ("The password is '%s'\n", pass); |
6090
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
29 |
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
30 return 0; |
8e8f24754381
* tests/test-getpass.c: New file.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
31 } |