Home | History | Annotate | Download | only in unit
      1 #include <string>
      2 #if !defined (STLPORT) || !defined (_STLP_USE_NO_IOSTREAMS)
      3 #  include <iosfwd>
      4 
      5 #  include "cppunit/cppunit_proxy.h"
      6 #  include <locale>
      7 
      8 struct ref_monetary;
      9 struct ref_locale;
     10 
     11 #  if !defined (STLPORT) || defined (_STLP_USE_NAMESPACES)
     12 #    define STD std::
     13 #  else
     14 #    define STD
     15 #  endif
     16 
     17 //
     18 // TestCase class
     19 //
     20 class LocaleTest : public CPPUNIT_NS::TestCase
     21 {
     22   CPPUNIT_TEST_SUITE(LocaleTest);
     23 #  if defined (STLPORT) && !defined (_STLP_USE_EXCEPTIONS)
     24   CPPUNIT_IGNORE;
     25 #  endif
     26   CPPUNIT_TEST(locale_by_name);
     27   CPPUNIT_TEST(moneypunct_by_name);
     28   CPPUNIT_TEST(time_by_name);
     29   CPPUNIT_TEST(numpunct_by_name);
     30   CPPUNIT_TEST(ctype_by_name);
     31   CPPUNIT_TEST(collate_by_name);
     32   CPPUNIT_TEST(messages_by_name);
     33   CPPUNIT_STOP_IGNORE;
     34   CPPUNIT_TEST(loc_has_facet);
     35   CPPUNIT_TEST(num_put_get);
     36   CPPUNIT_TEST(money_put_get);
     37   CPPUNIT_TEST(money_put_X_bug);
     38   CPPUNIT_TEST(time_put_get);
     39   CPPUNIT_TEST(collate_facet);
     40   CPPUNIT_TEST(ctype_facet);
     41 #  if defined (STLPORT) && defined (_STLP_NO_MEMBER_TEMPLATES)
     42   CPPUNIT_IGNORE;
     43 #  endif
     44   CPPUNIT_TEST(locale_init_problem);
     45   CPPUNIT_STOP_IGNORE;
     46   CPPUNIT_TEST(default_locale);
     47 #  if !defined (STLPORT)
     48   CPPUNIT_IGNORE;
     49 #  endif
     50   CPPUNIT_STOP_IGNORE;
     51 #if (defined (STLPORT) && \
     52    (!defined (_STLP_USE_EXCEPTIONS) || defined (_STLP_NO_MEMBER_TEMPLATES) || defined (_STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS)))
     53   CPPUNIT_IGNORE;
     54 #  endif
     55   CPPUNIT_TEST(combine);
     56   CPPUNIT_TEST_SUITE_END();
     57 
     58 public:
     59   void locale_by_name();
     60   void loc_has_facet();
     61   void num_put_get();
     62   void numpunct_by_name();
     63   void time_put_get();
     64   void time_by_name();
     65   void collate_facet();
     66   void collate_by_name();
     67   void ctype_facet();
     68   void ctype_by_name();
     69   void locale_init_problem();
     70   void money_put_get();
     71   void money_put_X_bug();
     72   void moneypunct_by_name();
     73   void default_locale();
     74   void combine();
     75   void messages_by_name();
     76 private:
     77   void _loc_has_facet( const STD locale& );
     78   void _num_put_get( const STD locale&, const ref_locale* );
     79   void _time_put_get( const STD locale& );
     80   void _ctype_facet( const STD locale& );
     81   void _ctype_facet_w( const STD locale& );
     82   void _locale_init_problem( const STD locale& );
     83 
     84   static const ref_monetary* _get_ref_monetary(size_t);
     85   static const char* _get_ref_monetary_name(const ref_monetary*);
     86 
     87   void _money_put_get( const STD locale&, const ref_monetary* );
     88   void _money_put_get2( const STD locale& loc, const STD locale& streamLoc, const ref_monetary* );
     89   void _money_put_X_bug( const STD locale&, const ref_monetary* );
     90 };
     91 
     92 #  undef STD
     93 #endif
     94 
     95