]> git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/dtifmtts.h
ICU-66108.tar.gz
[apple/icu.git] / icuSources / test / intltest / dtifmtts.h
1 // © 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 #include "itformat.h"
19
20 /**
21 * Test basic functionality of various API functions
22 **/
23 class DateIntervalFormatTest: public IntlTestWithFieldPosition {
24 void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
25
26 public:
27 /**
28 * Performs tests on many API functions, see detailed comments in source code
29 **/
30 void testAPI();
31
32 /**
33 * Test formatting
34 */
35 void testFormat();
36
37 /**
38 * Test formatting using user defined DateIntervalInfo
39 */
40 void testFormatUserDII();
41
42 /**
43 * Test for no unwanted side effects when setting
44 * interval patterns.
45 */
46 void testSetIntervalPatternNoSideEffect();
47
48 /**
49 * Tests different year formats.
50 */
51 void testYearFormats();
52
53 /**
54 * Stress test -- stress test formatting on 40 locales
55 */
56 void testStress();
57
58 void testTicket11583_2();
59
60 void testTicket11985();
61
62 void testTicket11669();
63 void threadFunc11669(int32_t threadNum);
64
65 void testTicket12065();
66
67 void testFormattedDateInterval();
68 void testCreateInstanceForAllLocales();
69
70 private:
71 /**
72 * Test formatting against expected result
73 */
74 void expect(const char** data, int32_t data_length);
75
76 /**
77 * Test formatting against expected result using user defined
78 * DateIntervalInfo
79 */
80 void expectUserDII(const char** data, int32_t data_length);
81
82 /**
83 * Stress test formatting
84 */
85 void stress(const char** data, int32_t data_length, const Locale& loc,
86 const char* locName);
87 };
88
89 #endif /* #if !UCONFIG_NO_FORMATTING */
90
91 #endif