forked from Imagelibrary/rtems
POSIX Compliance Signature Test for glob.h (GCI 2018)
This commit is contained in:
@@ -1093,6 +1093,8 @@ lib_a_SOURCES = psxhdrs/devctl/posix_devctl.c \
|
|||||||
psxhdrs/dirent/scandir.c \
|
psxhdrs/dirent/scandir.c \
|
||||||
psxhdrs/dirent/seekdir.c \
|
psxhdrs/dirent/seekdir.c \
|
||||||
psxhdrs/dirent/telldir.c \
|
psxhdrs/dirent/telldir.c \
|
||||||
|
psxhdrs/glob/glob.c \
|
||||||
|
psxhdrs/glob/globfree.c \
|
||||||
psxhdrs/mqueue/mq_open.c \
|
psxhdrs/mqueue/mq_open.c \
|
||||||
psxhdrs/mqueue/mq_close.c \
|
psxhdrs/mqueue/mq_close.c \
|
||||||
psxhdrs/mqueue/mq_getattr.c \
|
psxhdrs/mqueue/mq_getattr.c \
|
||||||
|
|||||||
42
testsuites/psxtests/psxhdrs/glob/glob.c
Normal file
42
testsuites/psxtests/psxhdrs/glob/glob.c
Normal file
@@ -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);
|
||||||
|
}
|
||||||
37
testsuites/psxtests/psxhdrs/glob/globfree.c
Normal file
37
testsuites/psxtests/psxhdrs/glob/globfree.c
Normal file
@@ -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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user