Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Macros | Typedefs | Enumerations | Functions | Variables
22.locale.globals.mt.cpp File Reference
#include <locale>
#include <cwchar>
#include <cstring>
#include <rw_locale.h>
#include <rw_thread.h>
#include <rw_driver.h>
Include dependency graph for 22.locale.globals.mt.cpp:

Go to the source code of this file.

Macros

#define MAX_THREADS   16
 
#define HAS(Facet, opt)    (0 <= opt_facets [opt_inx_ ## opt] ? std::has_facet<Facet>(loc) : true)
 
#define HAS_BYNAME(Facet, opt)
 
#define USE(Facet, opt)    (0 <= opt_facets [opt_inx_ ## opt] ? &std::use_facet<Facet>(loc) : dummy)
 
#define TEST_USE_FACET(Facet, opt)
 

Typedefs

typedef std::codecvt< char, char, std::mbstate_t > Codecvt
 
typedef std::collate< char > Collate
 
typedef std::ctype< char > Ctype
 
typedef std::messages< char > Messages
 
typedef std::moneypunct< char, false > Moneypunct0
 
typedef std::moneypunct< char, true > Moneypunct1
 
typedef std::numpunct< char > Numpunct
 
typedef std::money_get< char > MoneyGet
 
typedef std::money_put< char > MoneyPut
 
typedef std::num_get< char > NumGet
 
typedef std::num_put< char > NumPut
 
typedef std::time_get< char > TimeGet
 
typedef std::time_put< char > TimePut
 
typedef std::collate_byname< char > CollateByname
 
typedef std::ctype_byname< char > CtypeByname
 
typedef std::codecvt_byname< char, char, std::mbstate_t > CodecvtByname
 
typedef std::messages_byname< char > MessagesByname
 
typedef std::moneypunct_byname< char, false > Moneypunct0Byname
 
typedef std::moneypunct_byname< char, true > Moneypunct1Byname
 
typedef std::numpunct_byname< char > NumpunctByname
 
typedef std::time_get_byname< char > TimeGetByname
 
typedef std::time_put_byname< char > TimePutByname
 
typedef std::collate< wchar_t > WCollate
 
typedef std::ctype< wchar_t > WCtype
 
typedef std::codecvt< wchar_t, char, std::mbstate_t > WCodecvt
 
typedef std::messages< wchar_t > WMessages
 
typedef std::moneypunct< wchar_t, false > WMoneypunct0
 
typedef std::moneypunct< wchar_t, true > WMoneypunct1
 
typedef std::numpunct< wchar_t > WNumpunct
 
typedef std::money_get< wchar_t > WMoneyGet
 
typedef std::money_put< wchar_t > WMoneyPut
 
typedef std::num_get< wchar_t > WNumGet
 
typedef std::num_put< wchar_t > WNumPut
 
typedef std::time_get< wchar_t > WTimeGet
 
typedef std::time_put< wchar_t > WTimePut
 
typedef std::collate_byname< wchar_t > WCollateByname
 
typedef std::ctype_byname< wchar_t > WCtypeByname
 
typedef std::codecvt_byname< wchar_t, char, std::mbstate_t > WCodecvtByname
 
typedef std::messages_byname< wchar_t > WMessagesByname
 
typedef std::moneypunct_byname< wchar_t, false > WMoneypunct0Byname
 
typedef std::moneypunct_byname< wchar_t, true > WMoneypunct1Byname
 
typedef std::numpunct_byname< wchar_t > WNumpunctByname
 
typedef std::time_get_byname< wchar_t > WTimeGetByname
 
typedef std::time_put_byname< wchar_t > WTimePutByname
 

Enumerations

enum  {
  opt_inx_codecvt , opt_inx_collate , opt_inx_ctype , opt_inx_messages ,
  opt_inx_moneypunct , opt_inx_moneypunct_intl , opt_inx_numpunct , opt_inx_money_get ,
  opt_inx_money_put , opt_inx_num_get , opt_inx_num_put , opt_inx_time_get ,
  opt_inx_time_put , opt_nfacets
}
 

Functions

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

Variables

int opt_nthreads = 1
 
int opt_nloops = 20000
 
int opt_facets [opt_nfacets]
 
int opt_no_exceptions
 
int opt_timeout = 60
 
int opt_has_facet
 
int opt_use_facet
 

Macro Definition Documentation

◆ HAS

