Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Data Structures | Macros | Functions | Variables
22.locale.codecvt.mt.cpp File Reference
#include <ios>
#include <iterator>
#include <locale>
#include <cstring>
#include <cwchar>
#include <rw_locale.h>
#include <rw_thread.h>
#include <rw_driver.h>
#include <rw_valcmp.h>
Include dependency graph for 22.locale.codecvt.mt.cpp:

Go to the source code of this file.

Data Structures

struct  MyCodecvtData_T< internT >
 
struct  MyCodecvtData
 
struct  MyBuffer< charT >
 
struct  test_is_char< T >
 
struct  test_is_char< char >
 

Macros

#define MAX_THREADS   32
 
#define MAX_LOOPS   100000
 

Functions

template<class internT >
void test_codecvt (const std::locale &loc, const MyBuffer< internT > &in, const MyBuffer< char > &out, const MyCodecvtData_T< internT > &data, const MyCodecvtData::CvtId id)
 
template<class internT >
void run_test_fill (const std::locale &loc, const MyBuffer< internT > &in, const MyBuffer< char > &out, MyCodecvtData_T< internT > &data)
 
int main (int argc, char *argv[])
 

Variables

int opt_nthreads = 1
 
int opt_nloops = 5000
 
int opt_nlocales = MAX_THREADS
 
int opt_shared_locale
 
int opt_timeout = 60
 
struct MyCodecvtData my_codecvt_data [MAX_THREADS]
 
const MyBuffer< char > nsrc []
 
const MyBuffer< wchar_t > wsrc []
 
bool test_char
 
bool test_wchar
 

Macro Definition Documentation

◆ MAX_LOOPS

#define MAX_LOOPS   100000

Definition at line 44 of file 22.locale.codecvt.mt.cpp.

◆ MAX_THREADS

#define MAX_THREADS   32

22.locale.codecvt.mt.cpp

test exercising the thread safety of the codecvt facet

$Id$

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition at line 43 of file 22.locale.codecvt.mt.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 547 of file 22.locale.codecvt.mt.cpp.

◆ run_test_fill()

template<class internT >
void run_test_fill ( const std::locale &  loc,
const MyBuffer< internT > &  in,
const MyBuffer< char > &  out,
MyCodecvtData_T< internT > &  data 
)

Definition at line 356 of file 22.locale.codecvt.mt.cpp.

◆ test_codecvt()

template<class internT >
void test_codecvt ( const std::locale &  loc,
const MyBuffer< internT > &  in,
const MyBuffer< char > &  out,
const MyCodecvtData_T< internT > &  data,
const MyCodecvtData::CvtId  id 
)

Definition at line 180 of file 22.locale.codecvt.mt.cpp.

Variable Documentation

◆ my_codecvt_data

struct MyCodecvtData my_codecvt_data[MAX_THREADS]

◆ nsrc

const MyBuffer<char> nsrc[]
Initial value:
= {
{ "a\x80", 2 },
{ "b", 1 },
{ "c\0c", 3 },
{ "ddd", 3 },
{ "e\fce\0", 4 },
{ "ff\0ffff", 5 },
{ "gggg\0g", 6 },
{ "hh\0hhhh", 7 },
{ "i\ni\tiiii", 8 },
{ "jjjjjjjjj", 9 },
{ "kkkkkkkkkk", 10 }
}

Definition at line 135 of file 22.locale.codecvt.mt.cpp.

◆ opt_nlocales

int opt_nlocales = MAX_THREADS

Definition at line 55 of file 22.locale.codecvt.mt.cpp.

◆ opt_nloops

int opt_nloops = 5000

Definition at line 52 of file 22.locale.codecvt.mt.cpp.

◆ opt_nthreads

int opt_nthreads = 1

Definition at line 48 of file 22.locale.codecvt.mt.cpp.

◆ opt_shared_locale

int opt_shared_locale

Definition at line 59 of file 22.locale.codecvt.mt.cpp.

◆ opt_timeout

int opt_timeout = 60

Definition at line 62 of file 22.locale.codecvt.mt.cpp.

◆ test_char

bool test_char

Definition at line 311 of file 22.locale.codecvt.mt.cpp.

◆ test_wchar

bool test_wchar

Definition at line 312 of file 22.locale.codecvt.mt.cpp.

◆ wsrc

const MyBuffer<wchar_t> wsrc[]
Initial value:
= {
{ L"\x0905\x0916", 2 },
{ L"bb", 2 },
{ L"\x106c", 2 },
{ L"dddd", 4 },
{ L"\xd800\xd801", 2 },
{ L"ffffff", 6 },
{ L"\xdfff\xffff", 2 },
{ L"hhhhhhhh", 8 },
{ L"i\0i\1i", 4 },
{ L"jjjjjjjjjj", 10 },
{ L"kkkkkkkkkkk", 11 }
}

Definition at line 149 of file 22.locale.codecvt.mt.cpp.