home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Programming / ICU / src / icu / source / test / intltest / mnkytst.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-16  |  2.0 KB  |  62 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.  * CollationMonkeyTest is a third level test class.  This tests the random 
  16.  * substrings of the default test strings to verify if the compare and 
  17.  * sort key algorithm works correctly.  For example, any string is always
  18.  * less than the string itself appended with any character.
  19.  */
  20.  
  21. #ifndef _MNKYTST
  22. #define _MNKYTST
  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 CollationMonkeyTest: public IntlTest {
  37. public:
  38.     // static constants
  39.     enum EToken_Len { MAX_TOKEN_LEN = 128 };
  40.  
  41.     CollationMonkeyTest();
  42.     ~CollationMonkeyTest();
  43.     void runIndexedTest( int32_t index, bool_t exec, char* &name, char* par = NULL );
  44.  
  45.     // utility function used in tests, returns absolute value
  46.     int32_t checkValue(int32_t value);
  47.  
  48.     // perform monkey tests using Collator::compare
  49.     void TestCompare( char* par );
  50.  
  51.     // perform monkey tests using CollationKey::compareTo
  52.     void TestCollationKey( char* par );
  53.  
  54. private:
  55.     void report(UnicodeString& s, UnicodeString& t, int32_t result, int32_t revResult);
  56.  
  57.     static const UnicodeString source;
  58.  
  59.     Collator *myCollator;
  60. };
  61. #endif
  62.