#define HAS (   Facet,
  opt 
)     (0 <= opt_facets [opt_inx_ ## opt] ? std::has_facet<Facet>(loc) : true)

◆ HAS_BYNAME

#define HAS_BYNAME (   Facet,
  opt 
)
Value:
(0 <= opt_facets [opt_inx_ ## opt] ? \
byname == std::has_facet<Facet>(loc) : true)
#define loc
Definition 17.names.cpp:492
int opt_facets[opt_nfacets]
#define true
Definition stdbool.h:25

◆ MAX_THREADS

#define MAX_THREADS   16

22.locale.globals.mt.cpp

test exercising the thread safety of [locale.global.templates]

$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 40 of file 22.locale.globals.mt.cpp.

◆ TEST_USE_FACET

#define TEST_USE_FACET (   Facet,
  opt 
)
Value:
try { \
threw = false; \
if (0 <= opt_facets [opt_inx_ ## opt]) \
std::use_facet<Facet>(loc); \
} \
catch (...) { threw = true; } \
RW_ASSERT (threw || opt_facets [opt_inx_ ## opt] < 0)

◆ USE

#define USE (   Facet,
  opt 
)     (0 <= opt_facets [opt_inx_ ## opt] ? &std::use_facet<Facet>(loc) : dummy)

Typedef Documentation

◆ Codecvt

typedef std::codecvt<char, char, std::mbstate_t> Codecvt

Definition at line 92 of file 22.locale.globals.mt.cpp.

◆ CodecvtByname

typedef std::codecvt_byname<char, char, std::mbstate_t> CodecvtByname

Definition at line 108 of file 22.locale.globals.mt.cpp.

◆ Collate

typedef std::collate<char> Collate

Definition at line 93 of file 22.locale.globals.mt.cpp.

◆ CollateByname

typedef std::collate_byname<char> CollateByname

Definition at line 106 of file 22.locale.globals.mt.cpp.

◆ Ctype

typedef std::ctype<char> Ctype

Definition at line 94 of file 22.locale.globals.mt.cpp.

◆ CtypeByname

typedef std::ctype_byname<char> CtypeByname

Definition at line 107 of file 22.locale.globals.mt.cpp.

◆ Messages

typedef std::messages<char> Messages

Definition at line 95 of file 22.locale.globals.mt.cpp.

◆ MessagesByname

typedef std::messages_byname<char> MessagesByname

Definition at line 109 of file 22.locale.globals.mt.cpp.

◆ MoneyGet

typedef std::money_get<char> MoneyGet

Definition at line 99 of file 22.locale.globals.mt.cpp.

◆ Moneypunct0

typedef std::moneypunct<char, false> Moneypunct0

Definition at line 96 of file 22.locale.globals.mt.cpp.

◆ Moneypunct0Byname

typedef std::moneypunct_byname<char, false> Moneypunct0Byname

Definition at line 110 of file 22.locale.globals.mt.cpp.

◆ Moneypunct1

typedef std::moneypunct<char, true> Moneypunct1

Definition at line 97 of file 22.locale.globals.mt.cpp.

◆ Moneypunct1Byname

typedef std::moneypunct_byname<char, true> Moneypunct1Byname

Definition at line 111 of file 22.locale.globals.mt.cpp.

◆ MoneyPut

typedef std::money_put<char> MoneyPut

Definition at line 100 of file 22.locale.globals.mt.cpp.

◆ NumGet

typedef std::num_get<char> NumGet

Definition at line 101 of file 22.locale.globals.mt.cpp.

◆ Numpunct

typedef std::numpunct<char> Numpunct

Definition at line 98 of file 22.locale.globals.mt.cpp.

◆ NumpunctByname

typedef std::numpunct_byname<char> NumpunctByname

Definition at line 112 of file 22.locale.globals.mt.cpp.

◆ NumPut

typedef std::num_put<char> NumPut

Definition at line 102 of file 22.locale.globals.mt.cpp.

◆ TimeGet

typedef std::time_get<char> TimeGet

Definition at line 103 of file 22.locale.globals.mt.cpp.

◆ TimeGetByname

typedef std::time_get_byname<char> TimeGetByname

Definition at line 113 of file 22.locale.globals.mt.cpp.

◆ TimePut

typedef std::time_put<char> TimePut

Definition at line 104 of file 22.locale.globals.mt.cpp.

◆ TimePutByname

typedef std::time_put_byname<char> TimePutByname

Definition at line 114 of file 22.locale.globals.mt.cpp.

◆ WCodecvt

typedef std::codecvt<wchar_t, char, std::mbstate_t> WCodecvt

Definition at line 121 of file 22.locale.globals.mt.cpp.

◆ WCodecvtByname

typedef std::codecvt_byname<wchar_t, char, std::mbstate_t> WCodecvtByname

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

◆ WCollate

typedef std::collate<wchar_t> WCollate

Definition at line 119 of file 22.locale.globals.mt.cpp.

◆ WCollateByname

typedef std::collate_byname<wchar_t> WCollateByname

Definition at line 133 of file 22.locale.globals.mt.cpp.

◆ WCtype

typedef std::ctype<wchar_t> WCtype

Definition at line 120 of file 22.locale.globals.mt.cpp.

◆ WCtypeByname

typedef std::ctype_byname<wchar_t> WCtypeByname

Definition at line 134 of file 22.locale.globals.mt.cpp.

◆ WMessages

typedef std::messages<wchar_t> WMessages

Definition at line 122 of file 22.locale.globals.mt.cpp.

◆ WMessagesByname

typedef std::messages_byname<wchar_t> WMessagesByname

Definition at line 136 of file 22.locale.globals.mt.cpp.

◆ WMoneyGet

typedef std::money_get<wchar_t> WMoneyGet

Definition at line 126 of file 22.locale.globals.mt.cpp.

◆ WMoneypunct0

typedef std::moneypunct<wchar_t, false> WMoneypunct0

Definition at line 123 of file 22.locale.globals.mt.cpp.

◆ WMoneypunct0Byname

typedef std::moneypunct_byname<wchar_t, false> WMoneypunct0Byname

Definition at line 137 of file 22.locale.globals.mt.cpp.

◆ WMoneypunct1

typedef std::moneypunct<wchar_t, true> WMoneypunct1

Definition at line 124 of file 22.locale.globals.mt.cpp.

◆ WMoneypunct1Byname

typedef std::moneypunct_byname<wchar_t, true> WMoneypunct1Byname

Definition at line 138 of file 22.locale.globals.mt.cpp.

◆ WMoneyPut

typedef std::money_put<wchar_t> WMoneyPut

Definition at line 127 of file 22.locale.globals.mt.cpp.

◆ WNumGet

typedef std::num_get<wchar_t> WNumGet

Definition at line 128 of file 22.locale.globals.mt.cpp.

◆ WNumpunct

typedef std::numpunct<wchar_t> WNumpunct

Definition at line 125 of file 22.locale.globals.mt.cpp.

◆ WNumpunctByname

typedef std::numpunct_byname<wchar_t> WNumpunctByname

Definition at line 139 of file 22.locale.globals.mt.cpp.

◆ WNumPut

typedef std::num_put<wchar_t> WNumPut

Definition at line 129 of file 22.locale.globals.mt.cpp.

◆ WTimeGet

typedef std::time_get<wchar_t> WTimeGet

Definition at line 130 of file 22.locale.globals.mt.cpp.

◆ WTimeGetByname

typedef std::time_get_byname<wchar_t> WTimeGetByname

Definition at line 140 of file 22.locale.globals.mt.cpp.

◆ WTimePut

typedef std::time_put<wchar_t> WTimePut

Definition at line 131 of file 22.locale.globals.mt.cpp.

◆ WTimePutByname

typedef std::time_put_byname<wchar_t> WTimePutByname

Definition at line 141 of file 22.locale.globals.mt.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
opt_inx_codecvt 
opt_inx_collate 
opt_inx_ctype 
opt_inx_messages 
opt_inx_moneypunct 
opt_inx_moneypunct_intl 
opt_inx_numpunct 
opt_inx_money_get 
opt_inx_money_put 
opt_inx_num_get 
opt_inx_num_put 
opt_inx_time_get 
opt_inx_time_put 
opt_nfacets 

Definition at line 50 of file 22.locale.globals.mt.cpp.

Function Documentation

◆ main()

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

Definition at line 582 of file 22.locale.globals.mt.cpp.

Variable Documentation

◆ opt_facets

int opt_facets[opt_nfacets]

Definition at line 71 of file 22.locale.globals.mt.cpp.

◆ opt_has_facet

int opt_has_facet

Definition at line 424 of file 22.locale.globals.mt.cpp.

◆ opt_nloops

int opt_nloops = 20000

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

◆ opt_no_exceptions

int opt_no_exceptions

Definition at line 74 of file 22.locale.globals.mt.cpp.

◆ opt_nthreads

int opt_nthreads = 1

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

◆ opt_timeout

int opt_timeout = 60

Definition at line 77 of file 22.locale.globals.mt.cpp.

◆ opt_use_facet

int opt_use_facet

Definition at line 425 of file 22.locale.globals.mt.cpp.