mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-26 14:18:20 +00:00
Implement POSIX API Signature Compliance Tests for uchar.h
This header file is C11 and not currently supported by RTEMS. See #3643. This work was part of GCI 2018.
This commit is contained in:
committed by
Joel Sherrill
parent
f70079ca20
commit
add0b6a3f5
@@ -1612,6 +1612,10 @@ lib_a_SOURCES = psxhdrs/devctl/posix_devctl.c \
|
||||
## lib_a_SOURCES += psxhdrs/ucontext/makecontext.c See ticket #3640
|
||||
## lib_a_SOURCES += psxhdrs/ucontext/setcontext.c See ticket #3640
|
||||
## lib_a_SOURCES += psxhdrs/ucontext/swapcontext.c See ticket #3640
|
||||
## lib_a_SOURCES += psxhdrs/c11/uchar/c16rtomb.c See ticket #3643
|
||||
## lib_a_SOURCES += psxhdrs/c11/uchar/c32rtomb.c See ticket #3643
|
||||
## lib_a_SOURCES += psxhdrs/c11/uchar/c32rtomb.c See ticket #3643
|
||||
## lib_a_SOURCES += psxhdrs/c11/uchar/mbrtoc32.c See ticket #3643
|
||||
endif
|
||||
|
||||
rtems_tests_PROGRAMS = $(psx_tests)
|
||||
|
||||
41
testsuites/psxtests/psxhdrs/c11/uchar/c16rtomb.c
Normal file
41
testsuites/psxtests/psxhdrs/c11/uchar/c16rtomb.c
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief c16rtomb() API Conformance Test. This is a C11 method.
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPYRIGHT (c) 2018.
|
||||
* Marçal Comajoan Cara
|
||||
*
|
||||
* 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 <uchar.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int test( void );
|
||||
|
||||
int test( void )
|
||||
{
|
||||
char16_t* c16_str = u"Mar\u00E7al";
|
||||
char out[MB_CUR_MAX];
|
||||
mbstate_t mbs;
|
||||
int result;
|
||||
|
||||
result = c16rtomb( out, *c16_str, &mbs );
|
||||
|
||||
return result;
|
||||
}
|
||||
41
testsuites/psxtests/psxhdrs/c11/uchar/c32rtomb.c
Normal file
41
testsuites/psxtests/psxhdrs/c11/uchar/c32rtomb.c
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief c32rtomb() API Conformance Test. This is a C11 method.
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPYRIGHT (c) 2018.
|
||||
* Marçal Comajoan Cara
|
||||
*
|
||||
* 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 <uchar.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int test( void );
|
||||
|
||||
int test( void )
|
||||
{
|
||||
char32_t* c32_str = U"Mar\u00E7al";
|
||||
char out[MB_CUR_MAX];
|
||||
mbstate_t mbs;
|
||||
int result;
|
||||
|
||||
result = c32rtomb( out, *c32_str, &mbs );
|
||||
|
||||
return result;
|
||||
}
|
||||
41
testsuites/psxtests/psxhdrs/c11/uchar/mbrtoc16.c
Normal file
41
testsuites/psxtests/psxhdrs/c11/uchar/mbrtoc16.c
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief mbrtoc16() API Conformance Test. This is a C11 method.
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPYRIGHT (c) 2018.
|
||||
* Marçal Comajoan Cara
|
||||
*
|
||||
* 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 <uchar.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int test( void );
|
||||
|
||||
int test( void )
|
||||
{
|
||||
char16_t pc16;
|
||||
char* str = u8"Mar\u00E7al";
|
||||
mbstate_t mbs;
|
||||
int result;
|
||||
|
||||
result = mbrtoc16( &pc16, str, MB_CUR_MAX, &mbs );
|
||||
|
||||
return result;
|
||||
}
|
||||
41
testsuites/psxtests/psxhdrs/c11/uchar/mbrtoc32.c
Normal file
41
testsuites/psxtests/psxhdrs/c11/uchar/mbrtoc32.c
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief mbrtoc32() API Conformance Test. This is a C11 method.
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPYRIGHT (c) 2018.
|
||||
* Marçal Comajoan Cara
|
||||
*
|
||||
* 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 <uchar.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int test( void );
|
||||
|
||||
int test( void )
|
||||
{
|
||||
char32_t pc32;
|
||||
char* str = u8"Mar\u00E7al";
|
||||
mbstate_t mbs;
|
||||
int result;
|
||||
|
||||
result = mbrtoc32( &pc32, str, MB_CUR_MAX, &mbs );
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user