home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Programming / ICU / src / icu / source / test / intltest / caltest.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-16  |  5.0 KB  |  168 lines

  1.  
  2. /*
  3. ********************************************************************
  4. * COPYRIGHT: 
  5. * (C) Copyright Taligent, Inc., 1997
  6. * (C) Copyright International Business Machines Corporation, 1997 - 1998
  7. * Licensed Material - Program-Property of IBM - All Rights Reserved. 
  8. * US Government Users Restricted Rights - Use, duplication, or disclosure 
  9. * restricted by GSA ADP Schedule Contract with IBM Corp. 
  10. *
  11. ********************************************************************
  12. */
  13.  
  14. #ifndef __CalendarTest__
  15. #define __CalendarTest__
  16.  
  17. #include "utypes.h"
  18. #include "caltztst.h"
  19. #include "calendar.h"
  20.  
  21. class CalendarTest: public CalendarTimeZoneTest {
  22. public:
  23.     // IntlTest override
  24.     void runIndexedTest( int32_t index, bool_t exec, char* &name, char* par );
  25. public:
  26.     /**
  27.      * This test confirms the correct behavior of add when incrementing
  28.      * through subsequent days.
  29.      */
  30.     virtual void TestRog(void);
  31.     /**
  32.      * Test the handling of the day of the week, checking for correctness and
  33.      * for correct minimum and maximum values.
  34.      */
  35.     virtual void TestDOW943(void);
  36.     /**
  37.      * test subroutine use by TestDOW943
  38.      */
  39.     void dowTest(bool_t lenient);
  40.     /** 
  41.      * Confirm that cloned Calendar objects do not inadvertently share substructures.
  42.      */
  43.     virtual void TestClonesUnique908(void);
  44.     /**
  45.      * Confirm that the Gregorian cutoff value works as advertised.
  46.      */
  47.     virtual void TestGregorianChange768(void);
  48.     /**
  49.      * Confirm the functioning of the field disambiguation algorithm.
  50.      */
  51.     virtual void TestDisambiguation765(void);
  52.     /**
  53.      * Test various API methods for API completeness.
  54.      */
  55.     virtual void TestGenericAPI(void); // New to C++ -- needs to be back ported to Java
  56.  
  57. public: // package
  58.     /**
  59.      * test subroutine used by TestDisambiguation765
  60.      */
  61.     virtual void verify765(const UnicodeString& msg, Calendar* c, int32_t year, int32_t month, int32_t day);
  62.     /**
  63.      * test subroutine used by TestDisambiguation765
  64.      */
  65.     virtual void verify765(const UnicodeString& msg/*, IllegalArgumentException e*/, UErrorCode status);
  66.  
  67. public:
  68.     /**
  69.      * Confirm that the offset between local time and GMT behaves as expected.
  70.      */
  71.     virtual void TestGMTvsLocal4064654(void);
  72.  
  73. public: // package
  74.     /**
  75.      * test subroutine used by TestGMTvsLocal4064654
  76.      */
  77.     virtual void test4064654(int32_t yr, int32_t mo, int32_t dt, int32_t hr, int32_t mn, int32_t sc);
  78.  
  79. public:
  80.     /**
  81.      * The operations of adding and setting should not exhibit pathological
  82.      * dependence on the order of operations.  This test checks for this.
  83.      */
  84.     virtual void TestAddSetOrder621(void);
  85.     /**
  86.      * Confirm that adding to various fields works.
  87.      */
  88.     virtual void TestAdd520(void);
  89.     /**
  90.      * Execute and test adding and rolling in GregorianCalendar extensively.
  91.      */
  92.     virtual void TestAddRollExtensive(void);
  93.  
  94. public: // package
  95.     // internal utility routine for checking date
  96.     virtual void check520(Calendar* c, 
  97.                             int32_t y, int32_t m, int32_t d, 
  98.                             int32_t hr, int32_t min, int32_t sec, 
  99.                             int32_t ms, Calendar::EDateFields field);
  100.  
  101.     virtual void check520(Calendar* c, 
  102.                             int32_t y, int32_t m, int32_t d);
  103.  
  104. public:
  105.     /**
  106.      * Test that setting of fields works.  In particular, make sure that all instances
  107.      * of GregorianCalendar don't share a static instance of the fields array.
  108.      */
  109.     virtual void TestFieldSet4781(void);
  110. /*    virtual void TestSerialize337();
  111.  
  112. public: // package
  113.     static UnicodeString& PREFIX;
  114.     static UnicodeString& POSTFIX;
  115.     static UnicodeString& FILENAME;
  116. */ 
  117. public:
  118.     /**
  119.      * Verify that the seconds of a Calendar can be zeroed out through the
  120.      * expected sequence of operations.
  121.      */ 
  122.     virtual void TestSecondsZero121(void);
  123.     /**
  124.      * Verify that a specific sequence of adding and setting works as expected;
  125.      * it should not vary depending on when and whether the get method is
  126.      * called.
  127.      */
  128.     virtual void TestAddSetGet0610(void);
  129.  
  130. public: // package
  131.     // internal routine for checking date
  132.     static UnicodeString value(Calendar* calendar);
  133.     static UnicodeString EXPECTED_0610;
  134.  
  135. public:
  136.     /**
  137.      * Verify that various fields on a known date are set correctly.
  138.      */
  139.     virtual void TestFields060(void);
  140.  
  141. public: // package
  142.     static int32_t EXPECTED_FIELDS[];
  143.     static const int32_t EXPECTED_FIELDS_length;
  144.  
  145. public:
  146.     /**
  147.      * Verify that various fields on a known date are set correctly.  In this
  148.      * case, the start of the epoch (January 1 1970).
  149.      */
  150.     virtual void TestEpochStartFields(void);
  151.  
  152. public: // package
  153.     static int32_t EPOCH_FIELDS[];
  154.  
  155. public:
  156.     /**
  157.      * Test that the days of the week progress properly when add is called repeatedly
  158.      * for increments of 24 days.
  159.      */
  160.     virtual void TestDOWProgression(void);
  161.  
  162. public: // package
  163.     // test subroutine use by TestDOWProgression
  164.     virtual void marchByDelta(Calendar* cal, int32_t delta);
  165. };
  166.  
  167. #endif // __CalendarTest__
  168.