1 /******************************************************************** 2 * COPYRIGHT: 3 * Copyright (c) 1997-2012, International Business Machines Corporation and 4 * others. All Rights Reserved. 5 ********************************************************************/ 6 /******************************************************************************** 7 * 8 * File CAPITEST.H 9 * 10 * Modification History: 11 * Name Description 12 * Madhu Katragadda Creation 13 *********************************************************************************/ 14 /* C API TEST FOR CALENDAR */ 15 #ifndef _CCALTST 16 #define _CCALTST 17 18 #include "unicode/utypes.h" 19 20 #if !UCONFIG_NO_FORMATTING 21 22 #include "cintltst.h" 23 24 25 /** 26 * The function used to test the Calendar API 27 **/ 28 static void TestCalendar(void); 29 /** 30 * The function used to test getMillis, setMillis, setDate and setDateTime functions extensively 31 **/ 32 static void TestGetSetDateAPI(void); 33 /** 34 * This function is used to test and confirm the functioning of 35 * the calendar get and set functions of calendar fields. 36 **/ 37 static void TestFieldGetSet(void); 38 /** 39 * Execute and test adding and rolling extensively. 40 **/ 41 static void TestAddRollExtensive(void); 42 /** 43 *Testing the Limits for various Fields of Calendar 44 **/ 45 static void TestGetLimits(void); 46 /** 47 * Test that the days of the week progress properly when add is called repeatedly 48 * for increments of 24 days. 49 **/ 50 static void TestDOWProgression(void); 51 /** 52 * Confirm that the offset between local time and GMT behaves as expected. 53 **/ 54 static void TestGMTvsLocal(void); 55 /** 56 * test subroutine used by TestGMTvsLocal() 57 */ 58 static void testZones(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); 59 /** 60 * Test getKeywordValuesForLocale API 61 */ 62 static void TestGetKeywordValuesForLocale(void); 63 /** 64 * Test weekend-related APIs 65 */ 66 static void TestWeekend(void); 67 /** 68 * Test ambiguous wall time 69 */ 70 static void TestAmbiguousWallTime(void); 71 72 /*Internal functions used*/ 73 /** 74 * test subroutines used by TestAddRollExtensive() 75 **/ 76 static void checkDate(UCalendar* c, int32_t y, int32_t m, int32_t d); 77 78 static void checkDateTime(UCalendar* c, int32_t y, int32_t m, int32_t d, 79 int32_t hr, int32_t min, int32_t sec, int32_t ms, 80 UCalendarDateFields field); 81 82 /** 83 * test subroutines used by TestGetSetDateAPI and TestFieldGetSet 84 **/ 85 static void verify1(const char* msg, UCalendar* c, UDateFormat* dat, int32_t year, int32_t month, int32_t day); 86 87 static void verify2(const char* msg, UCalendar* c, UDateFormat* dat, int32_t year, int32_t month, int32_t day, 88 int32_t hour, int32_t min, int32_t sec, int32_t am_pm); 89 90 #endif /* #if !UCONFIG_NO_FORMATTING */ 91 92 #endif 93