3#if !defined (STLPORT) || !defined (_STLP_USE_NO_IOSTREAMS)
9# if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
22 char const str1[] =
"abcdef1";
23 char const str2[] =
"abcdef2";
24 const size_t size1 =
sizeof(str1) /
sizeof(str1[0]) - 1;
25 const size_t size2 =
sizeof(str2) /
sizeof(str2[0]) - 1;
27 CPPUNIT_ASSERT( col.compare(str1, str1 + size1 - 1, str2, str2 + size2 - 1) == 0 );
28 CPPUNIT_ASSERT( col.compare(str1, str1 + size1, str2, str2 + size2) == -1 );
31 CPPUNIT_ASSERT( col.compare(str1, str1 + size1 - 2, str2, str2 + size2 - 1) == -1 );
32 CPPUNIT_ASSERT( col.compare(str1, str1 + size1 - 1, str2, str2 + size2 - 2) == 1 );
35# if !defined (STLPORT) || defined (_STLP_USE_EXCEPTIONS)
42 char const str1[] =
"abcdef1";
43 char const str2[] =
"abcdef2";
44 const size_t size1 =
sizeof(str1) /
sizeof(str1[0]) - 1;
45 const size_t size2 =
sizeof(str2) /
sizeof(str2[0]) - 1;
47 CPPUNIT_ASSERT( col.compare(str1, str1 + size1 - 1, str2, str2 + size2 - 1) == 0 );
48 CPPUNIT_ASSERT( col.compare(str1, str1 + size1, str2, str2 + size2) == -1 );
51 CPPUNIT_ASSERT( col.compare(str1, str1 + size1 - 2, str2, str2 + size2 - 1) == -1 );
52 CPPUNIT_ASSERT( col.compare(str1, str1 + size1 - 1, str2, str2 + size2 - 2) == 1 );
58 string strs[] = {
"abdd",
"abçd",
"abbd",
"abcd"};
60 string transformed[4];
61 for (
size_t i = 0;
i < 4; ++
i) {
62 transformed[
i] = col.transform(strs[
i].
data(), strs[
i].data() + strs[
i].size());
65 sort(strs, strs + 4, loc);
71 sort(transformed, transformed + 4);
73 CPPUNIT_ASSERT( col.transform(strs[0].data(), strs[0].data() + strs[0].size()) == transformed[0] );
74 CPPUNIT_ASSERT( col.transform(strs[1].data(), strs[1].data() + strs[1].size()) == transformed[1] );
75 CPPUNIT_ASSERT( col.transform(strs[2].data(), strs[2].data() + strs[2].size()) == transformed[2] );
76 CPPUNIT_ASSERT( col.transform(strs[3].data(), strs[3].data() + strs[3].size()) == transformed[3] );
79 CPPUNIT_ASSERT( col.transform(strs[0].data(), strs[0].data()).empty() );
82 CPPUNIT_ASSERT( col.transform(strs[0].data(), strs[0].data() + 2) == col.transform(strs[1].data(), strs[1].data() + 2) );
84# if !defined (STLPORT) || !defined (_STLP_NO_WCHAR_T)
89 wchar_t const str1[] =
L"abcdef1";
90 wchar_t const str2[] =
L"abcdef2";
91 const size_t size1 =
sizeof(str1) /
sizeof(str1[0]) - 1;
92 const size_t size2 =
sizeof(str2) /
sizeof(str2[0]) - 1;
94 CPPUNIT_ASSERT( col.compare(str1, str1 + size1 - 1, str2, str2 + size2 - 1) == 0 );
95 CPPUNIT_ASSERT( col.compare(str1, str1 + size1, str2, str2 + size2) == -1 );
98 CPPUNIT_ASSERT( col.compare(str1, str1 + size1 - 2, str2, str2 + size2 - 1) == -1 );
99 CPPUNIT_ASSERT( col.compare(str1, str1 + size1 - 1, str2, str2 + size2 - 2) == 1 );
109 wstring strs[] = {
L"abdd",
L"abcd",
L"abbd",
L"abcd"};
111 wstring transformed[4];
112 for (
i = 0;
i < 4; ++
i) {
113 transformed[
i] = col.transform(strs[
i].
data(), strs[
i].data() + strs[
i].size());
116 sort(strs, strs + 4, loc);
122 sort(transformed, transformed + 4);
124 CPPUNIT_ASSERT( col.transform(strs[0].data(), strs[0].data() + strs[0].size()) == transformed[0] );
125 CPPUNIT_ASSERT( col.transform(strs[1].data(), strs[1].data() + strs[1].size()) == transformed[1] );
126 CPPUNIT_ASSERT( col.transform(strs[2].data(), strs[2].data() + strs[2].size()) == transformed[2] );
127 CPPUNIT_ASSERT( col.transform(strs[3].data(), strs[3].data() + strs[3].size()) == transformed[3] );
129 CPPUNIT_ASSERT( col.transform(strs[0].data(), strs[0].data()).empty() );
131 CPPUNIT_ASSERT( col.transform(strs[0].data(), strs[0].data() + 2) == col.transform(strs[1].data(), strs[1].data() + 2) );
148# if !defined (STLPORT) || defined (_STLP_USE_EXCEPTIONS)
149# if defined (STLPORT) || !defined (__GNUC__)
174 string veryLongFacetName(
"LC_COLLATE=");
175 veryLongFacetName.append(512,
'?');
213 collate<char> const& cfacet_byname = use_facet<collate<char> >(loc);
216 char const str1[] =
"abcdef1";
217 char const str2[] =
"abcdef2";
218 const size_t size1 =
sizeof(str1) /
sizeof(str1[0]) - 1;
219 const size_t size2 =
sizeof(str2) /
sizeof(str2[0]) - 1;
221 CPPUNIT_ASSERT( cfacet_byname.compare(str1, str1 + size1 - 1, str2, str2 + size2 - 1) ==
222 cfacet.compare(str1, str1 + size1 - 1, str2, str2 + size2 - 1) );
223 CPPUNIT_ASSERT( cfacet_byname.compare(str1, str1 + size1, str2, str2 + size2) ==
224 cfacet.compare(str1, str1 + size1, str2, str2 + size2) );
227 CPPUNIT_ASSERT( cfacet_byname.compare(str1, str1 + size1 - 2, str2, str2 + size2 - 1) ==
228 cfacet.compare(str1, str1 + size1 - 2, str2, str2 + size2 - 1) );
229 CPPUNIT_ASSERT( cfacet_byname.compare(str1, str1 + size1 - 1, str2, str2 + size2 - 2) ==
230 cfacet.compare(str1, str1 + size1 - 1, str2, str2 + size2 - 2) );
234 string strs[] = {
"abdd",
"abbd",
"abcd"};
236 vector<string>
v1(strs, strs +
sizeof(strs) /
sizeof(strs[0]));
238 vector<string>
v2(strs, strs +
sizeof(strs) /
sizeof(strs[0]));
242 CPPUNIT_ASSERT( (cfacet_byname.transform(
v1[0].data(),
v1[0].data() +
v1[0].size()).compare(cfacet_byname.transform(
v1[1].data(),
v1[1].data() +
v1[1].size())) ==
243 v1[0].compare(
v1[1])) );
253# if !defined (STLPORT) || !defined (_STLP_NO_WCHAR_T)
254# if defined (STLPORT) || !defined (__GNUC__)
_STLP_MOVE_TO_STD_NAMESPACE void sort(_RandomAccessIter __first, _RandomAccessIter __last)
bool has_facet(const locale &__loc) _STLP_NOTHROW
static const locale &_STLP_CALL classic()
#define CPPUNIT_MESSAGE(m)
#define CPPUNIT_ASSERT(X)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLfloat GLfloat GLfloat v2
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