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) 1997-2016 International Business Machines Corporation and 6 * others. All Rights Reserved. 7 ********************************************************************/ 8 9 #ifndef _INTLTESTDATETIMEPATTERNGENERATORAPI 10 #define _INTLTESTDATETIMEPATTERNGENERATORAPI 11 12 #include "unicode/utypes.h" 13 14 #if !UCONFIG_NO_FORMATTING 15 16 #include "unicode/dtptngen.h" 17 #include "unicode/ustring.h" 18 #include "intltest.h" 19 20 /** 21 * Test basic functionality of various API functions 22 **/ 23 class IntlTestDateTimePatternGeneratorAPI : public IntlTest { 24 void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL ) override; 25 26 private: 27 /** 28 * Performs tests on many API functions, see detailed comments in source code 29 **/ 30 void testAPI(/* char* par */); 31 void testOptions(/* char* par */); 32 void testAllFieldPatterns(/* char* par */); 33 void testStaticGetSkeleton(/* char* par */); 34 void testC(); 35 void testSkeletonsWithDayPeriods(); 36 void testGetFieldDisplayNames(); 37 void testJjMapping(); 38 void test20640_HourCyclArsEnNH(); 39 void testFallbackWithDefaultRootLocale(); 40 void testGetDefaultHourCycle_OnEmptyInstance(); 41 void test_jConsistencyOddLocales(); 42 void testBestPattern(); 43 void testDateTimePatterns(); 44 void testRegionOverride(); 45 46 enum { kNumDateTimePatterns = 4 }; 47 typedef struct { 48 const char* localeID; 49 const UnicodeString expectPat[kNumDateTimePatterns]; 50 } DTPLocaleAndResults; 51 void doDTPatternTest(DateTimePatternGenerator* dtpg, UnicodeString* skeletons, DTPLocaleAndResults* localeAndResultsPtr); 52 }; 53 54 #endif /* #if !UCONFIG_NO_FORMATTING */ 55 56 #endif 57