forked from Imagelibrary/rtems
psxhdrs: Add POSIX API Signature Compliance Tests for fcntl.h (GCI 2018)
This commit is contained in:
39
testsuites/psxtests/psxhdrs/fcntl/creat.c
Normal file
39
testsuites/psxtests/psxhdrs/fcntl/creat.c
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @brief creat() API Conformance Test
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* COPYRIGHT (c) 2018.
|
||||||
|
* Zenon (zehata).
|
||||||
|
*
|
||||||
|
* 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 <sys/stat.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
int test(void);
|
||||||
|
|
||||||
|
int test(void){
|
||||||
|
char cc;
|
||||||
|
mode_t mt;
|
||||||
|
|
||||||
|
cc = 0;
|
||||||
|
const char *p = &cc;
|
||||||
|
mt = 0;
|
||||||
|
return creat(p, mt);
|
||||||
|
}
|
||||||
36
testsuites/psxtests/psxhdrs/fcntl/fcntl.c
Normal file
36
testsuites/psxtests/psxhdrs/fcntl/fcntl.c
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @brief fcntl() API Conformance Test
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* COPYRIGHT (c) 2018.
|
||||||
|
* Zenon (zehata).
|
||||||
|
*
|
||||||
|
* 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 <fcntl.h>
|
||||||
|
|
||||||
|
int test(void);
|
||||||
|
|
||||||
|
int test(void){
|
||||||
|
int i0, i1;
|
||||||
|
|
||||||
|
i0 = 0;
|
||||||
|
i1 = 0;
|
||||||
|
return fcntl(i0, i1);
|
||||||
|
}
|
||||||
38
testsuites/psxtests/psxhdrs/fcntl/open.c
Normal file
38
testsuites/psxtests/psxhdrs/fcntl/open.c
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @brief open() API Conformance Test
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* COPYRIGHT (c) 2018.
|
||||||
|
* Zenon (zehata).
|
||||||
|
*
|
||||||
|
* 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 <fcntl.h>
|
||||||
|
|
||||||
|
int test(void);
|
||||||
|
|
||||||
|
int test(void){
|
||||||
|
int i;
|
||||||
|
char c;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
c = 0;
|
||||||
|
const char *cc = &c;
|
||||||
|
return open(cc, i);
|
||||||
|
}
|
||||||
38
testsuites/psxtests/psxhdrs/fcntl/openat.c
Normal file
38
testsuites/psxtests/psxhdrs/fcntl/openat.c
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @brief openat() API Conformance Test
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* COPYRIGHT (c) 2018.
|
||||||
|
* Zenon (zehata).
|
||||||
|
*
|
||||||
|
* 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 <fcntl.h>
|
||||||
|
|
||||||
|
int test(void);
|
||||||
|
|
||||||
|
int test(void){
|
||||||
|
int i0, i1;
|
||||||
|
char c;
|
||||||
|
|
||||||
|
i0 = 0;
|
||||||
|
i1 = 0;
|
||||||
|
const char *cc = &c;
|
||||||
|
return openat(i0, cc, i1);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user