diff options
author | ABR290B <abhimanyuraghuvanshi29@gmail.com> | 2018-12-06 09:38:31 +0530 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2018-12-05 22:47:20 -0600 |
commit | bf135a97a11d7ec36e9fcfd646972c7d2d2b8a6c (patch) | |
tree | fb843f320c3903203f356d62de1a59eaecc2c14c /testsuites | |
parent | Added POSIX Compliance Test for complex.h, and adding lines to define CYGWIN ... (diff) | |
download | rtems-bf135a97a11d7ec36e9fcfd646972c7d2d2b8a6c.tar.bz2 |
POSIX Compliance Signature Test for glob.h (GCI 2018)
Diffstat (limited to '')
-rw-r--r-- | testsuites/psxtests/Makefile.am | 2 | ||||
-rw-r--r-- | testsuites/psxtests/psxhdrs/glob/glob.c | 42 | ||||
-rw-r--r-- | testsuites/psxtests/psxhdrs/glob/globfree.c | 37 |
3 files changed, 81 insertions, 0 deletions
diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am index 79eb6269a4..4186bd83c7 100644 --- a/testsuites/psxtests/Makefile.am +++ b/testsuites/psxtests/Makefile.am @@ -1093,6 +1093,8 @@ lib_a_SOURCES = psxhdrs/devctl/posix_devctl.c \ psxhdrs/dirent/scandir.c \ psxhdrs/dirent/seekdir.c \ psxhdrs/dirent/telldir.c \ + psxhdrs/glob/glob.c \ + psxhdrs/glob/globfree.c \ psxhdrs/mqueue/mq_open.c \ psxhdrs/mqueue/mq_close.c \ psxhdrs/mqueue/mq_getattr.c \ diff --git a/testsuites/psxtests/psxhdrs/glob/glob.c b/testsuites/psxtests/psxhdrs/glob/glob.c new file mode 100644 index 0000000000..d97ecf86ec --- /dev/null +++ b/testsuites/psxtests/psxhdrs/glob/glob.c @@ -0,0 +1,42 @@ +/** + * @file + * @brief glob() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Abhimanyu Raghuvanshi + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <glob.h> + +int test(void); + +static int errfunc (const char *epath, int eerrno) +{ + return 0; +} + +int test(void) +{ + const char *a = "string"; + int b = 0; + glob_t e; + + return glob(a, b, errfunc, &e); +} diff --git a/testsuites/psxtests/psxhdrs/glob/globfree.c b/testsuites/psxtests/psxhdrs/glob/globfree.c new file mode 100644 index 0000000000..7da3520ae0 --- /dev/null +++ b/testsuites/psxtests/psxhdrs/glob/globfree.c @@ -0,0 +1,37 @@ +/** + * @file + * @brief globfree() API Conformance Test + */ + +/* + * COPYRIGHT (c) 2018. + * Abhimanyu Raghuvanshi + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <glob.h> + +int test(void); + +int test(void) +{ + glob_t a; + + globfree(&a); + + return 0; +} |