From bf135a97a11d7ec36e9fcfd646972c7d2d2b8a6c Mon Sep 17 00:00:00 2001 From: ABR290B Date: Thu, 6 Dec 2018 09:38:31 +0530 Subject: POSIX Compliance Signature Test for glob.h (GCI 2018) --- testsuites/psxtests/Makefile.am | 2 ++ testsuites/psxtests/psxhdrs/glob/glob.c | 42 +++++++++++++++++++++++++++++ testsuites/psxtests/psxhdrs/glob/globfree.c | 37 +++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 testsuites/psxtests/psxhdrs/glob/glob.c create mode 100644 testsuites/psxtests/psxhdrs/glob/globfree.c 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 + +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 + +int test(void); + +int test(void) +{ + glob_t a; + + globfree(&a); + + return 0; +} -- cgit v1.2.3