4#define _GLIBCXX_FULLY_DYNAMIC_STRING
14#if !defined (STLPORT) || !defined (_STLP_USE_NO_IOSTREAMS)
18#if !defined (STLPORT) || defined (_STLP_USE_EXCEPTIONS)
22#if !defined (STLPORT) || defined (_STLP_THREADS)
23# if defined (STLPORT) && defined (_STLP_PTHREADS) || \
24 defined (__GNUC__) && !defined (__MINGW32__)
25# define USE_PTHREAD_API
29# if defined (STLPORT) && defined (_STLP_WIN32THREADS) || \
30 defined (__GNUC__) && defined (__MINGW32__) || \
32# define USE_WINDOWS_API
40#if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
68#if !defined (USE_PTHREAD_API) && !defined (USE_WINDOWS_API)
76#if defined (STLPORT) && ((defined (_STLP_MSVC) && (_STLP_MSVC < 1300)) || \
77 (defined(__GNUC__) && defined(_STLP_USE_TEMPLATE_EXPRESSION) && \
78 ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 1)) ) )
79# define TE_TMP_TEST_IGNORED
83#if defined (TE_TMP_TEST_IGNORED)
87#if defined (STLPORT) && defined (_STLP_NO_WCHAR_T)
90#if defined (__CYGWIN__) && !defined (STLPORT)
95#if defined (STLPORT) && defined (_STLP_USE_NO_IOSTREAMS)
100#if defined (STLPORT) && defined (_STLP_NO_CUSTOM_IO)
140 static string func(
const string& par) {
145#if defined (USE_PTHREAD_API) || defined (USE_WINDOWS_API)
146# if defined (USE_PTHREAD_API)
147 static void*
f(
void*)
152 string s(
"qyweyuewunfkHBUKGYUGL,wehbYGUW^(@T@H!BALWD:h^&@#*@(#:JKHWJ:CND" );
154 for (
int i = 0;
i < 2000000; ++
i ) {
155 string sx =
func(
s );
171#if !defined (STLPORT) || defined (_STLP_USE_EXCEPTIONS)
173 string s((
size_t)-1,
'a');
187 string s(
"message" );
196#if !defined (STLPORT) || defined (_STLP_USE_EXCEPTIONS)
198 s.reserve(
s.max_size() + 1);
212#if defined (USE_PTHREAD_API) || defined (USE_WINDOWS_API)
214# if defined (USE_PTHREAD_API)
217 for (
int i = 0;
i < nth; ++
i ) {
218 pthread_create( &
t[
i], 0,
f, 0 );
221 for (
int i = 0;
i < nth; ++
i ) {
222 pthread_join(
t[
i], 0 );
226# if defined (USE_WINDOWS_API)
232 for (
i = 0;
i < nth; ++
i ) {
239 for (
i = 0;
i < nth; ++
i ) {
256 string const ref_short_str1(
"str1"), ref_short_str2(
"str2");
257 string short_str1(ref_short_str1), short_str2(ref_short_str2);
258 string const ref_long_str1(
"str 1");
259 string const ref_long_str2(
"str 2");
260 string long_str1(ref_long_str1), long_str2(ref_long_str2);
266 string str1(short_str1);
272 string str1(long_str1);
278 short_str1.swap(short_str2);
279 CPPUNIT_ASSERT((short_str1 == ref_short_str2) && (short_str2 == ref_short_str1));
280 short_str1.swap(short_str2);
284 long_str1.swap(long_str2);
285 CPPUNIT_ASSERT((long_str1 == ref_long_str2) && (long_str2 == ref_long_str1));
286 long_str1.swap(long_str2);
290 short_str1.swap(long_str1);
291 CPPUNIT_ASSERT((short_str1 == ref_long_str1) && (long_str1 == ref_short_str1));
292 short_str1.swap(long_str1);
296 long_str1.swap(short_str1);
297 CPPUNIT_ASSERT((short_str1 == ref_long_str1) && (long_str1 == ref_short_str1));
298 long_str1.swap(short_str1);
304 const char* as =
a.c_str();
305 const char*
bs =
b.c_str();
313 vector<string> str_vect;
314 str_vect.push_back(short_str1);
315 str_vect.push_back(long_str1);
316 str_vect.push_back(short_str2);
317 str_vect.push_back(long_str2);
319 (str_vect[1] == ref_long_str1) &&
320 (str_vect[2] == ref_short_str2) &&
321 (str_vect[3] == ref_long_str2));
327 char const*
c_str =
"Hello, World!";
331 str.erase(
str.begin() + 1,
str.end() - 1);
334 for (
i = 0;
i <
str.size(); ++
i) {
357 str.erase(1,
str.size() - 1);
358 for (
i = 0;
i <
str.size();
i++) {
389 string low(
"2004-01-01" );
394 if (
strcmp(
xx.data(),
"1234562004-01-01" ) != 0 ) {
403 if (
strcmp(
xx.data(),
"1234;" ) != 0 ) {
412 string low(
"2004-01-01" );
435 const string s(
"123456" );
439#if !defined (STLPORT) || defined (_STLP_USE_EXCEPTIONS)
456 string strorg =
"This is test string for string calls";
467 str.insert(10,
str.c_str() + 5, 15);
471 str.insert(15,
str.c_str() + 5, 25);
472 CPPUNIT_ASSERT(
str ==
"This is test stis test string for stringring for string calls" );
475 str.insert(0,
str.c_str() +
str.size() - 4, 4);
479 str.insert(0,
str.c_str() +
str.size() / 2 - 1,
str.size() / 2 + 1);
480 CPPUNIT_ASSERT(
str ==
"ng for string callsThis is test string for string calls" );
483 string::iterator
b =
str.begin();
484 string::const_iterator
s =
str.begin() +
str.size() / 2 - 1;
485 string::const_iterator
e =
str.end();
487 CPPUNIT_ASSERT(
str ==
"ng for string callsThis is test string for string calls" );
491 CPPUNIT_ASSERT(
str ==
"ng for string callsThis is test string for string calls" );
493#ifdef _STLP_MEMBER_TEMPLATES
494 vector<int> int_vect;
496 str.insert(
str.end(), int_vect.begin(), int_vect.end());
500 str0.insert(str0.begin(), 5,
'0');
505 string::size_type
pos = 0, nb = 2;
506 str1.insert(
pos, nb,
'1');
510 str0.insert(0, str1);
514 str0.insert(str0.size(), str2, 1, 2);
517 str1.insert(str1.begin() + 1, 2,
'2');
520 str1.insert(2,
"333333", 3);
523 str1.insert(4,
"4444");
526 str1.insert(str1.begin() + 6,
'5');
537 const string v(
"78" );
538 string s(
"123456" );
539 string const&
cs =
s;
541 string::iterator
i =
s.begin() + 1;
542 s.replace(
i,
i + 3,
v.begin(),
v.end());
547 s.replace(
i,
i + 1,
v.begin(),
v.end());
552 string::const_iterator ci =
s.begin() + 1;
553 s.replace(
i,
i + 3, ci + 3,
cs.end());
559 s.replace(
i,
i + 3, ci, ci + 2);
565 s.replace(
i,
i + 3, ci + 1,
cs.end());
571 s.replace(
i,
i, ci, ci + 1);
575 s.replace(
s.begin() + 4,
s.end(),
cs.begin(),
cs.end());
582 string::iterator
b =
s.begin() + 4;
583 string::iterator
e =
s.end();
584 string::const_iterator rb =
s.begin();
585 string::const_iterator re =
s.end();
586 s.replace(
b,
e, rb, re);
590 s.replace(
s.begin() + 4,
s.end(),
s.begin(),
s.end());
593 string strorg(
"This is test string for string calls");
595 str.replace(5, 15,
str.c_str(), 10);
599 str.replace(5, 5,
str.c_str(), 10);
602#if (defined (STLPORT) && defined(_STLP_MEMBER_TEMPLATES)) || ( !defined (STLPORT) && !defined(__GNUC__) )
640 string s(
"one two three one two three");
647#if defined (STLPORT) && defined (_STLP_STATIC_CONST_INIT_BUG)
648 string::size_type
const&
npos_local = string::npos;
650# define npos_local string::npos
698 string::size_type
p =
s.find(
"", 0, 0 );
705 string::size_type
p =
s.find(
"", 0, 0 );
711 string::size_type
p =
s.find(
"", 1, 0 );
717 string::size_type
p =
s.find(
"", 1, 0 );
723 string::size_type
p =
s.find(
"", 3, 0 );
729 string::size_type
p =
s.rfind(
"", 0, 0 );
736 string::size_type
p =
s.rfind(
"", 0, 0 );
742 string::size_type
p =
s.rfind(
"", 1, 0 );
748 string::size_type
p =
s.rfind(
"", 1, 0 );
754 string::size_type
p =
s.rfind(
"", 3, 0 );
763 string s(
"one two three one two three");
770 string test(
"aba" );
784 string s(
"one two three one two three");
788 string test(
"aba" );
802 string s(
"one two three one two three");
806 string test(
"aba" );
841#if !defined (STLPORT) || defined (_STLP_USE_EXCEPTIONS)
857 char const* cstr =
"test string for assign";
859 s.assign(cstr, cstr + 22);
862 string s2(
"other test string");
872 str2 =
"1234567890123456789012345678901234567890";
891 string teststr(
"shortest");
900 size_t ss = teststr.
size();
906 string str1(
"abcdef");
952 string one(
"one"),
two(
"two"), three(
"three");
953 string space(1,
' ');
976 "one" == (
two + three);
977 "one" != (
two + three);
1071#if !defined (STLPORT) || defined (_STLP_USE_EXCEPTIONS)
1093#if !defined (TE_TMP_TEST_IGNORED)
1118#if !defined (TE_TMP_TEST_IGNORED)
1120 string more(
"more" );
1121 string less(
"less" );
1151 string s1(
"path1" );
1152 string s2(
".ext" );
1162#if !defined (STLPORT) || !defined (_STLP_NO_WCHAR_T)
1163# if !defined (__CYGWIN__) || defined (STLPORT)
1164 wstring
one(
L"one"),
two(
L"two"), three(
L"three");
1255# if !defined (STLPORT) || defined (_STLP_USE_EXCEPTIONS)
1274#if !defined (STLPORT) || !defined (_STLP_USE_NO_IOSTREAMS)
1275 string str(
"STLport");
1284 string istr_content;
1285 istr >> istr_content;
1292 string istr_content;
1293 istr >> istr_content;
1302#if !(defined (STLPORT) && defined (_STLP_NO_CUSTOM_IO))
1312 StackString str1(
"string stack1", stack1);
1313 StackString str1Cpy(str1);
1315 StackString str2(
"string stack2", stack2);
1316 StackString str2Cpy(str2);
1333 StackString str1(
"longer string from stack1 allocator instance for dynamic allocation", stack1);
1334 StackString str1Cpy(str1);
1336 StackString str2(
"longer string from stack2 allocator instance for dynamic allocation", stack2);
1337 StackString str2Cpy(str2);
1355 StackString str1(
"string stack1", stack1);
1356 StackString str1Cpy(str1);
1358 StackString str2(
"longer string from stack2 allocator instance for dynamic allocation", stack2);
1359 StackString str2Cpy(str2);
1377 StackString str1(
"longer string from stack1 allocator instance for dynamic allocation", stack1);
1378 StackString str1Cpy(str1);
1380 StackString str2(
"string stack2", stack2);
1381 StackString str2Cpy(str2);
1407#ifndef _STLP_SHORT_STRING_SZ
1408# define _STLP_SHORT_STRING_SZ 16
1421 string s =
string(
"123456789012345678901234" ) +
string(
"123456789012345678901234" );
basic_ostringstream< char, char_traits< char >, allocator< char > > ostringstream
int strcmp(const char *String1, const char *String2)
CPPUNIT_TEST(template_expression)
static string func(const string &par)
void allocator_with_state()
CPPUNIT_TEST(find_last_of)
void template_expression()
CPPUNIT_TEST(short_string_optim_bug)
CPPUNIT_TEST(template_wexpression)
CPPUNIT_TEST(allocator_with_state)
CPPUNIT_TEST(bogus_edge_find)
void template_wexpression()
CPPUNIT_TEST(find_last_not_of)
void trivial_char_compare()
void short_string_optim_bug()
CPPUNIT_TEST(trivial_char_compare)
CPPUNIT_TEST(constructor)
CPPUNIT_TEST_SUITE(StringTest)
CPPUNIT_TEST(short_string)
void push_back(const value_type &__t=_STLP_DEFAULT_CONSTRUCTED(_Tp))
const mypath & operator/(const string &)
const string & str() const
superstring operator/(const string &str)
superstring(const string &str)
#define CPPUNIT_TEST_SUITE_REGISTRATION(X)
#define CPPUNIT_ASSERT(X)
static const WCHAR empty[]
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static struct msdos_boot_sector bs
#define _STLP_SHORT_STRING_SZ
bool short_string_optim_bug_helper(string teststr)
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)