Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libc/string Use ATF_CHECK() when appropriate.
details: https://anonhg.NetBSD.org/src/rev/5283c990d97d
branches: trunk
changeset: 767274:5283c990d97d
user: jruoho <jruoho%NetBSD.org@localhost>
date: Thu Jul 14 07:33:20 2011 +0000
description:
Use ATF_CHECK() when appropriate.
diffstat:
tests/lib/libc/string/t_memset.c | 24 ++++++++++++------------
tests/lib/libc/string/t_strcmp.c | 28 ++++++++++++++--------------
tests/lib/libc/string/t_strlen.c | 16 ++++++++--------
3 files changed, 34 insertions(+), 34 deletions(-)
diffs (121 lines):
diff -r 184f491fe3e7 -r 5283c990d97d tests/lib/libc/string/t_memset.c
--- a/tests/lib/libc/string/t_memset.c Thu Jul 14 06:35:30 2011 +0000
+++ b/tests/lib/libc/string/t_memset.c Thu Jul 14 07:33:20 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_memset.c,v 1.1 2011/06/03 06:39:52 jruoho Exp $ */
+/* $NetBSD: t_memset.c,v 1.2 2011/07/14 07:33:20 jruoho Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_memset.c,v 1.1 2011/06/03 06:39:52 jruoho Exp $");
+__RCSID("$NetBSD: t_memset.c,v 1.2 2011/07/14 07:33:20 jruoho Exp $");
#include <sys/stat.h>
@@ -142,16 +142,16 @@
(void)memset(&st, 0, sizeof(struct stat));
- ATF_REQUIRE(st.st_dev == 0);
- ATF_REQUIRE(st.st_ino == 0);
- ATF_REQUIRE(st.st_mode == 0);
- ATF_REQUIRE(st.st_nlink == 0);
- ATF_REQUIRE(st.st_uid == 0);
- ATF_REQUIRE(st.st_gid == 0);
- ATF_REQUIRE(st.st_rdev == 0);
- ATF_REQUIRE(st.st_size == 0);
- ATF_REQUIRE(st.st_atime == 0);
- ATF_REQUIRE(st.st_mtime == 0);
+ ATF_CHECK(st.st_dev == 0);
+ ATF_CHECK(st.st_ino == 0);
+ ATF_CHECK(st.st_mode == 0);
+ ATF_CHECK(st.st_nlink == 0);
+ ATF_CHECK(st.st_uid == 0);
+ ATF_CHECK(st.st_gid == 0);
+ ATF_CHECK(st.st_rdev == 0);
+ ATF_CHECK(st.st_size == 0);
+ ATF_CHECK(st.st_atime == 0);
+ ATF_CHECK(st.st_mtime == 0);
}
static void
diff -r 184f491fe3e7 -r 5283c990d97d tests/lib/libc/string/t_strcmp.c
--- a/tests/lib/libc/string/t_strcmp.c Thu Jul 14 06:35:30 2011 +0000
+++ b/tests/lib/libc/string/t_strcmp.c Thu Jul 14 07:33:20 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_strcmp.c,v 1.2 2011/07/07 09:31:27 jruoho Exp $ */
+/* $NetBSD: t_strcmp.c,v 1.3 2011/07/14 07:33:20 jruoho Exp $ */
/*
* Written by J.T. Conklin <jtc%acorntoolworks.com@localhost>
@@ -108,22 +108,22 @@
char buf1[10] = "xxx";
char buf2[10] = "xxy";
- ATF_REQUIRE(strcmp(buf1, buf1) == 0);
- ATF_REQUIRE(strcmp(buf2, buf2) == 0);
+ ATF_CHECK(strcmp(buf1, buf1) == 0);
+ ATF_CHECK(strcmp(buf2, buf2) == 0);
- ATF_REQUIRE(strcmp("xöx", "xox") > 0);
- ATF_REQUIRE(strcmp("xxx", "xxxyyy") < 0);
- ATF_REQUIRE(strcmp("xxxyyy", "xxx") > 0);
+ ATF_CHECK(strcmp("xöx", "xox") > 0);
+ ATF_CHECK(strcmp("xxx", "xxxyyy") < 0);
+ ATF_CHECK(strcmp("xxxyyy", "xxx") > 0);
- ATF_REQUIRE(strcmp(buf1 + 0, buf2 + 0) < 0);
- ATF_REQUIRE(strcmp(buf1 + 1, buf2 + 1) < 0);
- ATF_REQUIRE(strcmp(buf1 + 2, buf2 + 2) < 0);
- ATF_REQUIRE(strcmp(buf1 + 3, buf2 + 3) == 0);
+ ATF_CHECK(strcmp(buf1 + 0, buf2 + 0) < 0);
+ ATF_CHECK(strcmp(buf1 + 1, buf2 + 1) < 0);
+ ATF_CHECK(strcmp(buf1 + 2, buf2 + 2) < 0);
+ ATF_CHECK(strcmp(buf1 + 3, buf2 + 3) == 0);
- ATF_REQUIRE(strcmp(buf2 + 0, buf1 + 0) > 0);
- ATF_REQUIRE(strcmp(buf2 + 1, buf1 + 1) > 0);
- ATF_REQUIRE(strcmp(buf2 + 2, buf1 + 2) > 0);
- ATF_REQUIRE(strcmp(buf2 + 3, buf1 + 3) == 0);
+ ATF_CHECK(strcmp(buf2 + 0, buf1 + 0) > 0);
+ ATF_CHECK(strcmp(buf2 + 1, buf1 + 1) > 0);
+ ATF_CHECK(strcmp(buf2 + 2, buf1 + 2) > 0);
+ ATF_CHECK(strcmp(buf2 + 3, buf1 + 3) == 0);
}
ATF_TP_ADD_TCS(tp)
diff -r 184f491fe3e7 -r 5283c990d97d tests/lib/libc/string/t_strlen.c
--- a/tests/lib/libc/string/t_strlen.c Thu Jul 14 06:35:30 2011 +0000
+++ b/tests/lib/libc/string/t_strlen.c Thu Jul 14 07:33:20 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_strlen.c,v 1.4 2011/07/12 12:08:07 njoly Exp $ */
+/* $NetBSD: t_strlen.c,v 1.5 2011/07/14 07:33:20 jruoho Exp $ */
/*
* Written by J.T. Conklin <jtc%acorntoolworks.com@localhost>
@@ -178,14 +178,14 @@
buf[0] = '\0';
- ATF_REQUIRE(strnlen(buf, 000) == 0);
- ATF_REQUIRE(strnlen(buf, 111) == 0);
+ ATF_CHECK(strnlen(buf, 000) == 0);
+ ATF_CHECK(strnlen(buf, 111) == 0);
- ATF_REQUIRE(strnlen("xxx", 0) == 0);
- ATF_REQUIRE(strnlen("xxx", 1) == 1);
- ATF_REQUIRE(strnlen("xxx", 2) == 2);
- ATF_REQUIRE(strnlen("xxx", 3) == 3);
- ATF_REQUIRE(strnlen("xxx", 9) == 3);
+ ATF_CHECK(strnlen("xxx", 0) == 0);
+ ATF_CHECK(strnlen("xxx", 1) == 1);
+ ATF_CHECK(strnlen("xxx", 2) == 2);
+ ATF_CHECK(strnlen("xxx", 3) == 3);
+ ATF_CHECK(strnlen("xxx", 9) == 3);
}
ATF_TP_ADD_TCS(tp)
Home |
Main Index |
Thread Index |
Old Index