1 // Copyright (C) 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /********************************************************************
5 * Copyright (c) 2003-2008, International Business Machines Corporation
6 * and others. All Rights Reserved.
7 ********************************************************************
8 * Calendar Case Test is a type of CalendarTest which compares the
9 * behavior of a calendar to a certain set of 'test cases', involving
10 * conversion between julian-day to fields and vice versa.
11 ********************************************************************/
13 #ifndef __CalendarCaseTest__
14 #define __CalendarCaseTest__
16 #include "unicode/utypes.h"
18 #if !UCONFIG_NO_FORMATTING
20 #include "unicode/calendar.h"
21 #include "unicode/smpdtfmt.h"
24 class CalendarCaseTest: public CalendarTest {
26 virtual void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par );
28 /* Test case struct */
30 double julian; // Julian Date
42 * @param cases array of items to test. Terminate with a "-1" for era.
44 void doTestCases(const TestCase *cases, Calendar *cal);
48 * Utility function to test out a specific field
50 * @param field which field
51 * @param value expected value
52 * @param status err status
53 * @return boolean indicating success (TRUE) or failure (FALSE) of the test.
55 UBool checkField(Calendar *cal, UCalendarDateFields field, int32_t value, UErrorCode &status);