mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-26 14:18:20 +00:00
psxhdrs: Add POSIX API Signature Compliance Tests for ftw.h (GCI 2018)
This commit is contained in:
committed by
Joel Sherrill
parent
cbb08b6176
commit
95095bec50
@@ -1223,6 +1223,8 @@ lib_a_SOURCES = psxhdrs/devctl/posix_devctl.c \
|
||||
## lib_a_SOURCES += psxhdrs/ulimit/ulimit.c
|
||||
## lib_a_SOURCES += psxhdrs/monetary/strfmon.c
|
||||
## lib_a_SOURCES += psxhdrs/monetary/strfmon_l.c
|
||||
## lib_a_SOURCES += psxhdrs/ftw/ftw.c See ticket #2970
|
||||
## lib_a_SOURCES += psxhdrs/ftw/nftw.c See ticket #2970
|
||||
|
||||
## Specific issues that tickets are tracking
|
||||
## lib_a_SOURCES += psxhdrs/dirent/dirfd.c See ticket #3371
|
||||
|
||||
43
testsuites/psxtests/psxhdrs/ftw/ftw.c
Normal file
43
testsuites/psxtests/psxhdrs/ftw/ftw.c
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief ftw() API Conformance Test
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPYRIGHT (c) 2018.
|
||||
* Jacob Shin
|
||||
*
|
||||
* 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
|
||||
|
||||
#define _XOPEN_SOURCE 500
|
||||
#include <ftw.h>
|
||||
|
||||
int test( void );
|
||||
|
||||
static int fn(const char* str, const struct stat *ptr, int flag)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int main( void )
|
||||
{
|
||||
char *path = ".";
|
||||
int return_value;
|
||||
|
||||
return_value = ftw(path, fn, 1);
|
||||
return (return_value != -1);
|
||||
}
|
||||
48
testsuites/psxtests/psxhdrs/ftw/nftw.c
Normal file
48
testsuites/psxtests/psxhdrs/ftw/nftw.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief nftw() API Conformance Test
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPYRIGHT (c) 2018.
|
||||
* Jacob Shin
|
||||
*
|
||||
* 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
|
||||
|
||||
#define _XOPEN_SOURCE 500
|
||||
#include <ftw.h>
|
||||
|
||||
int test( void );
|
||||
|
||||
static int fn(
|
||||
const char *str,
|
||||
const struct stat *ptr,
|
||||
int flag,
|
||||
struct FTW *ftw
|
||||
)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int test( void )
|
||||
{
|
||||
char *path = ".";
|
||||
int return_value;
|
||||
|
||||
return_value = nftw(path, fn, 1, FTW_MOUNT);
|
||||
return (return_value != -1);
|
||||
}
|
||||
Reference in New Issue
Block a user