summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu/icu-xetex/test/intltest/calcasts.h
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2009-04-20 18:13:48 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2009-04-20 18:13:48 +0000
commite5786f530f9555469c01435f86039b06aa53feba (patch)
treec868e8d32282422d7d445b729db95c3fcdafb6d0 /Build/source/libs/icu/icu-xetex/test/intltest/calcasts.h
parentebaa1768b43c8606d923d2e861b5286b74207b3e (diff)
new build system: build icu libs and xetex plus misc updates
git-svn-id: svn://tug.org/texlive/trunk@12759 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/icu/icu-xetex/test/intltest/calcasts.h')
-rw-r--r--Build/source/libs/icu/icu-xetex/test/intltest/calcasts.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/Build/source/libs/icu/icu-xetex/test/intltest/calcasts.h b/Build/source/libs/icu/icu-xetex/test/intltest/calcasts.h
new file mode 100644
index 00000000000..6085c229f70
--- /dev/null
+++ b/Build/source/libs/icu/icu-xetex/test/intltest/calcasts.h
@@ -0,0 +1,63 @@
+/********************************************************************
+ * COPYRIGHT:
+ * Copyright (c) 2003-2007, International Business Machines Corporation
+ * and others. All Rights Reserved.
+ ********************************************************************
+ * Calendar Case Test is a type of CalendarTest which compares the
+ * behavior of a calendar to a certain set of 'test cases', involving
+ * conversion between julian-day to fields and vice versa.
+ ********************************************************************/
+
+#ifndef __CalendarCaseTest__
+#define __CalendarCaseTest__
+
+#include "unicode/utypes.h"
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/calendar.h"
+#include "unicode/smpdtfmt.h"
+#include "caltest.h"
+
+class CalendarCaseTest: public CalendarTest {
+ public:
+ virtual void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par );
+
+ /* Test case struct */
+ struct TestCase {
+ double julian; // Julian Date
+ int32_t era;
+ int32_t year;
+ int32_t month;
+ int32_t day;
+ int32_t dayOfWeek;
+ int32_t hour;
+ int32_t min;
+ int32_t sec;
+ };
+
+ /**
+ * @param cases array of items to test. Terminate with a "-1" for era.
+ */
+ void doTestCases(const TestCase *cases, Calendar *cal);
+
+ private:
+ /**
+ * Utility function to test out a specific field
+ * @param cal calendar
+ * @param field which field
+ * @param value expected value
+ * @param status err status
+ * @return boolean indicating success (TRUE) or failure (FALSE) of the test.
+ */
+ UBool checkField(Calendar *cal, UCalendarDateFields field, int32_t value, UErrorCode &status);
+
+ private:
+ // test cases
+ void IslamicCivil();
+ void Hebrew();
+ void Indian();
+};
+
+#endif
+#endif