Home | History | Annotate | Download | only in intltest
      1 // Copyright (C) 2016 and later: Unicode, Inc. and others.
      2 // License & terms of use: http://www.unicode.org/copyright.html
      3 /********************************************************************
      4  * COPYRIGHT:
      5  * Copyright (c) 2008-2016 International Business Machines Corporation and
      6  * others. All Rights Reserved.
      7  ********************************************************************/
      8 
      9 #ifndef _INTLTESTDATEINTERVALFORMAT
     10 #define _INTLTESTDATEINTERVALFORMAT
     11 
     12 #include "unicode/utypes.h"
     13 #include "unicode/locid.h"
     14 
     15 #if !UCONFIG_NO_FORMATTING
     16 
     17 #include "intltest.h"
     18 
     19 /**
     20  * Test basic functionality of various API functions
     21  **/
     22 class DateIntervalFormatTest: public IntlTest {
     23     void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
     24 
     25 public:
     26     /**
     27      * Performs tests on many API functions, see detailed comments in source code
     28      **/
     29     void testAPI();
     30 
     31     /**
     32      * Test formatting
     33      */
     34     void testFormat();
     35 
     36     /**
     37      * Test formatting using user defined DateIntervalInfo
     38      */
     39     void testFormatUserDII();
     40 
     41     /**
     42      * Test for no unwanted side effects when setting
     43      * interval patterns.
     44      */
     45     void testSetIntervalPatternNoSideEffect();
     46 
     47     /**
     48      * Tests different year formats.
     49      */
     50     void testYearFormats();
     51 
     52     /**
     53      * Stress test -- stress test formatting on 40 locales
     54      */
     55     void testStress();
     56 
     57     void testTicket11583_2();
     58 
     59     void testTicket11985();
     60 
     61     void testTicket11669();
     62     void threadFunc11669(int32_t threadNum);
     63 
     64     void testTicket12065();
     65 
     66 private:
     67     /**
     68      * Test formatting against expected result
     69      */
     70     void expect(const char** data, int32_t data_length);
     71 
     72     /**
     73      * Test formatting against expected result using user defined
     74      * DateIntervalInfo
     75      */
     76     void expectUserDII(const char** data, int32_t data_length);
     77 
     78     /**
     79      * Stress test formatting
     80      */
     81     void stress(const char** data, int32_t data_length, const Locale& loc,
     82                 const char* locName);
     83 };
     84 
     85 #endif /* #if !UCONFIG_NO_FORMATTING */
     86 
     87 #endif
     88