Home | History | Annotate | Download | only in intltest
      1 /********************************************************************
      2  * COPYRIGHT:
      3  * Copyright (c) 2008, International Business Machines Corporation and
      4  * others. All Rights Reserved.
      5  ********************************************************************/
      6 
      7 #ifndef _INTLTESTDATEINTERVALFORMAT
      8 #define _INTLTESTDATEINTERVALFORMAT
      9 
     10 #include "unicode/utypes.h"
     11 #include "unicode/locid.h"
     12 
     13 #if !UCONFIG_NO_FORMATTING
     14 
     15 #include "intltest.h"
     16 
     17 /**
     18  * Test basic functionality of various API functions
     19  **/
     20 class DateIntervalFormatTest: public IntlTest {
     21     void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
     22 
     23 public:
     24     /**
     25      * Performs tests on many API functions, see detailed comments in source code
     26      **/
     27     void testAPI();
     28 
     29     /**
     30      * Test formatting
     31      */
     32     void testFormat();
     33 
     34     /**
     35      * Test formatting using user defined DateIntervalInfo
     36      */
     37     void testFormatUserDII();
     38 
     39     /**
     40      * Stress test -- stress test formatting on 40 locales
     41      */
     42     void testStress();
     43 
     44 private:
     45     /**
     46      * Test formatting against expected result
     47      */
     48     void expect(const char** data, int32_t data_length);
     49 
     50     /**
     51      * Test formatting against expected result using user defined
     52      * DateIntervalInfo
     53      */
     54     void expectUserDII(const char** data, int32_t data_length);
     55 
     56     /**
     57      * Stress test formatting
     58      */
     59     void stress(const char** data, int32_t data_length, const Locale& loc,
     60                 const char* locName);
     61 };
     62 
     63 #endif /* #if !UCONFIG_NO_FORMATTING */
     64 
     65 #endif
     66