home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Programming / ICU / src / icu / source / test / intltest / ittxtbd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-16  |  7.8 KB  |  249 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. #ifndef _INTLTESTTEXTBOUNDARY
  16. #define _INTLTESTTEXTBOUNDARY
  17.  
  18.  
  19. #include "utypes.h"
  20. #include "intltest.h"
  21. #include "brkiter.h"
  22.  
  23. class Vector;
  24. class Enumeration;
  25.  
  26. /**
  27.  * Test the BreakIterator class and indirectly all related classes
  28.  */
  29. class IntlTestTextBoundary: public IntlTest {
  30. public:
  31.     IntlTestTextBoundary();
  32.     ~IntlTestTextBoundary();
  33.     
  34.     void runIndexedTest( int32_t index, bool_t exec, char* &name, char* par = NULL );
  35.  
  36.     /**
  37.      * Test sentence break using doForwardSelectionTest
  38.      **/
  39.     void TestForwardSentenceSelection(void);
  40.     /**
  41.      * Test sentence break using doFirstSelectionTest
  42.      **/
  43.     void TestFirstSentenceSelection(void);
  44.     /**
  45.      * Test sentence break using doLastSelectionTest
  46.      **/
  47.     void TestLastSentenceSelection(void);
  48.     /**
  49.      * Test sentence break using doBackwardSelectionTest
  50.      **/
  51.     void TestBackwardSentenceSelection(void);
  52.     /**
  53.      * Test sentence break using doForwardIndexSelectionTest
  54.      **/
  55.     void TestForwardSentenceIndexSelection(void);
  56.     /**
  57.      * Test sentence break using doBackwardIndexSelectionTest
  58.      **/
  59.     void TestBackwardSentenceIndexSelection(void);
  60.     /**
  61.      * Test sentence break using doMultipleSelectionTest
  62.      **/
  63.     void TestSentenceMultipleSelection(void);
  64.     /**
  65.      * Test word break using doForwardSelectionTest
  66.      **/
  67.     void TestForwardWordSelection(void);
  68.     /**
  69.      * Test word break using doFirstSelectionTest
  70.      **/
  71.     void TestFirstWordSelection(void);
  72.     /**
  73.      * Test word break using doLastSelectionTest
  74.      **/
  75.     void TestLastWordSelection(void);
  76.     /**
  77.      * Test word break using doBackwardSelectionTest
  78.      **/
  79.     void TestBackwardWordSelection(void);
  80.     /**
  81.      * Test word break using doForwardIndexSelectionTest
  82.      **/
  83.     void TestForwardWordIndexSelection(void);
  84.     /**
  85.      * Test word break using doBackwardIndexSelectionTest
  86.      **/
  87.     void TestBackwardWordIndexSelection(void);
  88.     /**
  89.      * Test word break using doMultipleSelectionTest
  90.      **/
  91.     void TestWordMultipleSelection(void);
  92.     /**
  93.      * Test line break using doLastSelectionTest
  94.      **/
  95.     void TestForwardLineSelection(void);
  96.     /**
  97.      * Test line break using doFirstSelectionTest
  98.      **/
  99.     void TestFirstLineSelection(void);
  100.     /**
  101.      * Test line break using doLastSelectionTest
  102.      **/
  103.     void TestLastLineSelection(void);
  104.     /**
  105.      * Test line break using doBackwardSelectionTest
  106.      **/
  107.     void TestBackwardLineSelection(void);
  108.     /**
  109.      * Test line break using doForwardIndexSelectionTest
  110.      **/
  111.     void TestForwardLineIndexSelection(void);
  112.     /**
  113.      * Test line break using doBackwardIndexSelectionTest
  114.      **/
  115.     void TestBackwardLineIndexSelection(void);
  116.     /**
  117.      * Test line break using doMultipleSelectionTest
  118.      **/
  119.     void TestLineMultipleSelection(void);
  120.     /**
  121.      * Test word break using doForwardIndexSelectionTest
  122.      **/
  123.     void TestForwardCharacterSelection(void);
  124.     /**
  125.      * Test character break using doFirstSelectionTest
  126.      **/
  127.     void TestFirstCharacterSelection(void);
  128.     /**
  129.      * Test character break using doLastSelectionTest
  130.      **/
  131.     void TestLastCharacterSelection(void);
  132.     /**
  133.      * Test character break using doBackwardSelectionTest
  134.      **/
  135.     void TestBackwardCharacterSelection(void);
  136.     /**
  137.      * Test character break using doForwardIndexSelectionTest
  138.      **/
  139.     void TestForwardCharacterIndexSelection(void);
  140.     /**
  141.      * Test character break using doBackwardIndexSelectionTest
  142.      **/
  143.     void TestBackwardCharacterIndexSelection(void);
  144.     /**
  145.      * Test character break using doMultipleSelectionTest
  146.      **/
  147.     void TestCharacterMultipleSelection(void);
  148.     /**
  149.      * test behaviour of BrakIteraor on an empty string
  150.      **/
  151.     void TestEmptyString(void);
  152.     /**
  153.      * Test BreakIterator::getAvailableLocales
  154.      **/
  155.     void TestGetAvailableLocales(void);
  156.     /**
  157.      * Test BreakIterator::getDisplayName
  158.      **/
  159.     void TestGetDisplayName(void);
  160.     /**
  161.      * test methods preceding, following and isBoundary
  162.      **/
  163.     void TestPreceding(void);
  164.  
  165.     void TestJapaneseLineBreak(void);
  166.  
  167.     void TestBug4153072(void);
  168.  
  169.     void TestEndBehavior(void);
  170.  
  171.     void TestSentenceInvariants(void);
  172.  
  173.     void TestWordInvariants(void);
  174.     
  175.     void TestLineInvariants(void);
  176.  
  177.     void TestCharacterInvariants(void);
  178.  
  179. private:
  180.     /**
  181.      * internal methods to prepare test data
  182.      **/
  183.     void addTestWordData(void);
  184.     void addTestSentenceData(void);
  185.     void addTestLineData(void);
  186.     void addTestCharacterData(void);
  187.  
  188.     UnicodeString createTestData(Enumeration* e);
  189.  
  190.  
  191.     /**
  192.      * Perform tests of BreakIterator forward functionality 
  193.      * on different kinds of iterators (word, sentence, line and character)
  194.      **/
  195.     void doForwardSelectionTest(BreakIterator& iterator, UnicodeString& testText, Vector* result);
  196.     /**
  197.      * Perform tests of BreakIterator backward functionality 
  198.      * on different kinds of iterators (word, sentence, line and character)
  199.      **/
  200.     void doBackwardSelectionTest(BreakIterator& iterator, UnicodeString& testText, Vector* result);
  201.     /**
  202.      * Perform tests of BreakIterator first selection functionality 
  203.      * on different kinds of iterators (word, sentence, line and character)
  204.      **/
  205.     void doFirstSelectionTest(BreakIterator& iterator, UnicodeString& testText, Vector* result);
  206.     /**
  207.      * Perform tests of BreakIterator last selection functionality 
  208.      * on different kinds of iterators (word, sentence, line and character)
  209.      **/
  210.     void doLastSelectionTest(BreakIterator& iterator, UnicodeString& testText, Vector* result);
  211.     /**
  212.      * Perform tests of BreakIterator forward index functionality 
  213.      * on different kinds of iterators (word, sentence, line and character)
  214.      **/
  215.     void doForwardIndexSelectionTest(BreakIterator& iterator, UnicodeString& testText, Vector* result);
  216.     /**
  217.      * Perform tests of BreakIterator backward index functionality 
  218.      * on different kinds of iterators (word, sentence, line and character)
  219.      **/
  220.     void doBackwardIndexSelectionTest(BreakIterator& iterator, UnicodeString& testText, Vector* result);
  221.     /**
  222.      * Perform tests of BreakIterator multiple selection functionality 
  223.      * on different kinds of iterators (word, sentence, line and character)
  224.      **/
  225.     void doMultipleSelectionTest(BreakIterator& iterator, UnicodeString& testText);
  226.     /**
  227.      * Perform tests with short sample code
  228.      **/
  229.     void sample(BreakIterator& tb, UnicodeString& text, UnicodeString& title);
  230.  
  231.     void doBreakInvariantTest(BreakIterator& tb, UnicodeString& testChars);
  232.  
  233.     void doOtherInvariantTest(BreakIterator& tb, UnicodeString& testChars);
  234.  
  235.     Vector* lineSelectionData;
  236.     UnicodeString testLineText;
  237.     Vector* sentenceSelectionData;
  238.     UnicodeString testSentenceText;
  239.     Vector* wordSelectionData;
  240.     UnicodeString testWordText;
  241.     Vector* characterSelectionData;
  242.     UnicodeString testCharacterText;
  243.     static const UChar cannedTestArray[];
  244.     static UnicodeString *cannedTestChars;
  245. };
  246.  
  247.  
  248. #endif
  249.