1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /********************************************************************
5 * Copyright (c) 1997-2012, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 ********************************************************************/
8 /********************************************************************************
12 * Modification History:
14 * Madhu Katragadda Creation
15 *********************************************************************************/
16 /* C API TEST FOR CALENDAR */
20 #include "unicode/utypes.h"
21 #include "unicode/ucal.h"
22 #include "unicode/udat.h"
24 #if !UCONFIG_NO_FORMATTING
30 * The function used to test the Calendar API
32 static void TestCalendar(void);
34 * The function used to test getMillis, setMillis, setDate and setDateTime functions extensively
36 static void TestGetSetDateAPI(void);
38 * This function is used to test and confirm the functioning of
39 * the calendar get and set functions of calendar fields.
41 static void TestFieldGetSet(void);
43 * Execute and test adding and rolling extensively.
45 static void TestAddRollExtensive(void);
47 *Testing the Limits for various Fields of Calendar
49 static void TestGetLimits(void);
51 * Test that the days of the week progress properly when add is called repeatedly
52 * for increments of 24 days.
54 static void TestDOWProgression(void);
56 * Confirm that the offset between local time and GMT behaves as expected.
58 static void TestGMTvsLocal(void);
60 * test subroutine used by TestGMTvsLocal()
62 static void testZones(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
64 * Test getKeywordValuesForLocale API
66 static void TestGetKeywordValuesForLocale(void);
68 * Test weekend-related APIs
70 static void TestWeekend(void);
72 * Test ambiguous wall time
74 static void TestAmbiguousWallTime(void);
76 /*Internal functions used*/
78 * test subroutines used by TestAddRollExtensive()
80 static void checkDate(UCalendar
* c
, int32_t y
, int32_t m
, int32_t d
);
82 static void checkDateTime(UCalendar
* c
, int32_t y
, int32_t m
, int32_t d
,
83 int32_t hr
, int32_t min
, int32_t sec
, int32_t ms
,
84 UCalendarDateFields field
);
87 * test subroutines used by TestGetSetDateAPI and TestFieldGetSet
89 static void verify1(const char* msg
, UCalendar
* c
, UDateFormat
* dat
, int32_t year
, int32_t month
, int32_t day
);
91 static void verify2(const char* msg
, UCalendar
* c
, UDateFormat
* dat
, int32_t year
, int32_t month
, int32_t day
,
92 int32_t hour
, int32_t min
, int32_t sec
, int32_t am_pm
);
94 #endif /* #if !UCONFIG_NO_FORMATTING */