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 these tests from regress - they've b...
details: https://anonhg.NetBSD.org/src/rev/3dc85429916e
branches: trunk
changeset: 759993:3dc85429916e
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Wed Dec 22 23:48:19 2010 +0000
description:
Remove these tests from regress - they've been converted to atf
diffstat:
regress/lib/libc/Makefile | 4 +-
regress/lib/libc/basename/Makefile | 10 ---
regress/lib/libc/basename/test.c | 95 ----------------------------------
regress/lib/libc/dirname/Makefile | 10 ---
regress/lib/libc/dirname/test.c | 102 -------------------------------------
5 files changed, 2 insertions(+), 219 deletions(-)
diffs (245 lines):
diff -r bf0f84945beb -r 3dc85429916e regress/lib/libc/Makefile
--- a/regress/lib/libc/Makefile Wed Dec 22 23:45:44 2010 +0000
+++ b/regress/lib/libc/Makefile Wed Dec 22 23:48:19 2010 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.59 2010/12/21 14:26:17 pgoyette Exp $
+# $NetBSD: Makefile,v 1.60 2010/12/22 23:48:19 pgoyette Exp $
-SUBDIR+= _setjmp atexit basename citrus clone context convfp db dirname \
+SUBDIR+= _setjmp atexit citrus clone context convfp db \
div divrem gen gdtoa getaddrinfo hsearch inet int_fmtio locale md5sha \
nsdispatch popen pty randomid regex rpc servent setjmp sigsetjmp \
stdlib string strptime sys time
diff -r bf0f84945beb -r 3dc85429916e regress/lib/libc/basename/Makefile
--- a/regress/lib/libc/basename/Makefile Wed Dec 22 23:45:44 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2002/10/16 19:12:41 thorpej Exp $
-
-NOMAN= # defined
-
-PROG= test
-
-regress: ${PROG}
- ./${PROG}
-
-.include <bsd.prog.mk>
diff -r bf0f84945beb -r 3dc85429916e regress/lib/libc/basename/test.c
--- a/regress/lib/libc/basename/test.c Wed Dec 22 23:45:44 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/* $NetBSD: test.c,v 1.3 2006/05/10 19:07:22 mrg Exp $ */
-
-/*
- * Regression test for basename(3).
- *
- * Written by Jason R. Thorpe <thorpej%NetBSD.org@localhost>, Oct. 2002.
- * Public domain.
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libgen.h>
-
-struct {
- const char *input;
- const char *output;
-} test_table[] = {
-/*
- * The following are taken from the "Sample Input and Output Strings
- * for basename()" table in IEEE Std 1003.1-2001.
- */
- { "/usr/lib", "lib" },
- { "/usr/", "usr" },
- { "/", "/" },
- { "///", "/" },
- { "//usr//lib//", "lib" },
-/*
- * IEEE Std 1003.1-2001:
- *
- * If path is a null pointer or points to an empty string,
- * basename() shall return a pointer to the string "." .
- */
- { "", "." },
- { NULL, "." },
-/*
- * IEEE Std 1003.1-2001:
- *
- * If the string is exactly "//", it is implementation-defined
- * whether "/" or "//" is returned.
- *
- * The NetBSD implementation returns "/".
- */
- { "//", "/" },
-
- { NULL, NULL }
-};
-
-int main(int argc, char *argv[]);
-
-int
-main(int argc, char *argv[])
-{
- char testbuf[32], *base;
- int i, rv = 0;
-
- for (i = 0; test_table[i].output != NULL; i++) {
- if (test_table[i].input != NULL) {
- assert(strlen(test_table[i].input) < sizeof(testbuf));
- strcpy(testbuf, test_table[i].input);
- base = basename(testbuf);
- } else
- base = basename(NULL);
-
- /*
- * basename(3) is allowed to modify the input buffer.
- * However, that is considered hostile by some programs,
- * and so we elect to consider this an error.
- *
- * This is not a problem, as basename(3) is also allowed
- * to return a pointer to a statically-allocated buffer
- * (it is explicitly not required to be reentrant).
- */
- if (test_table[i].input != NULL &&
- strcmp(test_table[i].input, testbuf) != 0) {
- fprintf(stderr,
- "Input buffer for \"%s\" was modified\n",
- test_table[i].input);
- rv = 1;
- }
-
- /* Make sure the result is correct. */
- if (strcmp(test_table[i].output, base) != 0) {
- fprintf(stderr,
- "Input \"%s\", output \"%s\", expected \"%s\"\n",
- test_table[i].input == NULL ? "(null)"
- : test_table[i].input,
- base, test_table[i].output);
- rv = 1;
- }
- }
-
- exit(rv);
-}
diff -r bf0f84945beb -r 3dc85429916e regress/lib/libc/dirname/Makefile
--- a/regress/lib/libc/dirname/Makefile Wed Dec 22 23:45:44 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2002/10/16 19:12:42 thorpej Exp $
-
-NOMAN= # defined
-
-PROG= test
-
-regress: ${PROG}
- ./${PROG}
-
-.include <bsd.prog.mk>
diff -r bf0f84945beb -r 3dc85429916e regress/lib/libc/dirname/test.c
--- a/regress/lib/libc/dirname/test.c Wed Dec 22 23:45:44 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/* $NetBSD: test.c,v 1.5 2006/05/10 19:07:22 mrg Exp $ */
-
-/*
- * Regression test for dirname(3).
- *
- * Written by Jason R. Thorpe <thorpej%NetBSD.org@localhost>, Oct. 2002.
- * Public domain.
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <libgen.h>
-#include <stdlib.h>
-
-struct {
- const char *input;
- const char *output;
-} test_table[] = {
-/*
- * The following are taken from the "Sample Input and Output Strings
- * for dirname()" table in IEEE Std 1003.1-2001.
- */
- { "/usr/lib", "/usr" },
- { "/usr/", "/" },
- { "usr", "." },
- { "/", "/" },
- { ".", "." },
- { "..", "." },
-/*
- * IEEE Std 1003.1-2001:
- *
- * If path is a null pointer or points to an empty string,
- * dirname() shall return a pointer to the string "." .
- */
- { "", "." },
- { NULL, "." },
-/*
- * IEEE Std 1003.1-2001:
- *
- * Since the meaning of the leading "//" is implementation-defined,
- * dirname("//foo") may return either "//" or "/" (but nothing else).
- *
- * The NetBSD implementation returns "/".
- */
- { "//foo", "/" },
-/*
- * Make sure the trailing slashes after the directory name component
- * get trimmed. The Std does not talk about this, but this is what
- * Solaris 8's dirname(3) does.
- */
- { "/usr///lib", "/usr" },
-
- { NULL, NULL }
-};
-
-int main(int argc, char *argv[]);
-
-int
-main(int argc, char *argv[])
-{
- char testbuf[32], *base;
- int i, rv = 0;
-
- for (i = 0; test_table[i].output != NULL; i++) {
- if (test_table[i].input != NULL) {
- assert(strlen(test_table[i].input) < sizeof(testbuf));
- strcpy(testbuf, test_table[i].input);
- base = dirname(testbuf);
- } else
- base = dirname(NULL);
-
- /*
- * dirname(3) is allowed to modify the input buffer.
- * However, that is considered hostile by some programs,
- * and so we elect to consider this an error.
- *
- * This is not a problem, as dirname(3) is also allowed
- * to return a pointer to a statically-allocated buffer
- * (it is explicitly not required to be reentrant).
- */
- if (test_table[i].input != NULL &&
- strcmp(test_table[i].input, testbuf) != 0) {
- fprintf(stderr,
- "Input buffer for \"%s\" was modified\n",
- test_table[i].input);
- rv = 1;
- }
-
- /* Make sure the result is correct. */
- if (strcmp(test_table[i].output, base) != 0) {
- fprintf(stderr,
- "Input \"%s\", output \"%s\", expected \"%s\"\n",
- test_table[i].input == NULL ? "(null)"
- : test_table[i].input,
- base, test_table[i].output);
- rv = 1;
- }
- }
-
- exit(rv);
-}
Home |
Main Index |
Thread Index |
Old Index