Home | History | Annotate | Download | only in intltest
      1 /********************************************************************
      2  * COPYRIGHT:
      3  * Copyright (c) 1997-2013, International Business Machines Corporation and
      4  * others. All Rights Reserved.
      5  ********************************************************************/
      6 
      7 #ifndef _PluralRulesTest
      8 #define _PluralRulesTest
      9 
     10 #include "unicode/utypes.h"
     11 
     12 #if !UCONFIG_NO_FORMATTING
     13 
     14 #include "intltest.h"
     15 #include "unicode/localpointer.h"
     16 #include "unicode/plurrule.h"
     17 
     18 /**
     19  * Test basic functionality of various API functions
     20  **/
     21 class PluralRulesTest : public IntlTest {
     22     void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
     23 
     24 private:
     25     /**
     26      * Performs tests on many API functions, see detailed comments in source code
     27      **/
     28     void testAPI();
     29     void testGetUniqueKeywordValue();
     30     void testGetSamples();
     31     void testWithin();
     32     void testGetAllKeywordValues();
     33     void testOrdinal();
     34     void testSelect();
     35     void testAvailbleLocales();
     36     void testParseErrors();
     37     void testFixedDecimal();
     38 
     39     void assertRuleValue(const UnicodeString& rule, double expected);
     40     void assertRuleKeyValue(const UnicodeString& rule, const UnicodeString& key,
     41                             double expected);
     42     void checkSelect(const LocalPointer<PluralRules> &rules, UErrorCode &status,
     43                                   int32_t line, const char *keyword, ...);
     44 };
     45 
     46 #endif /* #if !UCONFIG_NO_FORMATTING */
     47 
     48 #endif
     49