Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/regress/lib/libc Remove the rest of the libc/string tests - ...
details: https://anonhg.NetBSD.org/src/rev/9271ea05936f
branches: trunk
changeset: 760095:9271ea05936f
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Sun Dec 26 13:38:08 2010 +0000
description:
Remove the rest of the libc/string tests - they've moved to atf
diffstat:
regress/lib/libc/Makefile | 4 +-
regress/lib/libc/string/Makefile | 5 -
regress/lib/libc/string/memcpy/Makefile | 10 ---
regress/lib/libc/string/memcpy/memcpy_test.c | 66 --------------------
regress/lib/libc/string/memmem/Makefile | 11 ---
regress/lib/libc/string/memmem/memmem_test.c | 84 -------------------------
regress/lib/libc/string/stresep/Makefile | 11 ---
regress/lib/libc/string/stresep/stresep_test.c | 54 ----------------
regress/lib/libc/string/swab/Makefile | 10 ---
regress/lib/libc/string/swab/swabcheck.c | 85 --------------------------
regress/lib/libc/string/wcsncpy/Makefile | 11 ---
regress/lib/libc/string/wcsncpy/wcsncpy_test.c | 66 --------------------
12 files changed, 2 insertions(+), 415 deletions(-)
diffs (truncated from 472 to 300 lines):
diff -r be4e5be1fdf3 -r 9271ea05936f regress/lib/libc/Makefile
--- a/regress/lib/libc/Makefile Sun Dec 26 13:35:54 2010 +0000
+++ b/regress/lib/libc/Makefile Sun Dec 26 13:38:08 2010 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.62 2010/12/25 01:20:11 pgoyette Exp $
+# $NetBSD: Makefile,v 1.63 2010/12/26 13:38:08 pgoyette Exp $
SUBDIR+= _setjmp atexit citrus clone context convfp db \
divrem gen gdtoa getaddrinfo hsearch inet int_fmtio locale md5sha \
nsdispatch pty randomid regex rpc servent setjmp sigsetjmp \
- stdlib string strptime sys time
+ stdlib strptime sys time
.include <bsd.own.mk>
.include <bsd.sys.mk>
diff -r be4e5be1fdf3 -r 9271ea05936f regress/lib/libc/string/Makefile
--- a/regress/lib/libc/string/Makefile Sun Dec 26 13:35:54 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-# $NetBSD: Makefile,v 1.10 2010/12/25 21:13:37 pgoyette Exp $
-
-SUBDIR+= memmem swab wcsncpy memcpy stresep
-
-.include <bsd.subdir.mk>
diff -r be4e5be1fdf3 -r 9271ea05936f regress/lib/libc/string/memcpy/Makefile
--- a/regress/lib/libc/string/memcpy/Makefile Sun Dec 26 13:35:54 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2005/12/06 08:14:48 ross Exp $
-
-PROG= memcpy_test
-NOMAN=
-WARNS?= 4
-
-regress: ${PROG}
- ./${PROG}
-
-.include <bsd.prog.mk>
diff -r be4e5be1fdf3 -r 9271ea05936f regress/lib/libc/string/memcpy/memcpy_test.c
--- a/regress/lib/libc/string/memcpy/memcpy_test.c Sun Dec 26 13:35:54 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-#include <sys/types.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <md5.h>
-
-#define ALIGNMENTS 16
-#define LENGTHS 4
-#define BLOCKTYPES 4
-
-MD5_CTX mc[1];
-
-typedef unsigned char testBlock_t[ALIGNMENTS * LENGTHS];
-
-testBlock_t bss1, bss2;
-
-unsigned char *start[BLOCKTYPES] = {
- bss1, bss2
-};
-
-char result[100];
-const char goodResult[] = "7b405d24bc03195474c70ddae9e1f8fb";
-
-void runTest(unsigned char *, unsigned char *);
-
-int
-main(int ac, char **av)
-{
- int i, j;
- testBlock_t auto1, auto2;
-
- start[2] = auto1;
- start[3] = auto2;
-
- srandom(0L);
- MD5Init(mc);
- for (i = 0; i < BLOCKTYPES; ++i)
- for (j = 0; j < BLOCKTYPES; ++j)
- if (i != j)
- runTest(start[i], start[j]);
- MD5End(mc, result);
- return strcmp(result, goodResult);
-}
-
-void runTest(unsigned char *b1, unsigned char *b2)
-{
- int i, j, k, m;
- size_t n;
-
- for (i = 0; i < ALIGNMENTS; ++i) {
- for (j = 0; j < ALIGNMENTS; ++j) {
- k = sizeof(testBlock_t) - (i > j ? i : j);
- for (m = 0; m < k; ++m) {
- for (n = 0; n < sizeof(testBlock_t); ++n) {
- b1[n] = (unsigned char)random();
- b2[n] = (unsigned char)random();
- }
- memcpy(b1 + i, b2 + j, m);
- MD5Update(mc, b1, sizeof(testBlock_t));
- MD5Update(mc, b2, sizeof(testBlock_t));
- }
- }
- }
-}
diff -r be4e5be1fdf3 -r 9271ea05936f regress/lib/libc/string/memmem/Makefile
--- a/regress/lib/libc/string/memmem/Makefile Sun Dec 26 13:35:54 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2005/03/13 15:40:32 perry Exp $
-
-NOMAN= # defined
-
-PROG= memmem_test
-WARNS?= 3
-
-regress: ${PROG}
- ./${PROG}
-
-.include <bsd.prog.mk>
diff -r be4e5be1fdf3 -r 9271ea05936f regress/lib/libc/string/memmem/memmem_test.c
--- a/regress/lib/libc/string/memmem/memmem_test.c Sun Dec 26 13:35:54 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/* $NetBSD: memmem_test.c,v 1.2 2008/04/28 20:23:05 martin Exp $ */
-
-/*-
- * Copyright (c) 2005 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Perry E. Metzger of Metzger, Dowdeswell & Co. LLC.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-char p0[] = "";
-int lp0 = 0;
-char p1[] = "0123";
-int lp1 = 4;
-char p2[] = "456";
-int lp2 = 3;
-char p3[] = "789";
-int lp3 = 3;
-char p4[] = "abc";
-int lp4 = 3;
-char p5[] = "0";
-int lp5 = 1;
-char p6[] = "9";
-int lp6 = 1;
-char p7[] = "654";
-int lp7 = 3;
-
-char b0[] = "";
-int lb0 = 0;
-char b1[] = "0";
-int lb1 = 1;
-char b2[] = "0123456789";
-int lb2 = 10;
-
-#define expect(b) if (!(b)) { \
- fprintf(stderr, "failed on line %d\n", __LINE__); \
- exit(1); \
- }
-
-int
-main(int argc, char **argv)
-{
- expect(memmem(b2, lb2, p0, lp0) == b2);
- expect(memmem(b0, lb0, p0, lp0) == b0);
- expect(memmem(b0, lb0, p1, lp1) == NULL);
- expect(memmem(b1, lb1, p1, lp1) == NULL);
-
- expect(memmem(b2, lb2, p1, lp1) == b2);
- expect(memmem(b2, lb2, p2, lp2) == (b2 + 4));
- expect(memmem(b2, lb2, p3, lp3) == (b2 + 7));
-
- expect(memmem(b2, lb2, p5, lp5) == b2);
- expect(memmem(b2, lb2, p6, lp6) == (b2 + 9));
-
- expect(memmem(b2, lb2, p4, lp4) == NULL);
- expect(memmem(b2, lb2, p7, lp7) == NULL);
-
- exit(0);
-}
diff -r be4e5be1fdf3 -r 9271ea05936f regress/lib/libc/string/stresep/Makefile
--- a/regress/lib/libc/string/stresep/Makefile Sun Dec 26 13:35:54 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2006/08/12 23:51:12 christos Exp $
-
-NOMAN= # defined
-
-PROG= stresep_test
-WARNS?= 3
-
-regress: ${PROG}
- ./${PROG}
-
-.include <bsd.prog.mk>
diff -r be4e5be1fdf3 -r 9271ea05936f regress/lib/libc/string/stresep/stresep_test.c
--- a/regress/lib/libc/string/stresep/stresep_test.c Sun Dec 26 13:35:54 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/* $NetBSD: stresep_test.c,v 1.3 2008/04/28 20:23:05 martin Exp $ */
-
-/*-
- * Copyright (c) 2005 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Christos Zoulas.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define expect(a) if ((p = stresep(&q, " ", '\\')) == NULL || strcmp(p, a)) { \
- fprintf(stderr, "failed on line %d: %s != %s\n", \
- __LINE__, p, a); \
- return 1; \
- }
-
-int
-main(int argc, char **argv)
-{
- char brk[] = "foo\\ \\ bar baz bar\\ foo\\ bar\\ \\ foo \\ \\ \\ baz bar\\ \\ ";
- char *p, *q = brk;
- expect("foo bar");
- expect("baz");
- expect("bar foo ");
- expect("bar foo");
- expect(" baz");
- expect("bar ");
- return 0;
-}
diff -r be4e5be1fdf3 -r 9271ea05936f regress/lib/libc/string/swab/Makefile
--- a/regress/lib/libc/string/swab/Makefile Sun Dec 26 13:35:54 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2005/03/13 15:33:45 perry Exp $
-
-NOMAN= # defined
-
-PROG= swabcheck
-
-regress: ${PROG}
- ./${PROG}
-
-.include <bsd.prog.mk>
diff -r be4e5be1fdf3 -r 9271ea05936f regress/lib/libc/string/swab/swabcheck.c
--- a/regress/lib/libc/string/swab/swabcheck.c Sun Dec 26 13:35:54 2010 +0000
Home |
Main Index |
Thread Index |
Old Index