home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Programming / ICU / src / icu / source / test / intltest / allcoll.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-16  |  2.3 KB  |  73 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.  * CollationDummyTest is a third level test class.  This tests creation of 
  16.  * a customized collator object.  For example, number 1 to be sorted 
  17.  * equlivalent to word 'one'.
  18.  */
  19.  
  20. #ifndef _ALLCOLL
  21. #define _ALLCOLL
  22.  
  23. #ifndef _UTYPES
  24. #include "utypes.h"
  25. #endif
  26.  
  27. #ifndef _COLL
  28. #include "coll.h"
  29. #endif
  30.  
  31. #ifndef _TBLCOLL
  32. #include "tblcoll.h"
  33. #endif
  34.  
  35. #ifndef _INTLTEST
  36. #include "intltest.h"
  37. #endif
  38.  
  39. class CollationDummyTest: public IntlTest {
  40. public:
  41.     // static constants
  42.     enum EToken_Len { MAX_TOKEN_LEN = 128 };
  43.  
  44.     CollationDummyTest();
  45.     ~CollationDummyTest();
  46.     void runIndexedTest( int32_t index, bool_t exec, char* &name, char* par = NULL );
  47.  
  48.     // main test method called with different strengths,
  49.     // tests comparison of custum collation with different strengths
  50.     void doTest( UnicodeString source, UnicodeString target, Collator::EComparisonResult result);
  51.  
  52.     // perform test with strength PRIMARY
  53.     void TestPrimary( char* par );
  54.  
  55.     // perform test with strength SECONDARY
  56.     void TestSecondary( char* par );
  57.  
  58.     // perform test with strength tertiary
  59.     void TestTertiary( char* par );
  60.  
  61.     // perform extra tests
  62.     void TestExtra( char* par );
  63.  
  64. private:
  65.     static const UChar testCases[][MAX_TOKEN_LEN];
  66.     static const UChar testSourceCases[][MAX_TOKEN_LEN];
  67.     static const UChar testTargetCases[][MAX_TOKEN_LEN];
  68.     static const Collator::EComparisonResult results[];
  69.  
  70.     RuleBasedCollator *myCollation;
  71. };
  72. #endif
  73.