source: rtems/testsuites/psxtests/psxhdrs/c11/uchar/c32rtomb.c @ add0b6a3

5
Last change on this file since add0b6a3 was add0b6a3, checked in by Marçal Comajoan Cara <mcomajoancara@…>, on 12/07/18 at 17:59:38

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.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/**
2 *  @file
3 *  @brief c32rtomb() API Conformance Test. This is a C11 method.
4 */
5
6/*
7 *  COPYRIGHT (c) 2018.
8 *  Marçal Comajoan Cara
9 *
10 *  Permission to use, copy, modify, and/or distribute this software
11 *  for any purpose with or without fee is hereby granted.
12 *
13 *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
14 *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
15 *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
16 *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
17 *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18 *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19 *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 */
21
22#ifdef HAVE_CONFIG_H
23#include "config.h"
24#endif
25
26#include <uchar.h>
27#include <stdlib.h>
28
29int test( void );
30
31int test( void )
32{
33  char32_t* c32_str = U"Mar\u00E7al";
34  char out[MB_CUR_MAX];
35  mbstate_t mbs;
36  int result;
37
38  result = c32rtomb( out, *c32_str, &mbs );
39
40  return result;
41}
Note: See TracBrowser for help on using the repository browser.