Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: icu46/source/test/intltest/tsnmfmt.h

Issue 5516007: Check in the pristine copy of ICU 4.6... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « icu46/source/test/intltest/tsmthred.cpp ('k') | icu46/source/test/intltest/tsnmfmt.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: icu46/source/test/intltest/tsnmfmt.h
===================================================================
--- icu46/source/test/intltest/tsnmfmt.h (revision 0)
+++ icu46/source/test/intltest/tsnmfmt.h (revision 0)
@@ -0,0 +1,89 @@
+/********************************************************************
+ * COPYRIGHT:
+ * Copyright (c) 1997-2003, International Business Machines Corporation and
+ * others. All Rights Reserved.
+ ********************************************************************/
+
+#ifndef _INTLTESTNUMBERFORMAT
+#define _INTLTESTNUMBERFORMAT
+
+
+#include "unicode/utypes.h"
+
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/numfmt.h"
+#include "unicode/locid.h"
+#include "intltest.h"
+
+
+/**
+ * This test does round-trip testing (format -> parse -> format -> parse -> etc.) of
+ * NumberFormat.
+ */
+class IntlTestNumberFormat: public IntlTest {
+ void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );
+
+private:
+
+ /**
+ * call tryIt with many variations, called by testLocale
+ **/
+ void testFormat(/* char* par */);
+ /**
+ * perform tests using aNumber and fFormat, called in many variations
+ **/
+ void tryIt(double aNumber);
+ /**
+ * perform tests using aNumber and fFormat, called in many variations
+ **/
+ void tryIt(int32_t aNumber);
+ /**
+ * test NumberFormat::getAvailableLocales
+ **/
+ void testAvailableLocales(/* char* par */);
+ /**
+ * call testLocale for all locales
+ **/
+ void monsterTest(/* char *par */);
+ /**
+ * call testFormat for currency, percent and plain number instances
+ **/
+ void testLocale(/* char *par, */const Locale& locale, const UnicodeString& localeName);
+
+ NumberFormat* fFormat;
+ UErrorCode fStatus;
+ Locale fLocale;
+
+public:
+
+ virtual ~IntlTestNumberFormat();
+
+ /*
+ * Return a random double that isn't too large.
+ */
+ static double getSafeDouble(double smallerThanMax);
+
+ /*
+ * Return a random double
+ **/
+ static double randDouble();
+
+ /*
+ * Return a random uint32_t
+ **/
+ static uint32_t randLong();
+
+ /**
+ * Return a random double 0 <= x < 1.0
+ **/
+ static double randFraction()
+ {
+ return (double)randLong() / (double)0xFFFFFFFF;
+ }
+
+};
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
+
+#endif
Property changes on: icu46/source/test/intltest/tsnmfmt.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « icu46/source/test/intltest/tsmthred.cpp ('k') | icu46/source/test/intltest/tsnmfmt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698