Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libc/gen Adjust the test with stdin(3).
details: https://anonhg.NetBSD.org/src/rev/4ce8437cc50f
branches: trunk
changeset: 763964:4ce8437cc50f
user: jruoho <jruoho%NetBSD.org@localhost>
date: Fri Apr 08 15:25:00 2011 +0000
description:
Adjust the test with stdin(3).
diffstat:
tests/lib/libc/gen/t_ttyname.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (32 lines):
diff -r f40bd8d6c4bb -r 4ce8437cc50f tests/lib/libc/gen/t_ttyname.c
--- a/tests/lib/libc/gen/t_ttyname.c Fri Apr 08 14:58:46 2011 +0000
+++ b/tests/lib/libc/gen/t_ttyname.c Fri Apr 08 15:25:00 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_ttyname.c,v 1.1 2011/04/05 06:15:31 jruoho Exp $ */
+/* $NetBSD: t_ttyname.c,v 1.2 2011/04/08 15:25:00 jruoho Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ttyname.c,v 1.1 2011/04/05 06:15:31 jruoho Exp $");
+__RCSID("$NetBSD: t_ttyname.c,v 1.2 2011/04/08 15:25:00 jruoho Exp $");
#include <atf-c.h>
#include <errno.h>
@@ -93,10 +93,10 @@
ATF_TC_BODY(ttyname_stdin, tc)
{
- ATF_REQUIRE(isatty(STDIN_FILENO) == 1);
- ATF_REQUIRE(ttyname(STDIN_FILENO) != NULL);
+ if (isatty(STDIN_FILENO) != 0)
+ ATF_REQUIRE(ttyname(STDIN_FILENO) != NULL);
- ATF_REQUIRE(close(STDIN_FILENO) == 0);
+ (void)close(STDIN_FILENO);
ATF_REQUIRE(isatty(STDIN_FILENO) != 1);
ATF_REQUIRE(ttyname(STDIN_FILENO) == NULL);
Home |
Main Index |
Thread Index |
Old Index