home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Programming / ICU / src / icu / source / test / intltest / encoll.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-16  |  2.3 KB  |  67 lines

  1. /*
  2. *****************************************************************************************
  3. *                                                                                       *
  4. * COPYRIGHT:                                                                            *
  5. *   (C) Copyright Taligent, Inc.,  1997                                                 *
  6. *   (C) Copyright International Business Machines Corporation,  1997-1998               *
  7. *   Licensed Material - Program-Property of IBM - All Rights Reserved.                  *
  8. *   US Government Users Restricted Rights - Use, duplication, or disclosure             *
  9. *   restricted by GSA ADP Schedule Contract with IBM Corp.                              *
  10. *                                                                                       *
  11. *****************************************************************************************
  12. */
  13.  
  14. /**
  15.  * CollationEnglishTest is a third level test class.  This tests the locale
  16.  * specific primary, secondary and tertiary rules.  For example, the ignorable
  17.  * character '-' in string "black-bird".  The en_US locale uses the default
  18.  * collation rules as its sorting sequence.
  19.  */
  20.  
  21. #ifndef _ENCOLL
  22. #define _ENCOLL
  23.  
  24. #ifndef _UTYPES
  25. #include "utypes.h"
  26. #endif
  27.  
  28. #ifndef _COLL
  29. #include "coll.h"
  30. #endif
  31.  
  32. #ifndef _INTLTEST
  33. #include "intltest.h"
  34. #endif
  35.  
  36. class CollationEnglishTest: public IntlTest {
  37. public:
  38.     // static constants
  39.     enum EToken_Len { MAX_TOKEN_LEN = 128 };
  40.  
  41.     CollationEnglishTest();
  42.     ~CollationEnglishTest();
  43.     void runIndexedTest( int32_t index, bool_t exec, char* &name, char* par = NULL );
  44.  
  45.     // main test routine, tests rules defined by the "en" locale
  46.     void doTest( UnicodeString source, UnicodeString target, Collator::EComparisonResult result);
  47.  
  48.     // performs test with strength PRIMARY
  49.     void TestPrimary( char* par );
  50.  
  51.     // perform test with strength SECONDARY
  52.     void TestSecondary( char* par );
  53.  
  54.     // perform test with strength TERTIARY
  55.     void TestTertiary( char* par );
  56.  
  57. private:
  58.     static const UChar testBugs[][MAX_TOKEN_LEN];
  59.     static const UChar testSourceCases[][MAX_TOKEN_LEN];
  60.     static const UChar testTargetCases[][MAX_TOKEN_LEN];
  61.     static const Collator::EComparisonResult results[];
  62.     static const UChar testAcute[][MAX_TOKEN_LEN];
  63.  
  64.     Collator *myCollation;
  65. };
  66. #endif
  67.