home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Programming / ICU / src / icu / source / test / intltest / tsdate.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-16  |  2.0 KB  |  85 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 _INTLTESTDATEFORMAT
  15. #define _INTLTESTDATEFORMAT
  16.  
  17.  
  18. #include "utypes.h"
  19. #include "intltest.h"
  20.  
  21.  
  22. class DateFormat;
  23.  
  24. /**
  25.  *  Performs some tests in many variations on DateFormat
  26.  **/
  27. class IntlTestDateFormat: public IntlTest {
  28.     void runIndexedTest( int32_t index, bool_t exec, char* &name, char* par = NULL );
  29.     
  30. private:
  31.  
  32.     /**
  33.      *  test DateFormat::getAvailableLocales
  34.      **/
  35.     void testAvailableLocales(char *par);
  36.     /**
  37.      *  call testLocale for all locales
  38.      **/
  39.     void monsterTest(char *par);
  40.  
  41.     /**
  42.      *  call tryDate with variations, called by testLocale
  43.      **/
  44.     void testFormat(char *par);
  45.     /**
  46.      *  perform tests using date and fFormat, called in many variations
  47.      **/
  48.     void tryDate(UDate date);
  49.     /**
  50.      *  call testFormat for different DateFormat::EStyle's, etc
  51.      **/
  52.     void testLocale(char *par, const Locale&, const UnicodeString&);
  53.     /**
  54.      *  return a random number
  55.      **/
  56.     double randDouble(void);
  57.     /**
  58.      * generate description for verbose test output
  59.      **/
  60.     void describeTest(void);
  61.  
  62.     DateFormat *fFormat;
  63.     UnicodeString fTestName;
  64.     int32_t fLimit; // How many iterations it should take to reach convergence
  65.  
  66.     enum
  67.     {
  68.         // Values in milliseconds (== Date)
  69.         ONESECOND = 1000,
  70.         ONEMINUTE = 60 * ONESECOND,
  71.         ONEHOUR = 60 * ONEMINUTE,
  72.         ONEDAY = 24 * ONEHOUR
  73.     };
  74.     static const double ONEYEAR;
  75.     enum EMode
  76.     {
  77.         GENERIC,
  78.         TIME,
  79.         DATE,
  80.         DATE_TIME
  81.     };
  82. };
  83.  
  84. #endif
  85.