Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Macros | Functions | Variables
21.string.cons.mt.cpp File Reference
#include <string>
#include <cstddef>
#include <rw_driver.h>
#include <rw_thread.h>
#include <rw_valcmp.h>
Include dependency graph for 21.string.cons.mt.cpp:

Go to the source code of this file.

Macros

#define MAX_THREADS   32
 
#define MAX_LOOPS   100000
 

Functions

template<class T >
void test_string_cons (const T *const *pdata, const std::basic_string< T > *pshared, std::size_t threadno)
 
int main (int argc, char *argv[])
 

Variables

const char *const data []
 
const std::size_t nstrings = sizeof data / sizeof *data
 
const std::string shared [nstrings]
 
const wchar_t *const wdata []
 
const std::wstring wshared [nstrings]
 
int rw_opt_nthreads = 1
 
int rw_opt_nloops = MAX_LOOPS
 
bool test_wstring
 

Macro Definition Documentation

◆ MAX_LOOPS

#define MAX_LOOPS   100000

Definition at line 41 of file 21.string.cons.mt.cpp.

◆ MAX_THREADS

#define MAX_THREADS   32

21.string.cons.mt.cpp:

Test exercising the thread safety of basic_string constructors and assignment operators.

$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 21.string.cons.mt.cpp.

Function Documentation

◆ main()

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

Definition at line 251 of file 21.string.cons.mt.cpp.

◆ test_string_cons()

template<class T >
void test_string_cons ( const T *const *  pdata,
const std::basic_string< T > *  pshared,
std::size_t  threadno 
)

Definition at line 102 of file 21.string.cons.mt.cpp.

Variable Documentation

◆ data

const char* const data[]
Initial value:
= {
"",
"a",
"bc",
"cde",
"defg",
"efghi",
"fghijk",
"ghijklm"
}

Definition at line 44 of file 21.string.cons.mt.cpp.

◆ nstrings

const std::size_t nstrings = sizeof data / sizeof *data

Definition at line 56 of file 21.string.cons.mt.cpp.

◆ rw_opt_nloops

int rw_opt_nloops = MAX_LOOPS

Definition at line 97 of file 21.string.cons.mt.cpp.

◆ rw_opt_nthreads

int rw_opt_nthreads = 1

Definition at line 93 of file 21.string.cons.mt.cpp.

◆ shared

const std::string shared[nstrings]
Initial value:
= {
data [0], data [1], data [2], data [3],
data [4], data [5], data [6], data [7]
}
const char *const data[]

Definition at line 59 of file 21.string.cons.mt.cpp.

◆ test_wstring

bool test_wstring

Definition at line 157 of file 21.string.cons.mt.cpp.

◆ wdata

const wchar_t* const wdata[]
Initial value:
= {
L"",
L"a",
L"bc",
L"cde",
L"defg",
L"efghi",
L"fghijk",
L"ghijklm"
}

Definition at line 68 of file 21.string.cons.mt.cpp.

◆ wshared

const std::wstring wshared[nstrings]
Initial value:
= {
wdata [0], wdata [1], wdata [2], wdata [3],
wdata [4], wdata [5], wdata [6], wdata [7]
}
const wchar_t *const wdata[]

Definition at line 80 of file 21.string.cons.mt.cpp.