From 99ef2719fb3d703fe38c4113cd7f5adec516dd3a Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 28 Oct 2016 20:29:21 +0200 Subject: test: remove test suite The test suite is now a developed in a separate git repository. See here: http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng-test.git The test suite should be just like every other software compiled with the cross-toolchain. In the past strange problems where found when the test suite got build in the toolchain creation step. --- test/misc/Makefile | 8 - test/misc/Makefile.in | 42 --- test/misc/bug-glob1.c | 92 ------ test/misc/bug-glob2.c | 300 ------------------ test/misc/bug-readdir1.c | 37 --- test/misc/dirent.c | 39 --- test/misc/dirent64.c | 1 - test/misc/fdopen.c | 52 --- test/misc/opendir-tst1.c | 95 ------ test/misc/outb.c | 9 - test/misc/popen.c | 47 --- test/misc/seek.c | 82 ----- test/misc/sem.c | 45 --- test/misc/stdarg.c | 23 -- test/misc/tst-fnmatch.c | 443 -------------------------- test/misc/tst-fnmatch.input | 754 -------------------------------------------- test/misc/tst-gnuglob.c | 446 -------------------------- test/misc/tst-inotify.c | 65 ---- test/misc/tst-mkostemps.c | 159 ---------- test/misc/tst-nftw.c | 57 ---- test/misc/tst-scandir.c | 23 -- test/misc/tst-seekdir.c | 79 ----- test/misc/tst-statfs.c | 31 -- test/misc/tst-statvfs.c | 26 -- test/misc/tst-utmp.c | 423 ------------------------- test/misc/tst-utmpx.c | 2 - 26 files changed, 3380 deletions(-) delete mode 100644 test/misc/Makefile delete mode 100644 test/misc/Makefile.in delete mode 100644 test/misc/bug-glob1.c delete mode 100644 test/misc/bug-glob2.c delete mode 100644 test/misc/bug-readdir1.c delete mode 100644 test/misc/dirent.c delete mode 100644 test/misc/dirent64.c delete mode 100644 test/misc/fdopen.c delete mode 100644 test/misc/opendir-tst1.c delete mode 100644 test/misc/outb.c delete mode 100644 test/misc/popen.c delete mode 100644 test/misc/seek.c delete mode 100644 test/misc/sem.c delete mode 100644 test/misc/stdarg.c delete mode 100644 test/misc/tst-fnmatch.c delete mode 100644 test/misc/tst-fnmatch.input delete mode 100644 test/misc/tst-gnuglob.c delete mode 100644 test/misc/tst-inotify.c delete mode 100644 test/misc/tst-mkostemps.c delete mode 100644 test/misc/tst-nftw.c delete mode 100644 test/misc/tst-scandir.c delete mode 100644 test/misc/tst-seekdir.c delete mode 100644 test/misc/tst-statfs.c delete mode 100644 test/misc/tst-statvfs.c delete mode 100644 test/misc/tst-utmp.c delete mode 100644 test/misc/tst-utmpx.c (limited to 'test/misc') diff --git a/test/misc/Makefile b/test/misc/Makefile deleted file mode 100644 index 09fa233a6..000000000 --- a/test/misc/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# uClibc misc tests -# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. - -top_builddir=../../ -top_srcdir=../../ -include ../Rules.mak --include Makefile.in -include ../Test.mak diff --git a/test/misc/Makefile.in b/test/misc/Makefile.in deleted file mode 100644 index 7d7bb1048..000000000 --- a/test/misc/Makefile.in +++ /dev/null @@ -1,42 +0,0 @@ -# uClibc misc tests -# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. - -TESTS_DISABLED := outb tst-fnmatch bug-glob1 tst-gnuglob - -ifeq ($(TARGET_avr32),y) -TESTS_DISABLED += tst-inotify -endif - -ifeq ($(UCLIBC_HAS_LFS),) -TESTS_DISABLED += dirent64 -TESTS_DISABLED += tst-statfs # assuming host has LFS on -endif -CFLAGS_dirent64 := -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 - -ifeq ($(UCLIBC_LINUX_SPECIFIC),) -TESTS_DISABLED += tst-inotify -endif - -ifeq ($(UCLIBC_HAS_GLOB),) -TESTS_DISABLED += bug-glob2 -endif - -ifeq ($(UCLIBC_HAS_UTMPX),) -TESTS_DISABLED += tst-utmpx -endif - -ifeq ($(UCLIBC_HAS_UTMP),) -TESTS_DISABLED += tst-utmp -endif - -DODIFF_dirent := 1 -DODIFF_dirent64 := 1 -DODIFF_tst-statfs := 1 -DODIFF_tst-statvfs := 1 - -OPTS_bug-glob1 := $(PWD) -OPTS_tst-fnmatch := < tst-fnmatch.input - -MNTENTS = / /sys /proc /dev -OPTS_tst-statfs := $(MNTENTS) -OPTS_tst-statvfs := $(MNTENTS) diff --git a/test/misc/bug-glob1.c b/test/misc/bug-glob1.c deleted file mode 100644 index 276983a0d..000000000 --- a/test/misc/bug-glob1.c +++ /dev/null @@ -1,92 +0,0 @@ -/* Test case for globbing dangling symlink. By Ulrich Drepper. */ -#include -#include -#include -#include -#include -#include -#include - - -static void prepare (int argc, char *argv[]); -#define PREPARE prepare -static int do_test (void); -#define TEST_FUNCTION do_test () - -#include "../test-skeleton.c" - - -static char *fname; - -static void -prepare (int argc, char *argv[]) -{ - if (argc < 2) - error (EXIT_FAILURE, 0, "missing argument"); - - size_t len = strlen (argv[1]); - static const char ext[] = "globXXXXXX"; - fname = malloc (len + sizeof (ext)); - if (fname == NULL) - error (EXIT_FAILURE, errno, "cannot create temp file"); - again: - strcpy (stpcpy (fname, argv[1]), ext); - -/* fname = mktemp (fname); */ - close(mkstemp(fname)); - unlink(fname); - - if (fname == NULL || *fname == '\0') - error (EXIT_FAILURE, errno, "cannot create temp file name"); - if (symlink ("bug-glob1-does-not-exist", fname) != 0) - { - if (errno == EEXIST) - goto again; - - error (EXIT_FAILURE, errno, "cannot create symlink"); - } - add_temp_file (fname); -} - - -static int -do_test (void) -{ - glob_t gl; - int retval = 0; - int e; - - e = glob (fname, 0, NULL, &gl); - if (e == 0) - { - printf ("glob(\"%s\") succeeded when it should not have\n", fname); - retval = 1; - } - globfree (&gl); - - size_t fnamelen = strlen (fname); - char buf[fnamelen + 2]; - - strcpy (buf, fname); - buf[fnamelen - 1] = '?'; - e = glob (buf, 0, NULL, &gl); - if (e == 0) - { - printf ("glob(\"%s\") succeeded when it should not have\n", buf); - retval = 1; - } - globfree (&gl); - - strcpy (buf, fname); - buf[fnamelen] = '*'; - buf[fnamelen + 1] = '\0'; - e = glob (buf, 0, NULL, &gl); - if (e == 0) - { - printf ("glob(\"%s\") succeeded when it should not have\n", buf); - retval = 1; - } - globfree (&gl); - - return retval; -} diff --git a/test/misc/bug-glob2.c b/test/misc/bug-glob2.c deleted file mode 100644 index 069891b03..000000000 --- a/test/misc/bug-glob2.c +++ /dev/null @@ -1,300 +0,0 @@ -/* Test glob memory management. - for the filesystem access functions. - Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include -#include -#include -#include -#include - -// #define DEBUG -#ifdef DEBUG -# define PRINTF(fmt, args...) \ - do \ - { \ - int save_errno = errno; \ - printf (fmt, ##args); \ - errno = save_errno; \ - } while (0) -#else -# define PRINTF(fmt, args...) -#endif - - -#ifdef GLOB_ALTDIRFUNC -static struct -{ - const char *name; - int level; - int type; - mode_t mode; -} filesystem[] = -{ - { ".", 1, DT_DIR, 0755 }, - { "..", 1, DT_DIR, 0755 }, - { "dir", 1, DT_DIR, 0755 }, - { ".", 2, DT_DIR, 0755 }, - { "..", 2, DT_DIR, 0755 }, - { "readable", 2, DT_DIR, 0755 }, - { ".", 3, DT_DIR, 0755 }, - { "..", 3, DT_DIR, 0755 }, - { "a", 3, DT_REG, 0644 }, - { "unreadable", 2, DT_DIR, 0111 }, - { ".", 3, DT_DIR, 0111 }, - { "..", 3, DT_DIR, 0755 }, - { "a", 3, DT_REG, 0644 }, - { "zz-readable", 2, DT_DIR, 0755 }, - { ".", 3, DT_DIR, 0755 }, - { "..", 3, DT_DIR, 0755 }, - { "a", 3, DT_REG, 0644 } -}; -#define nfiles (sizeof (filesystem) / sizeof (filesystem[0])) - - -typedef struct -{ - int level; - int idx; - struct dirent d; - char room_for_dirent[NAME_MAX]; -} my_DIR; - - -static long int -find_file (const char *s) -{ - int level = 1; - long int idx = 0; - - if (strcmp (s, ".") == 0) - return 0; - - if (s[0] == '.' && s[1] == '/') - s += 2; - - while (*s != '\0') - { - char *endp = strchrnul (s, '/'); - - PRINTF ("looking for %.*s, level %d\n", (int) (endp - s), s, level); - - while (idx < nfiles && filesystem[idx].level >= level) - { - if (filesystem[idx].level == level - && memcmp (s, filesystem[idx].name, endp - s) == 0 - && filesystem[idx].name[endp - s] == '\0') - break; - ++idx; - } - - if (idx == nfiles || filesystem[idx].level < level) - { - errno = ENOENT; - return -1; - } - - if (*endp == '\0') - return idx + 1; - - if (filesystem[idx].type != DT_DIR - && (idx + 1 >= nfiles - || filesystem[idx].level >= filesystem[idx + 1].level)) - { - errno = ENOTDIR; - return -1; - } - - ++idx; - - s = endp + 1; - ++level; - } - - errno = ENOENT; - return -1; -} - - -static void * -my_opendir (const char *s) -{ - long int idx = find_file (s); - my_DIR *dir; - - if (idx == -1) - { - PRINTF ("my_opendir(\"%s\") == NULL (%m)\n", s); - return NULL; - } - - if ((filesystem[idx].mode & 0400) == 0) - { - errno = EACCES; - PRINTF ("my_opendir(\"%s\") == NULL (%m)\n", s); - return NULL; - } - - dir = (my_DIR *) malloc (sizeof (my_DIR)); - if (dir == NULL) - { - printf ("cannot allocate directory handle: %m\n"); - exit (EXIT_FAILURE); - } - - dir->level = filesystem[idx].level; - dir->idx = idx; - - PRINTF ("my_opendir(\"%s\") == { level: %d, idx: %ld }\n", - s, filesystem[idx].level, idx); - - return dir; -} - - -static struct dirent * -my_readdir (void *gdir) -{ - my_DIR *dir = gdir; - - if (dir->idx == -1) - { - PRINTF ("my_readdir ({ level: %d, idx: %ld }) = NULL\n", - dir->level, (long int) dir->idx); - return NULL; - } - - while (dir->idx < nfiles && filesystem[dir->idx].level > dir->level) - ++dir->idx; - - if (dir->idx == nfiles || filesystem[dir->idx].level < dir->level) - { - dir->idx = -1; - PRINTF ("my_readdir ({ level: %d, idx: %ld }) = NULL\n", - dir->level, (long int) dir->idx); - return NULL; - } - - dir->d.d_ino = dir->idx; - -#ifdef _DIRENT_HAVE_D_TYPE - dir->d.d_type = filesystem[dir->idx].type; -#endif - - strcpy (dir->d.d_name, filesystem[dir->idx].name); - -#ifdef _DIRENT_HAVE_D_TYPE - PRINTF ("my_readdir ({ level: %d, idx: %ld }) = { d_ino: %ld, d_type: %d, d_name: \"%s\" }\n", - dir->level, (long int) dir->idx, dir->d.d_ino, dir->d.d_type, - dir->d.d_name); -#else - PRINTF ("my_readdir ({ level: %d, idx: %ld }) = { d_ino: %ld, d_name: \"%s\" }\n", - dir->level, (long int) dir->idx, dir->d.d_ino, - dir->d.d_name); -#endif - - ++dir->idx; - - return &dir->d; -} - - -static void -my_closedir (void *dir) -{ - PRINTF ("my_closedir ()\n"); - free (dir); -} - - -/* We use this function for lstat as well since we don't have any. */ -static int -my_stat (const char *name, struct stat *st) -{ - long int idx = find_file (name); - - if (idx == -1) - { - PRINTF ("my_stat (\"%s\", ...) = -1 (%m)\n", name); - return -1; - } - - memset (st, '\0', sizeof (*st)); - - if (filesystem[idx].type == DT_UNKNOWN) - st->st_mode = DTTOIF (idx + 1 < nfiles - && filesystem[idx].level < filesystem[idx + 1].level - ? DT_DIR : DT_REG) | filesystem[idx].mode; - else - st->st_mode = DTTOIF (filesystem[idx].type) | filesystem[idx].mode; - - PRINTF ("my_stat (\"%s\", { st_mode: %o }) = 0\n", name, st->st_mode); - - return 0; -} - - -static void -init_glob_altdirfuncs (glob_t *pglob) -{ - pglob->gl_closedir = my_closedir; - pglob->gl_readdir = my_readdir; - pglob->gl_opendir = my_opendir; - pglob->gl_lstat = my_stat; - pglob->gl_stat = my_stat; -} - - -static int -do_test (void) -{ - glob_t gl; - memset (&gl, 0, sizeof (gl)); - init_glob_altdirfuncs (&gl); - - if (glob ("dir/*able/*", GLOB_ERR | GLOB_ALTDIRFUNC, NULL, &gl) - != GLOB_ABORTED) - { - puts ("glob did not fail with GLOB_ABORTED"); - exit (EXIT_FAILURE); - } - - globfree (&gl); - - memset (&gl, 0, sizeof (gl)); - init_glob_altdirfuncs (&gl); - - gl.gl_offs = 3; - if (glob ("dir2/*", GLOB_DOOFFS, NULL, &gl) != GLOB_NOMATCH) - { - puts ("glob did not fail with GLOB_NOMATCH"); - exit (EXIT_FAILURE); - } - - globfree (&gl); - - return 0; -} -#else -static int do_test (void) { return 0; } -#endif - -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" diff --git a/test/misc/bug-readdir1.c b/test/misc/bug-readdir1.c deleted file mode 100644 index a8594a82e..000000000 --- a/test/misc/bug-readdir1.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include -#include -#include -#include - - -int -main (void) -{ - DIR *dirp; - struct dirent* ent; - - /* open a dir stream */ - dirp = opendir ("/tmp"); - if (dirp == NULL) - { - if (errno == ENOENT) - exit (0); - - perror ("opendir"); - exit (1); - } - - /* close the directory file descriptor, making it invalid */ - if (close (dirfd (dirp)) != 0) - { - puts ("could not close directory file descriptor"); - /* This is not an error. It is not guaranteed this is possible. */ - return 0; - } - - ent = readdir (dirp); - - return ent != NULL || errno != EBADF; -} diff --git a/test/misc/dirent.c b/test/misc/dirent.c deleted file mode 100644 index 491e3cf75..000000000 --- a/test/misc/dirent.c +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define _DTIFY(DT) [DT] #DT -const char * const types[] = { - _DTIFY(DT_UNKNOWN), - _DTIFY(DT_FIFO), - _DTIFY(DT_CHR), - _DTIFY(DT_DIR), - _DTIFY(DT_BLK), - _DTIFY(DT_REG), - _DTIFY(DT_LNK), - _DTIFY(DT_SOCK), - _DTIFY(DT_WHT) -}; - -int main(int argc, char *argv[]) -{ - DIR *dirh; - struct dirent *de; - const char *mydir = (argc == 1 ? "/" : argv[1]); - - if ((dirh = opendir(mydir)) == NULL) { - perror("opendir"); - return 1; - } - - printf("readdir() says:\n"); - while ((de = readdir(dirh)) != NULL) - printf("\tdir entry %s: %s\n", types[de->d_type], de->d_name); - - closedir(dirh); - - return 0; -} diff --git a/test/misc/dirent64.c b/test/misc/dirent64.c deleted file mode 100644 index 26455ab68..000000000 --- a/test/misc/dirent64.c +++ /dev/null @@ -1 +0,0 @@ -#include "dirent.c" diff --git a/test/misc/fdopen.c b/test/misc/fdopen.c deleted file mode 100644 index 97e66de0a..000000000 --- a/test/misc/fdopen.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Test for fdopen bugs. */ - -#include -#include -#include -#include - -#define assert(x) \ - if (!(x)) \ - { \ - fputs ("test failed: " #x "\n", stderr); \ - retval = 1; \ - goto the_end; \ - } - -int -main (int argc, char *argv[]) -{ - char name[256]; - FILE *fp = NULL; - int retval = 0; - int fd; - - /* hack to get a tempfile name w/out using tmpname() - * as that func causes a link time warning */ - sprintf(name, "%s-uClibc-test.XXXXXX", __FILE__); - fd = mkstemp(name); - close(fd); - - fp = fopen (name, "w"); - assert (fp != NULL) - assert (fputs ("foobar and baz", fp) > 0); - assert (fclose (fp) == 0); - fp = NULL; - - fd = open (name, O_RDWR|O_CREAT, 0660); - assert (fd != -1); - assert (lseek (fd, 5, SEEK_SET) == 5); - - fp = fdopen (fd, "a"); - assert (fp != NULL); - /* SuSv3 says that doing a fdopen() does not reset the file position, - * thus the '5' here is correct, not '14'. */ - assert (ftell (fp) == 5); - -the_end: - if (fp != NULL) - assert (fclose (fp) == 0); - unlink (name); - - return retval; -} diff --git a/test/misc/opendir-tst1.c b/test/misc/opendir-tst1.c deleted file mode 100644 index ffd785f80..000000000 --- a/test/misc/opendir-tst1.c +++ /dev/null @@ -1,95 +0,0 @@ -/* Copyright (C) 1998, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 1998. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include -#include -#include -#include -#include -#include - -/* Name of the FIFO. */ -char tmpname[] = "fifoXXXXXX"; - - -/* Do the real work. */ -static int -real_test (void) -{ - DIR *dirp; - - /* This should not block for an FIFO. */ - dirp = opendir (tmpname); - - /* Successful. */ - if (dirp != NULL) - { - /* Oh, oh, how can this work? */ - fputs ("`opendir' succeeded on a FIFO???\n", stdout); - closedir (dirp); - return 1; - } - - if (errno != ENOTDIR) - { - fprintf (stdout, "`opendir' return error `%s' instead of `%s'\n", - strerror (errno), strerror (ENOTDIR)); - return 1; - } - - return 0; -} - - -static int -do_test (int argc, char *argv[]) -{ - int retval; - - retval = mkstemp(tmpname); - close(retval); - unlink(tmpname); - - /* Try to generate a FIFO. */ - if (mknod (tmpname, 0600 | S_IFIFO, 0) < 0) - { - perror ("mknod"); - /* We cannot make this an error. */ - return 0; - } - - retval = real_test (); - - remove (tmpname); - - return retval; -} - - -static void -do_cleanup (void) -{ - remove (tmpname); -} -#define CLEANUP_HANDLER do_cleanup () - - -/* Include the test skeleton. */ -#include "../test-skeleton.c" diff --git a/test/misc/outb.c b/test/misc/outb.c deleted file mode 100644 index bbe18eaec..000000000 --- a/test/misc/outb.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -int main(void) -{ - ioperm(0x340,0x342,1); - outb(0x340,0x0); - exit(0); -} - diff --git a/test/misc/popen.c b/test/misc/popen.c deleted file mode 100644 index 868b70eed..000000000 --- a/test/misc/popen.c +++ /dev/null @@ -1,47 +0,0 @@ -#include -#include -#include -#include -#include - -#define TEST(r, f, x, m) ( \ -((r) = (f)) == (x) || \ -(printf(__FILE__ ":%d: %s failed (" m ")\n", __LINE__, #f, r, x), err++, 0) ) - -#define TEST_E(f) ( (errno = 0), (f) || \ -(printf(__FILE__ ":%d: %s failed (errno = %d)\n", __LINE__, #f, errno), err++, 0) ) - -#define TEST_S(s, x, m) ( \ -!strcmp((s),(x)) || \ -(printf(__FILE__ ":%d: [%s] != [%s] (%s)\n", __LINE__, s, x, m), err++, 0) ) - -static sig_atomic_t got_sig; - -static void handler(int sig) -{ - got_sig = 1; -} - -int main(void) -{ - int i; - char foo[6]; - char cmd[64]; - int err = 0; - FILE *f; - - TEST_E(f = popen("echo hello", "r")); - TEST_E(fgets(foo, sizeof foo, f)); - TEST_S(foo, "hello", "child process did not say hello"); - TEST(i, pclose(f), 0, "exit status %04x != %04x"); - - signal(SIGUSR1, handler); - snprintf(cmd, sizeof cmd, "read a ; test \"x$a\" = xhello && kill -USR1 %d", getpid()); - TEST_E(f = popen(cmd, "w")); - TEST_E(fputs("hello", f) >= 0); - TEST(i, pclose(f), 0, "exit status %04x != %04x"); - signal(SIGUSR1, SIG_DFL); - TEST(i, got_sig, 1, "child process did not send signal (%i!=%i)"); - - return err; -} diff --git a/test/misc/seek.c b/test/misc/seek.c deleted file mode 100644 index c5edb94c9..000000000 --- a/test/misc/seek.c +++ /dev/null @@ -1,82 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(*arr)) - -int main(void) -{ - struct { - off_t offset; - int whence; - } tests[] = { - { 0x00, SEEK_SET }, - { 0x01, SEEK_SET }, - { 0xFF, SEEK_SET } - }; - char buf[2000]; - off_t ret; - int i, fd; - FILE *fp; - int tmp; - - fd = open("lseek.out", O_RDWR|O_CREAT, 0600); - if (fd == -1) { - perror("open(lseek.out) failed"); - return 1; - } - unlink("lseek.out"); - fp = fdopen(fd, "rw"); - if (fp == NULL) { - perror("fopen(lseek.out) failed"); - return 1; - } - - memset(buf, 0xAB, sizeof(buf)); - ret = write(fd, buf, sizeof(buf)); - if (ret != sizeof(buf)) { - fprintf(stderr, "write() failed to write %zi bytes (wrote %li): ", sizeof(buf), (long)ret); - perror(""); - return 1; - } - - tmp = fseeko(fp, 1024, SEEK_SET); - assert(tmp == 0); - tmp = fseeko(fp, (off_t)-16, SEEK_CUR); - assert(tmp == 0); - ret = ftell(fp); - if (ret != (1024-16)) { - fprintf(stderr, "ftell() failed, we wanted pos %i but got %li: ", (1024-16), (long)ret); - perror(""); - return 1; - } - - for (i = 0; i < ARRAY_SIZE(tests); ++i) { - ret = lseek(fd, tests[i].offset, tests[i].whence); - if (ret != tests[i].offset) { - fprintf(stderr, "lseek(%li,%i) failed (wanted %li, got %li): ", (long)tests[i].offset, - tests[i].whence, (long)tests[i].offset, (long)ret); - perror(""); - return 1; - } - ret = fseek(fp, tests[i].offset, tests[i].whence); - if (ret != 0) { - fprintf(stderr, "fseek(%li,%i) failed (wanted 0, got %li): ", (long)tests[i].offset, - tests[i].whence, (long)ret); - perror(""); - return 1; - } - } - - fclose(fp); - close(fd); - - printf("Success!\n"); - - return 0; -} diff --git a/test/misc/sem.c b/test/misc/sem.c deleted file mode 100644 index 62a59b1e9..000000000 --- a/test/misc/sem.c +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include -#include -#include -#include -#include - -int main(void) -{ - int k, r; - union semun { - int val; - struct semid_ds *buf; - unsigned short int *array; - struct seminfo *__buf; - } sd; - struct semid_ds sd_buf; - - k = semget(IPC_PRIVATE, 10, IPC_CREAT | 0666 ); - printf("semget(IPC_CREAT) = %d\n", k); - - if (k < 0) { - fprintf(stderr, "semget failed: %s\n", strerror(errno)); - return 1; - } - - sd.buf = &sd_buf; - r = semctl(k, 0, IPC_STAT, sd); - printf("semctl(k) = %d\n", r); - - if (r < 0) { - perror("semctl IPC_STAT failed"); - return 1; - } - - printf("sem_nsems = %lu\n", sd_buf.sem_nsems); - if (sd_buf.sem_nsems != 10) { - fprintf(stderr, "failed: incorrect sem_nsems!\n"); - return 1; - } - - printf("succeeded\n"); - - return 0; -} diff --git a/test/misc/stdarg.c b/test/misc/stdarg.c deleted file mode 100644 index 1566e0ce8..000000000 --- a/test/misc/stdarg.c +++ /dev/null @@ -1,23 +0,0 @@ -/* copied from rsync */ - -#include -#include -#include -#include -#include -static int foo(const char *format, ...) -{ - va_list ap; - size_t len; - char buf[5]; - - va_start(ap, format); - len = vsnprintf(0, 0, format, ap); - va_end(ap); - if (len != 5) return(1); - - if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) return(1); - - return(0); -} -int main(void) { return foo("hello"); } diff --git a/test/misc/tst-fnmatch.c b/test/misc/tst-fnmatch.c deleted file mode 100644 index e7d5324bb..000000000 --- a/test/misc/tst-fnmatch.c +++ /dev/null @@ -1,443 +0,0 @@ -/* Tests for fnmatch function. - Copyright (C) 2000, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -static char *next_input (char **line, int first, int last); -static int convert_flags (const char *str); -static char *flag_output (int flags); -static char *escape (const char *str, size_t *reslenp, char **resbuf); - - -int str_isalpha(const char *str) -{ - size_t i = strlen(str); - while (i--) - if (isascii(str[i]) == 0) - return 0; - return 1; -} -int str_has_funk(const char *str, const char x) -{ - size_t i, max = strlen(str); - for (i=0; i+1 reslen) - { - resbuf = (char *) realloc (resbuf, 2 * len + 1); - if (resbuf == NULL) - error (EXIT_FAILURE, errno, "while allocating buffer for printing"); - *reslenp = 2 * len + 1; - *resbufp = resbuf; - } - - wp = resbuf; - while (*str != '\0') - if (*str == '\t') - { - *wp++ = '\\'; - *wp++ = 't'; - ++str; - } - else if (*str == '\n') - { - *wp++ = '\\'; - *wp++ = 'n'; - ++str; - } - else if (*str == '"') - { - *wp++ = '\\'; - *wp++ = '"'; - ++str; - } - else if (*str == '\\') - { - *wp++ = '\\'; - *wp++ = '\\'; - ++str; - } - else - *wp++ = *str++; - - *wp = '\0'; - - return resbuf; -} diff --git a/test/misc/tst-fnmatch.input b/test/misc/tst-fnmatch.input deleted file mode 100644 index bf69c12c0..000000000 --- a/test/misc/tst-fnmatch.input +++ /dev/null @@ -1,754 +0,0 @@ -# Tests for fnmatch. -# Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. -# This file is part of the GNU C Library. -# Contributes by Ulrich Drepper . -# - -# The GNU C Library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. - -# The GNU C Library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. - -# You should have received a copy of the GNU Lesser General Public -# License along with the GNU C Library; see the file COPYING.LIB. If -# not, see . - - -# Derived from the IEEE 2003.2 text. The standard only contains some -# wording describing the situations to be tested. It does not specify -# any specific tests. I.e., the tests below are in no case sufficient. -# They are hopefully necessary, though. - -# B.6 004(C) -C "!#%+,-./01234567889" "!#%+,-./01234567889" 0 -C ":;=@ABCDEFGHIJKLMNO" ":;=@ABCDEFGHIJKLMNO" 0 -C "PQRSTUVWXYZ]abcdefg" "PQRSTUVWXYZ]abcdefg" 0 -C "hijklmnopqrstuvwxyz" "hijklmnopqrstuvwxyz" 0 -C "^_{}~" "^_{}~" 0 - -# B.6 005(C) -C "\"$&'()" "\\\"\\$\\&\\'\\(\\)" 0 -C "*?[\\`|" "\\*\\?\\[\\\\\\`\\|" 0 -C "<>" "\\<\\>" 0 - -# B.6 006(C) -C "?*[" "[?*[][?*[][?*[]" 0 -C "a/b" "?/b" 0 - -# B.6 007(C) -C "a/b" "a?b" 0 -C "a/b" "a/?" 0 -C "aa/b" "?/b" NOMATCH -C "aa/b" "a?b" NOMATCH -C "a/bb" "a/?" NOMATCH - -# B.6 009(C) -C "abc" "[abc]" NOMATCH -C "x" "[abc]" NOMATCH -C "a" "[abc]" 0 -C "[" "[[abc]" 0 -C "a" "[][abc]" 0 -C "a]" "[]a]]" 0 - -# B.6 010(C) -C "xyz" "[!abc]" NOMATCH -C "x" "[!abc]" 0 -C "a" "[!abc]" NOMATCH - -# B.6 011(C) -C "]" "[][abc]" 0 -C "abc]" "[][abc]" NOMATCH -C "[]abc" "[][]abc" NOMATCH -C "]" "[!]]" NOMATCH -C "aa]" "[!]a]" NOMATCH -C "]" "[!a]" 0 -C "]]" "[!a]]" 0 - -# B.6 012(C) -C "a" "[[.a.]]" 0 -C "-" "[[.-.]]" 0 -C "-" "[[.-.][.].]]" 0 -C "-" "[[.].][.-.]]" 0 -C "-" "[[.-.][=u=]]" 0 -C "-" "[[.-.][:alpha:]]" 0 -C "a" "[![.a.]]" NOMATCH - -# B.6 013(C) -C "a" "[[.b.]]" NOMATCH -C "a" "[[.b.][.c.]]" NOMATCH -C "a" "[[.b.][=b=]]" NOMATCH - - -# B.6 015(C) -C "a" "[[=a=]]" 0 -C "b" "[[=a=]b]" 0 -C "b" "[[=a=][=b=]]" 0 -C "a" "[[=a=][=b=]]" 0 -C "a" "[[=a=][.b.]]" 0 -C "a" "[[=a=][:digit:]]" 0 - -# B.6 016(C) -C "=" "[[=a=]b]" NOMATCH -C "]" "[[=a=]b]" NOMATCH -C "a" "[[=b=][=c=]]" NOMATCH -C "a" "[[=b=][.].]]" NOMATCH -C "a" "[[=b=][:digit:]]" NOMATCH - -# B.6 017(C) -C "a" "[[:alnum:]]" 0 -C "a" "[![:alnum:]]" NOMATCH -C "-" "[[:alnum:]]" NOMATCH -C "a]a" "[[:alnum:]]a" NOMATCH -C "-" "[[:alnum:]-]" 0 -C "aa" "[[:alnum:]]a" 0 -C "-" "[![:alnum:]]" 0 -C "]" "[!][:alnum:]]" NOMATCH -C "[" "[![:alnum:][]" NOMATCH -C "a" "[[:alnum:]]" 0 -C "b" "[[:alnum:]]" 0 -C "c" "[[:alnum:]]" 0 -C "d" "[[:alnum:]]" 0 -C "e" "[[:alnum:]]" 0 -C "f" "[[:alnum:]]" 0 -C "g" "[[:alnum:]]" 0 -C "h" "[[:alnum:]]" 0 -C "i" "[[:alnum:]]" 0 -C "j" "[[:alnum:]]" 0 -C "k" "[[:alnum:]]" 0 -C "l" "[[:alnum:]]" 0 -C "m" "[[:alnum:]]" 0 -C "n" "[[:alnum:]]" 0 -C "o" "[[:alnum:]]" 0 -C "p" "[[:alnum:]]" 0 -C "q" "[[:alnum:]]" 0 -C "r" "[[:alnum:]]" 0 -C "s" "[[:alnum:]]" 0 -C "t" "[[:alnum:]]" 0 -C "u" "[[:alnum:]]" 0 -C "v" "[[:alnum:]]" 0 -C "w" "[[:alnum:]]" 0 -C "x" "[[:alnum:]]" 0 -C "y" "[[:alnum:]]" 0 -C "z" "[[:alnum:]]" 0 -C "A" "[[:alnum:]]" 0 -C "B" "[[:alnum:]]" 0 -C "C" "[[:alnum:]]" 0 -C "D" "[[:alnum:]]" 0 -C "E" "[[:alnum:]]" 0 -C "F" "[[:alnum:]]" 0 -C "G" "[[:alnum:]]" 0 -C "H" "[[:alnum:]]" 0 -C "I" "[[:alnum:]]" 0 -C "J" "[[:alnum:]]" 0 -C "K" "[[:alnum:]]" 0 -C "L" "[[:alnum:]]" 0 -C "M" "[[:alnum:]]" 0 -C "N" "[[:alnum:]]" 0 -C "O" "[[:alnum:]]" 0 -C "P" "[[:alnum:]]" 0 -C "Q" "[[:alnum:]]" 0 -C "R" "[[:alnum:]]" 0 -C "S" "[[:alnum:]]" 0 -C "T" "[[:alnum:]]" 0 -C "U" "[[:alnum:]]" 0 -C "V" "[[:alnum:]]" 0 -C "W" "[[:alnum:]]" 0 -C "X" "[[:alnum:]]" 0 -C "Y" "[[:alnum:]]" 0 -C "Z" "[[:alnum:]]" 0 -C "0" "[[:alnum:]]" 0 -C "1" "[[:alnum:]]" 0 -C "2" "[[:alnum:]]" 0 -C "3" "[[:alnum:]]" 0 -C "4" "[[:alnum:]]" 0 -C "5" "[[:alnum:]]" 0 -C "6" "[[:alnum:]]" 0 -C "7" "[[:alnum:]]" 0 -C "8" "[[:alnum:]]" 0 -C "9" "[[:alnum:]]" 0 -C "!" "[[:alnum:]]" NOMATCH -C "#" "[[:alnum:]]" NOMATCH -C "%" "[[:alnum:]]" NOMATCH -C "+" "[[:alnum:]]" NOMATCH -C "," "[[:alnum:]]" NOMATCH -C "-" "[[:alnum:]]" NOMATCH -C "." "[[:alnum:]]" NOMATCH -C "/" "[[:alnum:]]" NOMATCH -C ":" "[[:alnum:]]" NOMATCH -C ";" "[[:alnum:]]" NOMATCH -C "=" "[[:alnum:]]" NOMATCH -C "@" "[[:alnum:]]" NOMATCH -C "[" "[[:alnum:]]" NOMATCH -C "\\" "[[:alnum:]]" NOMATCH -C "]" "[[:alnum:]]" NOMATCH -C "^" "[[:alnum:]]" NOMATCH -C "_" "[[:alnum:]]" NOMATCH -C "{" "[[:alnum:]]" NOMATCH -C "}" "[[:alnum:]]" NOMATCH -C "~" "[[:alnum:]]" NOMATCH -C "\"" "[[:alnum:]]" NOMATCH -C "$" "[[:alnum:]]" NOMATCH -C "&" "[[:alnum:]]" NOMATCH -C "'" "[[:alnum:]]" NOMATCH -C "(" "[[:alnum:]]" NOMATCH -C ")" "[[:alnum:]]" NOMATCH -C "*" "[[:alnum:]]" NOMATCH -C "?" "[[:alnum:]]" NOMATCH -C "`" "[[:alnum:]]" NOMATCH -C "|" "[[:alnum:]]" NOMATCH -C "<" "[[:alnum:]]" NOMATCH -C ">" "[[:alnum:]]" NOMATCH -C "\t" "[[:cntrl:]]" 0 -C "t" "[[:cntrl:]]" NOMATCH -C "t" "[[:lower:]]" 0 -C "\t" "[[:lower:]]" NOMATCH -C "T" "[[:lower:]]" NOMATCH -C "\t" "[[:space:]]" 0 -C "t" "[[:space:]]" NOMATCH -C "t" "[[:alpha:]]" 0 -C "\t" "[[:alpha:]]" NOMATCH -C "0" "[[:digit:]]" 0 -C "\t" "[[:digit:]]" NOMATCH -C "t" "[[:digit:]]" NOMATCH -C "\t" "[[:print:]]" NOMATCH -C "t" "[[:print:]]" 0 -C "T" "[[:upper:]]" 0 -C "\t" "[[:upper:]]" NOMATCH -C "t" "[[:upper:]]" NOMATCH -C "\t" "[[:blank:]]" 0 -C "t" "[[:blank:]]" NOMATCH -C "\t" "[[:graph:]]" NOMATCH -C "t" "[[:graph:]]" 0 -C "." "[[:punct:]]" 0 -C "t" "[[:punct:]]" NOMATCH -C "\t" "[[:punct:]]" NOMATCH -C "0" "[[:xdigit:]]" 0 -C "\t" "[[:xdigit:]]" NOMATCH -C "a" "[[:xdigit:]]" 0 -C "A" "[[:xdigit:]]" 0 -C "t" "[[:xdigit:]]" NOMATCH -C "a" "[[alpha]]" NOMATCH -C "a" "[[alpha:]]" NOMATCH -C "a]" "[[alpha]]" 0 -C "a]" "[[alpha:]]" 0 -C "a" "[[:alpha:][.b.]]" 0 -C "a" "[[:alpha:][=b=]]" 0 -C "a" "[[:alpha:][:digit:]]" 0 -C "a" "[[:digit:][:alpha:]]" 0 - -# B.6 018(C) -C "a" "[a-c]" 0 -C "b" "[a-c]" 0 -C "c" "[a-c]" 0 -C "a" "[b-c]" NOMATCH -C "d" "[b-c]" NOMATCH -C "B" "[a-c]" NOMATCH -C "b" "[A-C]" NOMATCH -C "" "[a-c]" NOMATCH -C "as" "[a-ca-z]" NOMATCH -C "a" "[[.a.]-c]" 0 -C "a" "[a-[.c.]]" 0 -C "a" "[[.a.]-[.c.]]" 0 -C "b" "[[.a.]-c]" 0 -C "b" "[a-[.c.]]" 0 -C "b" "[[.a.]-[.c.]]" 0 -C "c" "[[.a.]-c]" 0 -C "c" "[a-[.c.]]" 0 -C "c" "[[.a.]-[.c.]]" 0 -C "d" "[[.a.]-c]" NOMATCH -C "d" "[a-[.c.]]" NOMATCH -C "d" "[[.a.]-[.c.]]" NOMATCH - -# B.6 019(C) -C "a" "[c-a]" NOMATCH -C "a" "[[.c.]-a]" NOMATCH -C "a" "[c-[.a.]]" NOMATCH -C "a" "[[.c.]-[.a.]]" NOMATCH -C "c" "[c-a]" NOMATCH -C "c" "[[.c.]-a]" NOMATCH -C "c" "[c-[.a.]]" NOMATCH -C "c" "[[.c.]-[.a.]]" NOMATCH - -# B.6 020(C) -C "a" "[a-c0-9]" 0 -C "d" "[a-c0-9]" NOMATCH -C "B" "[a-c0-9]" NOMATCH - -# B.6 021(C) -C "-" "[-a]" 0 -C "a" "[-b]" NOMATCH -C "-" "[!-a]" NOMATCH -C "a" "[!-b]" 0 -C "-" "[a-c-0-9]" 0 -C "b" "[a-c-0-9]" 0 -C "a:" "a[0-9-a]" NOMATCH -C "a:" "a[09-a]" 0 - -# B.6 024(C) -C "" "*" 0 -C "asd/sdf" "*" 0 - -# B.6 025(C) -C "as" "[a-c][a-z]" 0 -C "as" "??" 0 - -# B.6 026(C) -C "asd/sdf" "as*df" 0 -C "asd/sdf" "as*" 0 -C "asd/sdf" "*df" 0 -C "asd/sdf" "as*dg" NOMATCH -C "asdf" "as*df" 0 -C "asdf" "as*df?" NOMATCH -C "asdf" "as*??" 0 -C "asdf" "a*???" 0 -C "asdf" "*????" 0 -C "asdf" "????*" 0 -C "asdf" "??*?" 0 - -# B.6 027(C) -C "/" "/" 0 -C "/" "/*" 0 -C "/" "*/" 0 -C "/" "/?" NOMATCH -C "/" "?/" NOMATCH -C "/" "?" 0 -C "." "?" 0 -C "/." "??" 0 -C "/" "[!a-c]" 0 -C "." "[!a-c]" 0 - -# B.6 029(C) -C "/" "/" 0 PATHNAME -C "//" "//" 0 PATHNAME -C "/.a" "/*" 0 PATHNAME -C "/.a" "/?a" 0 PATHNAME -C "/.a" "/[!a-z]a" 0 PATHNAME -C "/.a/.b" "/*/?b" 0 PATHNAME - -# B.6 030(C) -C "/" "?" NOMATCH PATHNAME -C "/" "*" NOMATCH PATHNAME -C "a/b" "a?b" NOMATCH PATHNAME -C "/.a/.b" "/*b" NOMATCH PATHNAME - -# B.6 031(C) -C "/$" "\\/\\$" 0 -C "/[" "\\/\\[" 0 -C "/[" "\\/[" NOMATCH - -# B.6 032(C) -C "/$" "\\/\\$" NOMATCH NOESCAPE -C "/\\$" "\\/\\$" NOMATCH NOESCAPE -C "\\/\\$" "\\/\\$" 0 NOESCAPE - -# B.6 033(C) -C ".asd" ".*" 0 PERIOD -C "/.asd" "*" 0 PERIOD -C "/as/.df" "*/?*f" 0 PERIOD -C "..asd" ".[!a-z]*" 0 PERIOD - -# B.6 034(C) -C ".asd" "*" NOMATCH PERIOD -C ".asd" "?asd" NOMATCH PERIOD -C ".asd" "[!a-z]*" NOMATCH PERIOD - -# B.6 035(C) -C "/." "/." 0 PATHNAME|PERIOD -C "/.a./.b." "/.*/.*" 0 PATHNAME|PERIOD -C "/.a./.b." "/.??/.??" 0 PATHNAME|PERIOD - -# B.6 036(C) -C "/." "*" NOMATCH PATHNAME|PERIOD -C "/." "/*" NOMATCH PATHNAME|PERIOD -C "/." "/?" NOMATCH PATHNAME|PERIOD -C "/." "/[!a-z]" NOMATCH PATHNAME|PERIOD -C "/a./.b." "/*/*" NOMATCH PATHNAME|PERIOD -C "/a./.b." "/??/???" NOMATCH PATHNAME|PERIOD - -# Some home-grown tests. -C "foobar" "foo*[abc]z" NOMATCH -C "foobaz" "foo*[abc][xyz]" 0 -C "foobaz" "foo?*[abc][xyz]" 0 -C "foobaz" "foo?*[abc][x/yz]" 0 -C "foobaz" "foo?*[abc]/[xyz]" NOMATCH PATHNAME -C "a" "a/" NOMATCH PATHNAME -C "a/" "a" NOMATCH PATHNAME -C "//a" "/a" NOMATCH PATHNAME -C "/a" "//a" NOMATCH PATHNAME -C "az" "[a-]z" 0 -C "bz" "[ab-]z" 0 -C "cz" "[ab-]z" NOMATCH -C "-z" "[ab-]z" 0 -C "az" "[-a]z" 0 -C "bz" "[-ab]z" 0 -C "cz" "[-ab]z" NOMATCH -C "-z" "[-ab]z" 0 -C "\\" "[\\\\-a]" 0 -C "_" "[\\\\-a]" 0 -C "a" "[\\\\-a]" 0 -C "-" "[\\\\-a]" NOMATCH -C "\\" "[\\]-a]" NOMATCH -C "_" "[\\]-a]" 0 -C "a" "[\\]-a]" 0 -C "]" "[\\]-a]" 0 -C "-" "[\\]-a]" NOMATCH -C "\\" "[!\\\\-a]" NOMATCH -C "_" "[!\\\\-a]" NOMATCH -C "a" "[!\\\\-a]" NOMATCH -C "-" "[!\\\\-a]" 0 -C "!" "[\\!-]" 0 -C "-" "[\\!-]" 0 -C "\\" "[\\!-]" NOMATCH -C "Z" "[Z-\\\\]" 0 -C "[" "[Z-\\\\]" 0 -C "\\" "[Z-\\\\]" 0 -C "-" "[Z-\\\\]" NOMATCH -C "Z" "[Z-\\]]" 0 -C "[" "[Z-\\]]" 0 -C "\\" "[Z-\\]]" 0 -C "]" "[Z-\\]]" 0 -C "-" "[Z-\\]]" NOMATCH - -# Following are tests outside the scope of IEEE 2003.2 since they are using -# locales other than the C locale. The main focus of the tests is on the -# handling of ranges and the recognition of character (vs bytes). -de_DE.ISO-8859-1 "a" "[a-z]" 0 -de_DE.ISO-8859-1 "z" "[a-z]" 0 -de_DE.ISO-8859-1 "ä" "[a-z]" 0 -de_DE.ISO-8859-1 "ö" "[a-z]" 0 -de_DE.ISO-8859-1 "ü" "[a-z]" 0 -de_DE.ISO-8859-1 "A" "[a-z]" NOMATCH -de_DE.ISO-8859-1 "Z" "[a-z]" NOMATCH -de_DE.ISO-8859-1 "Ä" "[a-z]" NOMATCH -de_DE.ISO-8859-1 "Ö" "[a-z]" NOMATCH -de_DE.ISO-8859-1 "Ü" "[a-z]" NOMATCH -de_DE.ISO-8859-1 "a" "[A-Z]" NOMATCH -de_DE.ISO-8859-1 "z" "[A-Z]" NOMATCH -de_DE.ISO-8859-1 "ä" "[A-Z]" NOMATCH -de_DE.ISO-8859-1 "ö" "[A-Z]" NOMATCH -de_DE.ISO-8859-1 "ü" "[A-Z]" NOMATCH -de_DE.ISO-8859-1 "A" "[A-Z]" 0 -de_DE.ISO-8859-1 "Z" "[A-Z]" 0 -de_DE.ISO-8859-1 "Ä" "[A-Z]" 0 -de_DE.ISO-8859-1 "Ö" "[A-Z]" 0 -de_DE.ISO-8859-1 "Ü" "[A-Z]" 0 -de_DE.ISO-8859-1 "a" "[[:lower:]]" 0 -de_DE.ISO-8859-1 "z" "[[:lower:]]" 0 -de_DE.ISO-8859-1 "ä" "[[:lower:]]" 0 -de_DE.ISO-8859-1 "ö" "[[:lower:]]" 0 -de_DE.ISO-8859-1 "ü" "[[:lower:]]" 0 -de_DE.ISO-8859-1 "A" "[[:lower:]]" NOMATCH -de_DE.ISO-8859-1 "Z" "[[:lower:]]" NOMATCH -de_DE.ISO-8859-1 "Ä" "[[:lower:]]" NOMATCH -de_DE.ISO-8859-1 "Ö" "[[:lower:]]" NOMATCH -de_DE.ISO-8859-1 "Ü" "[[:lower:]]" NOMATCH -de_DE.ISO-8859-1 "a" "[[:upper:]]" NOMATCH -de_DE.ISO-8859-1 "z" "[[:upper:]]" NOMATCH -de_DE.ISO-8859-1 "ä" "[[:upper:]]" NOMATCH -de_DE.ISO-8859-1 "ö" "[[:upper:]]" NOMATCH -de_DE.ISO-8859-1 "ü" "[[:upper:]]" NOMATCH -de_DE.ISO-8859-1 "A" "[[:upper:]]" 0 -de_DE.ISO-8859-1 "Z" "[[:upper:]]" 0 -de_DE.ISO-8859-1 "Ä" "[[:upper:]]" 0 -de_DE.ISO-8859-1 "Ö" "[[:upper:]]" 0 -de_DE.ISO-8859-1 "Ü" "[[:upper:]]" 0 -de_DE.ISO-8859-1 "a" "[[:alpha:]]" 0 -de_DE.ISO-8859-1 "z" "[[:alpha:]]" 0 -de_DE.ISO-8859-1 "ä" "[[:alpha:]]" 0 -de_DE.ISO-8859-1 "ö" "[[:alpha:]]" 0 -de_DE.ISO-8859-1 "ü" "[[:alpha:]]" 0 -de_DE.ISO-8859-1 "A" "[[:alpha:]]" 0 -de_DE.ISO-8859-1 "Z" "[[:alpha:]]" 0 -de_DE.ISO-8859-1 "Ä" "[[:alpha:]]" 0 -de_DE.ISO-8859-1 "Ö" "[[:alpha:]]" 0 -de_DE.ISO-8859-1 "Ü" "[[:alpha:]]" 0 - -de_DE.ISO-8859-1 "a" "[[=a=]b]" 0 -de_DE.ISO-8859-1 "â" "[[=a=]b]" 0 -de_DE.ISO-8859-1 "à" "[[=a=]b]" 0 -de_DE.ISO-8859-1 "á" "[[=a=]b]" 0 -de_DE.ISO-8859-1 "ä" "[[=a=]b]" 0 -de_DE.ISO-8859-1 "b" "[[=a=]b]" 0 -de_DE.ISO-8859-1 "c" "[[=a=]b]" NOMATCH -de_DE.ISO-8859-1 "a" "[[=â=]b]" 0 -de_DE.ISO-8859-1 "â" "[[=â=]b]" 0 -de_DE.ISO-8859-1 "à" "[[=â=]b]" 0 -de_DE.ISO-8859-1 "á" "[[=â=]b]" 0 -de_DE.ISO-8859-1 "ä" "[[=â=]b]" 0 -de_DE.ISO-8859-1 "b" "[[=â=]b]" 0 -de_DE.ISO-8859-1 "c" "[[=â=]b]" NOMATCH -de_DE.ISO-8859-1 "a" "[[=à=]b]" 0 -de_DE.ISO-8859-1 "â" "[[=à=]b]" 0 -de_DE.ISO-8859-1 "à" "[[=à=]b]" 0 -de_DE.ISO-8859-1 "á" "[[=à=]b]" 0 -de_DE.ISO-8859-1 "ä" "[[=à=]b]" 0 -de_DE.ISO-8859-1 "b" "[[=à=]b]" 0 -de_DE.ISO-8859-1 "c" "[[=à=]b]" NOMATCH -de_DE.ISO-8859-1 "a" "[[=á=]b]" 0 -de_DE.ISO-8859-1 "â" "[[=á=]b]" 0 -de_DE.ISO-8859-1 "à" "[[=á=]b]" 0 -de_DE.ISO-8859-1 "á" "[[=á=]b]" 0 -de_DE.ISO-8859-1 "ä" "[[=á=]b]" 0 -de_DE.ISO-8859-1 "b" "[[=á=]b]" 0 -de_DE.ISO-8859-1 "c" "[[=á=]b]" NOMATCH -de_DE.ISO-8859-1 "a" "[[=ä=]b]" 0 -de_DE.ISO-8859-1 "â" "[[=ä=]b]" 0 -de_DE.ISO-8859-1 "à" "[[=ä=]b]" 0 -de_DE.ISO-8859-1 "á" "[[=ä=]b]" 0 -de_DE.ISO-8859-1 "ä" "[[=ä=]b]" 0 -de_DE.ISO-8859-1 "b" "[[=ä=]b]" 0 -de_DE.ISO-8859-1 "c" "[[=ä=]b]" NOMATCH - -de_DE.ISO-8859-1 "aa" "[[.a.]]a" 0 -de_DE.ISO-8859-1 "ba" "[[.a.]]a" NOMATCH - - -# And with a multibyte character set. -de_DE.UTF-8 "a" "[a-z]" 0 -de_DE.UTF-8 "z" "[a-z]" 0 -de_DE.UTF-8 "ä" "[a-z]" 0 -de_DE.UTF-8 "ö" "[a-z]" 0 -de_DE.UTF-8 "ü" "[a-z]" 0 -de_DE.UTF-8 "A" "[a-z]" NOMATCH -de_DE.UTF-8 "Z" "[a-z]" NOMATCH -de_DE.UTF-8 "Ä" "[a-z]" NOMATCH -de_DE.UTF-8 "Ö" "[a-z]" NOMATCH -de_DE.UTF-8 "Ü" "[a-z]" NOMATCH -de_DE.UTF-8 "a" "[A-Z]" NOMATCH -de_DE.UTF-8 "z" "[A-Z]" NOMATCH -de_DE.UTF-8 "ä" "[A-Z]" NOMATCH -de_DE.UTF-8 "ö" "[A-Z]" NOMATCH -de_DE.UTF-8 "ü" "[A-Z]" NOMATCH -de_DE.UTF-8 "A" "[A-Z]" 0 -de_DE.UTF-8 "Z" "[A-Z]" 0 -de_DE.UTF-8 "Ä" "[A-Z]" 0 -de_DE.UTF-8 "Ö" "[A-Z]" 0 -de_DE.UTF-8 "Ü" "[A-Z]" 0 -de_DE.UTF-8 "a" "[[:lower:]]" 0 -de_DE.UTF-8 "z" "[[:lower:]]" 0 -de_DE.UTF-8 "ä" "[[:lower:]]" 0 -de_DE.UTF-8 "ö" "[[:lower:]]" 0 -de_DE.UTF-8 "ü" "[[:lower:]]" 0 -de_DE.UTF-8 "A" "[[:lower:]]" NOMATCH -de_DE.UTF-8 "Z" "[[:lower:]]" NOMATCH -de_DE.UTF-8 "Ä" "[[:lower:]]" NOMATCH -de_DE.UTF-8 "Ö" "[[:lower:]]" NOMATCH -de_DE.UTF-8 "Ü" "[[:lower:]]" NOMATCH -de_DE.UTF-8 "a" "[[:upper:]]" NOMATCH -de_DE.UTF-8 "z" "[[:upper:]]" NOMATCH -de_DE.UTF-8 "ä" "[[:upper:]]" NOMATCH -de_DE.UTF-8 "ö" "[[:upper:]]" NOMATCH -de_DE.UTF-8 "ü" "[[:upper:]]" NOMATCH -de_DE.UTF-8 "A" "[[:upper:]]" 0 -de_DE.UTF-8 "Z" "[[:upper:]]" 0 -de_DE.UTF-8 "Ä" "[[:upper:]]" 0 -de_DE.UTF-8 "Ö" "[[:upper:]]" 0 -de_DE.UTF-8 "Ü" "[[:upper:]]" 0 -de_DE.UTF-8 "a" "[[:alpha:]]" 0 -de_DE.UTF-8 "z" "[[:alpha:]]" 0 -de_DE.UTF-8 "ä" "[[:alpha:]]" 0 -de_DE.UTF-8 "ö" "[[:alpha:]]" 0 -de_DE.UTF-8 "ü" "[[:alpha:]]" 0 -de_DE.UTF-8 "A" "[[:alpha:]]" 0 -de_DE.UTF-8 "Z" "[[:alpha:]]" 0 -de_DE.UTF-8 "Ä" "[[:alpha:]]" 0 -de_DE.UTF-8 "Ö" "[[:alpha:]]" 0 -de_DE.UTF-8 "Ü" "[[:alpha:]]" 0 - -de_DE.UTF-8 "a" "[[=a=]b]" 0 -de_DE.UTF-8 "â" "[[=a=]b]" 0 -de_DE.UTF-8 "à" "[[=a=]b]" 0 -de_DE.UTF-8 "á" "[[=a=]b]" 0 -de_DE.UTF-8 "ä" "[[=a=]b]" 0 -de_DE.UTF-8 "b" "[[=a=]b]" 0 -de_DE.UTF-8 "c" "[[=a=]b]" NOMATCH -de_DE.UTF-8 "a" "[[=â=]b]" 0 -de_DE.UTF-8 "â" "[[=â=]b]" 0 -de_DE.UTF-8 "à" "[[=â=]b]" 0 -de_DE.UTF-8 "á" "[[=â=]b]" 0 -de_DE.UTF-8 "ä" "[[=â=]b]" 0 -de_DE.UTF-8 "b" "[[=â=]b]" 0 -de_DE.UTF-8 "c" "[[=â=]b]" NOMATCH -de_DE.UTF-8 "a" "[[=à=]b]" 0 -de_DE.UTF-8 "â" "[[=à=]b]" 0 -de_DE.UTF-8 "à" "[[=à=]b]" 0 -de_DE.UTF-8 "á" "[[=à=]b]" 0 -de_DE.UTF-8 "ä" "[[=à=]b]" 0 -de_DE.UTF-8 "b" "[[=à=]b]" 0 -de_DE.UTF-8 "c" "[[=à=]b]" NOMATCH -de_DE.UTF-8 "a" "[[=á=]b]" 0 -de_DE.UTF-8 "â" "[[=á=]b]" 0 -de_DE.UTF-8 "à" "[[=á=]b]" 0 -de_DE.UTF-8 "á" "[[=á=]b]" 0 -de_DE.UTF-8 "ä" "[[=á=]b]" 0 -de_DE.UTF-8 "b" "[[=á=]b]" 0 -de_DE.UTF-8 "c" "[[=á=]b]" NOMATCH -de_DE.UTF-8 "a" "[[=ä=]b]" 0 -de_DE.UTF-8 "â" "[[=ä=]b]" 0 -de_DE.UTF-8 "à" "[[=ä=]b]" 0 -de_DE.UTF-8 "á" "[[=ä=]b]" 0 -de_DE.UTF-8 "ä" "[[=ä=]b]" 0 -de_DE.UTF-8 "b" "[[=ä=]b]" 0 -de_DE.UTF-8 "c" "[[=ä=]b]" NOMATCH - -de_DE.UTF-8 "aa" "[[.a.]]a" 0 -de_DE.UTF-8 "ba" "[[.a.]]a" NOMATCH - - -# Test of GNU extensions. -C "x" "x" 0 PATHNAME|LEADING_DIR -C "x/y" "x" 0 PATHNAME|LEADING_DIR -C "x/y/z" "x" 0 PATHNAME|LEADING_DIR -C "x" "*" 0 PATHNAME|LEADING_DIR -C "x/y" "*" 0 PATHNAME|LEADING_DIR -C "x/y/z" "*" 0 PATHNAME|LEADING_DIR -C "x" "*x" 0 PATHNAME|LEADING_DIR -C "x/y" "*x" 0 PATHNAME|LEADING_DIR -C "x/y/z" "*x" 0 PATHNAME|LEADING_DIR -C "x" "x*" 0 PATHNAME|LEADING_DIR -C "x/y" "x*" 0 PATHNAME|LEADING_DIR -C "x/y/z" "x*" 0 PATHNAME|LEADING_DIR -C "x" "a" NOMATCH PATHNAME|LEADING_DIR -C "x/y" "a" NOMATCH PATHNAME|LEADING_DIR -C "x/y/z" "a" NOMATCH PATHNAME|LEADING_DIR -C "x" "x/y" NOMATCH PATHNAME|LEADING_DIR -C "x/y" "x/y" 0 PATHNAME|LEADING_DIR -C "x/y/z" "x/y" 0 PATHNAME|LEADING_DIR -C "x" "x?y" NOMATCH PATHNAME|LEADING_DIR -C "x/y" "x?y" NOMATCH PATHNAME|LEADING_DIR -C "x/y/z" "x?y" NOMATCH PATHNAME|LEADING_DIR - -# ksh style matching. -C "abcd" "?@(a|b)*@(c)d" 0 EXTMATCH -C "/dev/udp/129.22.8.102/45" "/dev/@(tcp|udp)/*/*" 0 PATHNAME|EXTMATCH -C "12" "[1-9]*([0-9])" 0 EXTMATCH -C "12abc" "[1-9]*([0-9])" NOMATCH EXTMATCH -C "1" "[1-9]*([0-9])" 0 EXTMATCH -C "07" "+([0-7])" 0 EXTMATCH -C "0377" "+([0-7])" 0 EXTMATCH -C "09" "+([0-7])" NOMATCH EXTMATCH -C "paragraph" "para@(chute|graph)" 0 EXTMATCH -C "paramour" "para@(chute|graph)" NOMATCH EXTMATCH -C "para991" "para?([345]|99)1" 0 EXTMATCH -C "para381" "para?([345]|99)1" NOMATCH EXTMATCH -C "paragraph" "para*([0-9])" NOMATCH EXTMATCH -C "para" "para*([0-9])" 0 EXTMATCH -C "para13829383746592" "para*([0-9])" 0 EXTMATCH -C "paragraph" "para+([0-9])" NOMATCH EXTMATCH -C "para" "para+([0-9])" NOMATCH EXTMATCH -C "para987346523" "para+([0-9])" 0 EXTMATCH -C "paragraph" "para!(*.[0-9])" 0 EXTMATCH -C "para.38" "para!(*.[0-9])" 0 EXTMATCH -C "para.graph" "para!(*.[0-9])" 0 EXTMATCH -C "para39" "para!(*.[0-9])" 0 EXTMATCH -C "" "*(0|1|3|5|7|9)" 0 EXTMATCH -C "137577991" "*(0|1|3|5|7|9)" 0 EXTMATCH -C "2468" "*(0|1|3|5|7|9)" NOMATCH EXTMATCH -C "1358" "*(0|1|3|5|7|9)" NOMATCH EXTMATCH -C "file.c" "*.c?(c)" 0 EXTMATCH -C "file.C" "*.c?(c)" NOMATCH EXTMATCH -C "file.cc" "*.c?(c)" 0 EXTMATCH -C "file.ccc" "*.c?(c)" NOMATCH EXTMATCH -C "parse.y" "!(*.c|*.h|Makefile.in|config*|README)" 0 EXTMATCH -C "shell.c" "!(*.c|*.h|Makefile.in|config*|README)" NOMATCH EXTMATCH -C "Makefile" "!(*.c|*.h|Makefile.in|config*|README)" 0 EXTMATCH -C "VMS.FILE;1" "*\;[1-9]*([0-9])" 0 EXTMATCH -C "VMS.FILE;0" "*\;[1-9]*([0-9])" NOMATCH EXTMATCH -C "VMS.FILE;" "*\;[1-9]*([0-9])" NOMATCH EXTMATCH -C "VMS.FILE;139" "*\;[1-9]*([0-9])" 0 EXTMATCH -C "VMS.FILE;1N" "*\;[1-9]*([0-9])" NOMATCH EXTMATCH -C "abcfefg" "ab**(e|f)" 0 EXTMATCH -C "abcfefg" "ab**(e|f)g" 0 EXTMATCH -C "ab" "ab*+(e|f)" NOMATCH EXTMATCH -C "abef" "ab***ef" 0 EXTMATCH -C "abef" "ab**" 0 EXTMATCH -C "fofo" "*(f*(o))" 0 EXTMATCH -C "ffo" "*(f*(o))" 0 EXTMATCH -C "foooofo" "*(f*(o))" 0 EXTMATCH -C "foooofof" "*(f*(o))" 0 EXTMATCH -C "fooofoofofooo" "*(f*(o))" 0 EXTMATCH -C "foooofof" "*(f+(o))" NOMATCH EXTMATCH -C "xfoooofof" "*(f*(o))" NOMATCH EXTMATCH -C "foooofofx" "*(f*(o))" NOMATCH EXTMATCH -C "ofxoofxo" "*(*(of*(o)x)o)" 0 EXTMATCH -C "ofooofoofofooo" "*(f*(o))" NOMATCH EXTMATCH -C "foooxfooxfoxfooox" "*(f*(o)x)" 0 EXTMATCH -C "foooxfooxofoxfooox" "*(f*(o)x)" NOMATCH EXTMATCH -C "foooxfooxfxfooox" "*(f*(o)x)" 0 EXTMATCH -C "ofxoofxo" "*(*(of*(o)x)o)" 0 EXTMATCH -C "ofoooxoofxo" "*(*(of*(o)x)o)" 0 EXTMATCH -C "ofoooxoofxoofoooxoofxo" "*(*(of*(o)x)o)" 0 EXTMATCH -C "ofoooxoofxoofoooxoofxoo" "*(*(of*(o)x)o)" 0 EXTMATCH -C "ofoooxoofxoofoooxoofxofo" "*(*(of*(o)x)o)" NOMATCH EXTMATCH -C "ofoooxoofxoofoooxoofxooofxofxo" "*(*(of*(o)x)o)" 0 EXTMATCH -C "aac" "*(@(a))a@(c)" 0 EXTMATCH -C "ac" "*(@(a))a@(c)" 0 EXTMATCH -C "c" "*(@(a))a@(c)" NOMATCH EXTMATCH -C "aaac" "*(@(a))a@(c)" 0 EXTMATCH -C "baaac" "*(@(a))a@(c)" NOMATCH EXTMATCH -C "abcd" "?@(a|b)*@(c)d" 0 EXTMATCH -C "abcd" "@(ab|a*@(b))*(c)d" 0 EXTMATCH -C "acd" "@(ab|a*(b))*(c)d" 0 EXTMATCH -C "abbcd" "@(ab|a*(b))*(c)d" 0 EXTMATCH -C "effgz" "@(b+(c)d|e*(f)g?|?(h)i@(j|k))" 0 EXTMATCH -C "efgz" "@(b+(c)d|e*(f)g?|?(h)i@(j|k))" 0 EXTMATCH -C "egz" "@(b+(c)d|e*(f)g?|?(h)i@(j|k))" 0 EXTMATCH -C "egzefffgzbcdij" "*(b+(c)d|e*(f)g?|?(h)i@(j|k))" 0 EXTMATCH -C "egz" "@(b+(c)d|e+(f)g?|?(h)i@(j|k))" NOMATCH EXTMATCH -C "ofoofo" "*(of+(o))" 0 EXTMATCH -C "oxfoxoxfox" "*(oxf+(ox))" 0 EXTMATCH -C "oxfoxfox" "*(oxf+(ox))" NOMATCH EXTMATCH -C "ofoofo" "*(of+(o)|f)" 0 EXTMATCH -C "foofoofo" "@(foo|f|fo)*(f|of+(o))" 0 EXTMATCH -C "oofooofo" "*(of|oof+(o))" 0 EXTMATCH -C "fffooofoooooffoofffooofff" "*(*(f)*(o))" 0 EXTMATCH -C "fofoofoofofoo" "*(fo|foo)" 0 EXTMATCH -C "foo" "!(x)" 0 EXTMATCH -C "foo" "!(x)*" 0 EXTMATCH -C "foo" "!(foo)" NOMATCH EXTMATCH -C "foo" "!(foo)*" 0 EXTMATCH -C "foobar" "!(foo)" 0 EXTMATCH -C "foobar" "!(foo)*" 0 EXTMATCH -C "moo.cow" "!(*.*).!(*.*)" 0 EXTMATCH -C "mad.moo.cow" "!(*.*).!(*.*)" NOMATCH EXTMATCH -C "mucca.pazza" "mu!(*(c))?.pa!(*(z))?" NOMATCH EXTMATCH -C "fff" "!(f)" 0 EXTMATCH -C "fff" "*(!(f))" 0 EXTMATCH -C "fff" "+(!(f))" 0 EXTMATCH -C "ooo" "!(f)" 0 EXTMATCH -C "ooo" "*(!(f))" 0 EXTMATCH -C "ooo" "+(!(f))" 0 EXTMATCH -C "foo" "!(f)" 0 EXTMATCH -C "foo" "*(!(f))" 0 EXTMATCH -C "foo" "+(!(f))" 0 EXTMATCH -C "f" "!(f)" NOMATCH EXTMATCH -C "f" "*(!(f))" NOMATCH EXTMATCH -C "f" "+(!(f))" NOMATCH EXTMATCH -C "foot" "@(!(z*)|*x)" 0 EXTMATCH -C "zoot" "@(!(z*)|*x)" NOMATCH EXTMATCH -C "foox" "@(!(z*)|*x)" 0 EXTMATCH -C "zoox" "@(!(z*)|*x)" 0 EXTMATCH -C "foo" "*(!(foo)) 0 EXTMATCH -C "foob" "!(foo)b*" NOMATCH EXTMATCH -C "foobb" "!(foo)b*" 0 EXTMATCH -C "[" "*([a[])" 0 EXTMATCH -C "]" "*([]a[])" 0 EXTMATCH -C "a" "*([]a[])" 0 EXTMATCH -C "b" "*([!]a[])" 0 EXTMATCH -C "[" "*([!]a[]|[[])" 0 EXTMATCH -C "]" "*([!]a[]|[]])" 0 EXTMATCH -C "[" "!([!]a[])" 0 EXTMATCH -C "]" "!([!]a[])" 0 EXTMATCH -C ")" "*([)])" 0 EXTMATCH -C "*" "*([*(])" 0 EXTMATCH -C "abcd" "*!(|a)cd" 0 EXTMATCH -C "ab/.a" "+([abc])/*" NOMATCH EXTMATCH|PATHNAME|PERIOD -C "" "" 0 -C "" "" 0 EXTMATCH -C "" "*([abc])" 0 EXTMATCH -C "" "?([abc])" 0 EXTMATCH diff --git a/test/misc/tst-gnuglob.c b/test/misc/tst-gnuglob.c deleted file mode 100644 index 53bc0cff2..000000000 --- a/test/misc/tst-gnuglob.c +++ /dev/null @@ -1,446 +0,0 @@ -/* Test the GNU extensions in glob which allow the user to provide callbacks - for the filesystem access functions. - Copyright (C) 2001-2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2001. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see -