home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Programming / ICU / src / icu / source / test / intltest / tstnorm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-16  |  2.4 KB  |  81 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.  * Normalizer basic tests
  16.  */
  17.  
  18. #ifndef _TSTNORM
  19. #define _TSTNORM
  20.  
  21. #ifndef _UTYPES
  22. #include "utypes.h"
  23. #endif
  24.  
  25. #ifndef _COLL
  26. #include "coll.h"
  27. #endif
  28.  
  29. #ifndef _NORMLZR
  30. #include "normlzr.h"
  31. #endif
  32.  
  33. #ifndef _INTLTEST
  34. #include "intltest.h"
  35. #endif
  36.  
  37. class BasicNormalizerTest : public IntlTest {
  38. public:
  39.     BasicNormalizerTest();
  40.     ~BasicNormalizerTest();
  41.  
  42.     void runIndexedTest( int32_t index, bool_t exec, char* &name, char* par = NULL );
  43.  
  44.     void TestHangulCompose(void);
  45.     void TestHangulDecomp(void);
  46.     void TestPrevious(void);
  47.     void TestDecomp(void);
  48.     void TestCompatDecomp(void);
  49.     void TestCanonCompose(void);
  50.     void TestCompatCompose(void);
  51.  
  52.  
  53. private:
  54.     static UnicodeString canonTests[][3];
  55.     static UnicodeString compatTests[][3];
  56.     static UnicodeString hangulCanon[][3];
  57.     static UnicodeString hangulCompat[][3];
  58.  
  59.  
  60.     //------------------------------------------------------------------------
  61.     // Internal utilities
  62.     //
  63.     void backAndForth(Normalizer* iter, const UnicodeString& input);
  64.  
  65.     void staticTest(Normalizer::EMode mode, int options,
  66.                     UnicodeString tests[][3], int length, int outCol);
  67.  
  68.     void iterateTest(Normalizer* iter, UnicodeString tests[][3], int length, int outCol);
  69.  
  70.     void assertEqual(const UnicodeString& input,
  71.              const UnicodeString& expected, 
  72.              Normalizer* result,
  73.              const UnicodeString& errPrefix);
  74.  
  75.     static UnicodeString hex(UChar ch);
  76.     static UnicodeString hex(const UnicodeString& str);
  77.  
  78. };
  79.  
  80. #endif // _TSTNORM
  81.