+#endif // wxUSE_UNICODE
+
+#define wxUNICHAR_TEST_INT_COMPARE \
+ wxUniChar a(aVal); \
+ CPPUNIT_ASSERT( a == aVal ); \
+ CPPUNIT_ASSERT( a != bVal ); \
+ CPPUNIT_ASSERT( a < bVal ); \
+ CPPUNIT_ASSERT( a <= bVal ); \
+ CPPUNIT_ASSERT( a > cVal ); \
+ CPPUNIT_ASSERT( a >= cVal );
+
+
+void UniCharTestCase::ShortCompare()
+{
+ short aVal = 2;
+ short bVal = 3;
+ short cVal = 1;
+
+ wxUNICHAR_TEST_INT_COMPARE
+}
+
+void UniCharTestCase::UnsignedShortCompare()
+{
+ unsigned short aVal = 2;
+ unsigned short bVal = 3;
+ unsigned short cVal = 1;
+
+ wxUNICHAR_TEST_INT_COMPARE
+}
+
+void UniCharTestCase::IntCompare()
+{
+ int aVal = 2;
+ int bVal = 3;
+ int cVal = 1;
+
+ wxUNICHAR_TEST_INT_COMPARE
+}
+
+void UniCharTestCase::UnsignedIntCompare()
+{
+ unsigned int aVal = 2;
+ unsigned int bVal = 3;
+ unsigned int cVal = 1;
+
+ wxUNICHAR_TEST_INT_COMPARE
+}
+
+void UniCharTestCase::LongCompare()
+{
+ long aVal = 2;
+ long bVal = 3;
+ long cVal = 1;
+
+ wxUNICHAR_TEST_INT_COMPARE
+}
+
+void UniCharTestCase::UnsignedLongCompare()
+{
+ unsigned long aVal = 2;
+ unsigned long bVal = 3;
+ unsigned long cVal = 1;
+
+ wxUNICHAR_TEST_INT_COMPARE
+}
+
+#ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
+
+void UniCharTestCase::wxLongLongCompare()
+{
+ wxLongLong_t aVal = 2;
+ wxLongLong_t bVal = 3;
+ wxLongLong_t cVal = 1;
+
+ wxUNICHAR_TEST_INT_COMPARE
+}
+
+void UniCharTestCase::wxULongLongCompare()
+{
+ wxULongLong_t aVal = 2;
+ wxULongLong_t bVal = 3;
+ wxULongLong_t cVal = 1;
+
+ wxUNICHAR_TEST_INT_COMPARE
+}
+
+#endif
+
+#if wxWCHAR_T_IS_REAL_TYPE
+
+void UniCharTestCase::WideCharCompare()
+{
+ wchar_t aVal = 2;
+ wchar_t bVal = 3;
+ wchar_t cVal = 1;
+
+ wxUNICHAR_TEST_INT_COMPARE
+}
+
+#endif
+
+#undef wxUNICHAR_TEST_INT_COMPARE
+
+#define wxUNICHAR_TEST_ASSIGNMENT_OPERATOR \
+ wxUniChar a; \
+ wxUniChar b(bVal); \
+ a = b; \
+ CPPUNIT_ASSERT(a == b);
+
+void UniCharTestCase::UniCharAssignmentOperator()
+{
+ wxUniChar a;
+ wxUniChar b('b');
+ a = b;
+ CPPUNIT_ASSERT(a == b);
+}
+
+void UniCharTestCase::UniCharRefAssignmentOperator()
+{
+ wxUniChar a;
+ wxUniChar b('b');
+ wxString bStr('b');
+ wxUniCharRef bRef = bStr[0];
+ a = bRef;
+ CPPUNIT_ASSERT(a == b);
+}
+
+void UniCharTestCase::CharAssignmentOperator()
+{
+ char bVal = 'b';
+
+ wxUNICHAR_TEST_ASSIGNMENT_OPERATOR
+}
+
+void UniCharTestCase::UnsignedCharAssignmentOperator()
+{
+ unsigned char bVal = 2;
+
+ wxUNICHAR_TEST_ASSIGNMENT_OPERATOR
+}
+
+void UniCharTestCase::ShortAssignmentOperator()
+{
+ short bVal = 2;
+
+ wxUNICHAR_TEST_ASSIGNMENT_OPERATOR
+}
+
+void UniCharTestCase::UnsignedShortAssignmentOperator()
+{
+ unsigned short bVal = 2;
+
+ wxUNICHAR_TEST_ASSIGNMENT_OPERATOR
+}
+
+void UniCharTestCase::IntAssignmentOperator()
+{
+ int bVal = 2;
+
+ wxUNICHAR_TEST_ASSIGNMENT_OPERATOR
+}
+
+void UniCharTestCase::UnsignedIntAssignmentOperator()
+{
+ unsigned int bVal = 2;
+
+ wxUNICHAR_TEST_ASSIGNMENT_OPERATOR
+}
+
+void UniCharTestCase::LongAssignmentOperator()
+{
+ long bVal = 2;
+
+ wxUNICHAR_TEST_ASSIGNMENT_OPERATOR
+}
+
+void UniCharTestCase::UnsignedLongAssignmentOperator()
+{
+ unsigned long bVal = 2;
+
+ wxUNICHAR_TEST_ASSIGNMENT_OPERATOR
+}
+
+#ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
+
+void UniCharTestCase::wxLongLongAssignmentOperator()
+{
+ wxLongLong_t bVal = 2;
+
+ wxUNICHAR_TEST_ASSIGNMENT_OPERATOR
+}
+
+void UniCharTestCase::wxULongLongAssignmentOperator()
+{
+ wxULongLong_t bVal = 2;
+
+ wxUNICHAR_TEST_ASSIGNMENT_OPERATOR
+}
+
+#endif
+
+#if wxWCHAR_T_IS_REAL_TYPE
+
+void UniCharTestCase::WideCharAssignmentOperator()
+{
+ wchar_t bVal = 2;
+
+ wxUNICHAR_TEST_ASSIGNMENT_OPERATOR
+}
+
+#endif
+
+#undef wxUNICHAR_TEST_ASSIGNMENT_OPERATOR
+
+void UniCharTestCase::CharParenOperator()
+{
+ char aVal;
+ char bVal = 'b';
+ wxUniChar b(bVal);
+
+ aVal = (char) b;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+void UniCharTestCase::UnsignedCharParenOperator()
+{
+ unsigned char aVal;
+ unsigned char bVal = 'b';
+ wxUniChar b(bVal);
+
+ aVal = (unsigned char) b;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+void UniCharTestCase::ShortParenOperator()
+{
+ short aVal;
+ short bVal = 2;
+ wxUniChar b(bVal);
+
+ aVal = (short) b;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+void UniCharTestCase::UnsignedShortParenOperator()
+{
+ unsigned short aVal;
+ unsigned short bVal = 2;
+ wxUniChar b(bVal);
+
+ aVal = (unsigned short) b;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+void UniCharTestCase::IntParenOperator()
+{
+ int aVal;
+ int bVal = 2;
+ wxUniChar b(bVal);
+
+ aVal = (int) b;
+ CPPUNIT_ASSERT(aVal == bVal);
+
+}
+
+void UniCharTestCase::UnsignedIntParenOperator()
+{
+ unsigned int aVal;
+ unsigned int bVal = 2;
+ wxUniChar b(bVal);
+
+ aVal = (unsigned int) b;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+void UniCharTestCase::LongParenOperator()
+{
+ long aVal;
+ long bVal = 2;
+ wxUniChar b(bVal);
+
+ aVal = (long) b;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+void UniCharTestCase::UnsignedLongParenOperator()
+{
+ unsigned long aVal;
+ unsigned long bVal = 2;
+ wxUniChar b(bVal);
+
+ aVal = (unsigned long) b;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+#ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
+
+void UniCharTestCase::wxLongLongParenOperator()
+{
+ wxLongLong_t aVal;
+ wxLongLong_t bVal = 2;
+ wxUniChar b(bVal);
+
+ aVal = (wxLongLong_t) b;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+void UniCharTestCase::wxULongLongParenOperator()
+{
+ wxULongLong_t aVal;
+ wxULongLong_t bVal = 2;
+ wxUniChar b(bVal);
+
+ aVal = (wxULongLong_t) b;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+#endif
+
+#if wxWCHAR_T_IS_REAL_TYPE
+
+void UniCharTestCase::WideCharParenOperator()
+{
+ wchar_t aVal;
+ wchar_t bVal = 2;
+ wxUniChar b(bVal);
+
+ aVal = (wchar_t) b;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+#endif
+
+void UniCharTestCase::RefUniCharAssignmentOperator()
+{
+ wxString dummyStr('0');
+ wxUniCharRef bRef = dummyStr[0];
+
+ wxChar b = 'b';
+ wxUniChar bVal(b);
+ bRef = bVal;
+
+ CPPUNIT_ASSERT(bRef == b);
+}
+
+void UniCharTestCase::RefUniCharRefAssignmentOperator()
+{
+ wxChar b = 'b';
+ wxString testStr(b);
+ wxUniCharRef testRef = testStr[0];
+
+ wxString dummyStr('0');
+ wxUniCharRef bRef = dummyStr[0];
+
+ bRef = testRef;
+
+ CPPUNIT_ASSERT(bRef == testRef);
+}
+
+void UniCharTestCase::RefCharAssignmentOperator()
+{
+ wxString dummyStr('0');
+ wxUniCharRef bRef = dummyStr[0];
+
+ char b = 'b';
+ bRef = b;
+
+ CPPUNIT_ASSERT(bRef == b);
+}
+
+void UniCharTestCase::RefUnsignedCharAssignmentOperator()
+{
+ wxString dummyStr('0');
+ wxUniCharRef bRef = dummyStr[0];
+
+ unsigned char b = 'b';
+ bRef = b;
+
+ CPPUNIT_ASSERT(bRef == b);
+}
+
+void UniCharTestCase::RefShortAssignmentOperator()
+{
+ wxString dummyStr('0');
+ wxUniCharRef bRef = dummyStr[0];
+
+ short b = 2;
+ bRef = b;
+
+ CPPUNIT_ASSERT(bRef == b);
+}
+
+void UniCharTestCase::RefUnsignedShortAssignmentOperator()
+{
+ wxString dummyStr('0');
+ wxUniCharRef bRef = dummyStr[0];
+
+ unsigned short b = 2;
+ bRef = b;
+
+ CPPUNIT_ASSERT(bRef == b);
+}
+
+void UniCharTestCase::RefIntAssignmentOperator()
+{
+ wxString dummyStr('0');
+ wxUniCharRef bRef = dummyStr[0];
+
+ int b = 2;
+ bRef = b;
+
+ CPPUNIT_ASSERT(bRef == b);
+}
+
+void UniCharTestCase::RefUnsignedIntAssignmentOperator()
+{
+ wxString dummyStr('0');
+ wxUniCharRef bRef = dummyStr[0];
+
+ unsigned int b = 2;
+ bRef = b;
+
+ CPPUNIT_ASSERT(bRef == b);
+}
+
+void UniCharTestCase::RefLongAssignmentOperator()
+{
+ wxString dummyStr('0');
+ wxUniCharRef bRef = dummyStr[0];
+
+ long b = 2;
+ bRef = b;
+
+ CPPUNIT_ASSERT(bRef == b);
+}
+
+void UniCharTestCase::RefUnsignedLongAssignmentOperator()
+{
+ wxString dummyStr('0');
+ wxUniCharRef bRef = dummyStr[0];
+
+ unsigned long b = 2;
+ bRef = b;
+
+ CPPUNIT_ASSERT(bRef == b);
+}
+
+#ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
+
+void UniCharTestCase::RefwxLongLongAssignmentOperator()
+{
+ wxString dummyStr('0');
+ wxUniCharRef bRef = dummyStr[0];
+
+ wxLongLong_t b = 2;
+ bRef = b;
+
+ CPPUNIT_ASSERT(bRef == b);
+}
+void UniCharTestCase::RefwxULongLongAssignmentOperator()
+{
+ wxString dummyStr('0');
+ wxUniCharRef bRef = dummyStr[0];
+
+ unsigned long b = 2;
+ bRef = b;
+
+ CPPUNIT_ASSERT(bRef == b);
+}
+
+#endif
+
+#if wxWCHAR_T_IS_REAL_TYPE
+
+void UniCharTestCase::RefWideCharAssignmentOperator()
+{
+ wxString dummyStr('0');
+ wxUniCharRef bRef = dummyStr[0];
+
+ wchar_t b = 2;
+ bRef = b;
+
+ CPPUNIT_ASSERT(bRef == b);
+}
+
+#endif
+
+void UniCharTestCase::RefCharParenOperator()
+{
+ char aVal;
+ char bVal = 'b';
+ wxString testStr(bVal);
+ wxUniCharRef bRef = testStr[0];
+
+ aVal = (char) bRef;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+void UniCharTestCase::RefUnsignedCharParenOperator()
+{
+ unsigned char aVal;
+ unsigned char bVal = 'b';
+ wxString testStr = wxString::Format(wxT("%u"), bVal);
+ wxUniCharRef bRef = testStr[0];
+
+ aVal = (unsigned char) bRef;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+void UniCharTestCase::RefShortParenOperator()
+{
+ short aVal;
+ short bVal = 2;
+ wxUniChar b(bVal);
+
+ wxString dummyStr("0");
+ wxUniCharRef bRef = dummyStr[0];
+ bRef = b;
+
+ aVal = (short) bRef;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+void UniCharTestCase::RefUnsignedShortParenOperator()
+{
+ unsigned short aVal;
+ unsigned short bVal = 2;
+ wxUniChar b(bVal);
+
+ wxString dummyStr("0");
+ wxUniCharRef bRef = dummyStr[0];
+ bRef = b;
+
+ aVal = (unsigned short) bRef;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+void UniCharTestCase::RefIntParenOperator()
+{
+ int aVal;
+ int bVal = 2;
+ wxUniChar b(bVal);
+
+ wxString dummyStr("0");
+ wxUniCharRef bRef = dummyStr[0];
+ bRef = b;
+
+ aVal = (int) bRef;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+void UniCharTestCase::RefUnsignedIntParenOperator()
+{
+ unsigned int aVal;
+ unsigned int bVal = 2;
+ wxUniChar b(bVal);
+
+ wxString dummyStr("0");
+ wxUniCharRef bRef = dummyStr[0];
+ bRef = b;
+
+ aVal = (unsigned int) bRef;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+void UniCharTestCase::RefLongParenOperator()
+{
+ long aVal;
+ long bVal = 2;
+ wxUniChar b(bVal);
+
+ wxString dummyStr("0");
+ wxUniCharRef bRef = dummyStr[0];
+ bRef = b;
+
+ aVal = (long) bRef;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+void UniCharTestCase::RefUnsignedLongParenOperator()
+{
+ unsigned long aVal;
+ unsigned long bVal = 2;
+ wxUniChar b(bVal);
+
+ wxString dummyStr("0");
+ wxUniCharRef bRef = dummyStr[0];
+ bRef = b;
+
+ aVal = (unsigned long) bRef;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+#ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
+
+void UniCharTestCase::RefwxLongLongParenOperator()
+{
+ wxLongLong_t aVal;
+ wxLongLong_t bVal = 2;
+ wxUniChar b(bVal);
+
+ wxString dummyStr("0");
+ wxUniCharRef bRef = dummyStr[0];
+ bRef = b;
+
+ aVal = (wxLongLong_t) bRef;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+void UniCharTestCase::RefwxULongLongParenOperator()
+{
+ wxULongLong_t aVal;
+ wxULongLong_t bVal = 2;
+ wxUniChar b(bVal);
+
+ wxString dummyStr("0");
+ wxUniCharRef bRef = dummyStr[0];
+ bRef = b;
+
+ aVal = (wxULongLong_t) bRef;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+#endif
+
+#if wxWCHAR_T_IS_REAL_TYPE
+
+void UniCharTestCase::RefWideCharParenOperator()
+{
+ wchar_t aVal;
+ wchar_t bVal = 2;
+ wxUniChar b(bVal);
+
+ wxString dummyStr("0");
+ wxUniCharRef bRef = dummyStr[0];
+ bRef = b;
+
+ aVal = (wxLongLong_t) bRef;
+ CPPUNIT_ASSERT(aVal == bVal);
+}
+
+#endif
+
+#define wxUNICHARREF_TEST_INT_COMPARE \
+ wxUniChar a(aVal); \
+ wxString dummyStr("0"); \
+ wxUniCharRef aRef = dummyStr[0]; \
+ aRef = a; \
+ CPPUNIT_ASSERT( aRef == aVal ); \
+ CPPUNIT_ASSERT( aRef != bVal ); \
+ CPPUNIT_ASSERT( aRef < bVal ); \
+ CPPUNIT_ASSERT( aRef <= bVal ); \
+ CPPUNIT_ASSERT( aRef > cVal ); \
+ CPPUNIT_ASSERT( aRef >= cVal );
+
+void UniCharTestCase::RefShortCompare()
+{
+ short aVal = 2;
+ short bVal = 3;
+ short cVal = 1;
+
+ wxUNICHARREF_TEST_INT_COMPARE
+}
+
+void UniCharTestCase::RefUnsignedShortCompare()
+{
+ unsigned short aVal = 2;
+ unsigned short bVal = 3;
+ unsigned short cVal = 1;
+
+ wxUNICHARREF_TEST_INT_COMPARE
+}
+
+void UniCharTestCase::RefIntCompare()
+{
+ int aVal = 2;
+ int bVal = 3;
+ int cVal = 1;
+
+ wxUNICHARREF_TEST_INT_COMPARE
+}
+
+void UniCharTestCase::RefUnsignedIntCompare()
+{
+ unsigned int aVal = 2;
+ unsigned int bVal = 3;
+ unsigned int cVal = 1;
+
+ wxUNICHARREF_TEST_INT_COMPARE
+}
+
+void UniCharTestCase::RefLongCompare()
+{
+ long aVal = 2;
+ long bVal = 3;
+ long cVal = 1;
+
+ wxUNICHARREF_TEST_INT_COMPARE
+}
+
+void UniCharTestCase::RefUnsignedLongCompare()
+{
+ unsigned long aVal = 2;
+ unsigned long bVal = 3;
+ unsigned long cVal = 1;
+
+ wxUNICHARREF_TEST_INT_COMPARE
+}
+
+#ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
+
+void UniCharTestCase::RefwxLongLongCompare()
+{
+ wxLongLong_t aVal = 2;
+ wxLongLong_t bVal = 3;
+ wxLongLong_t cVal = 1;
+
+ wxUNICHARREF_TEST_INT_COMPARE
+}
+
+void UniCharTestCase::RefwxULongLongCompare()
+{
+ wxULongLong_t aVal = 2;
+ wxULongLong_t bVal = 3;
+ wxULongLong_t cVal = 1;
+
+ wxUNICHARREF_TEST_INT_COMPARE
+}
+
+#endif
+
+#if wxWCHAR_T_IS_REAL_TYPE
+
+void UniCharTestCase::RefWideCharCompare()
+{
+ wchar_t aVal = 2;
+ wchar_t bVal = 3;
+ wchar_t cVal = 1;
+
+ wxUNICHARREF_TEST_INT_COMPARE
+}
+
+#endif
\ No newline at end of file