/********************************************************************
- * COPYRIGHT:
- * Copyright (c) 1997-2014, International Business Machines Corporation and
+ * COPYRIGHT:
+ * Copyright (c) 1997-2016, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
#if U_NO_DEFAULT_INCLUDE_UTF_HEADERS
/* deprecated - make tests pass with U_NO_DEFAULT_INCLUDE_UTF_HEADERS */
-#include "unicode/utf_old.h"
-#endif
-
-/**
- * \def ICU_USE_THREADS
- *
- * Enables multi-threaded testing. Moved here from uconfig.h.
- * Default: enabled
- *
- * This switch used to allow thread support (use of mutexes) to be compiled out of ICU.
- */
-#ifdef ICU_USE_THREADS
- /* Use the predefined value. */
-#elif defined(APP_NO_THREADS)
- /* APP_NO_THREADS is an old symbol. We'll honour it if present. */
-# define ICU_USE_THREADS 0
-#else
-# define ICU_USE_THREADS 1
+#include "unicode/utf_old.h"
#endif
U_NAMESPACE_USE
/**
* Replaces isICUVersionAtLeast and isICUVersionBefore
* log that an issue is known.
- * Usually used this way:
+ * Usually used this way:
* <code>if( ... && logKnownIssue("12345", "some bug")) continue; </code>
* @param ticket ticket string, "12345" or "cldrbug:1234"
* @param message optional message string
void errcheckln(UErrorCode status, const char *fmt, ...);
// Print ALL named errors encountered so far
- void printErrors();
+ void printErrors();
// print known issues. return TRUE if there were any.
UBool printKnownIssues();
-
+
virtual void usage( void ) ;
/**
*/
static float random();
+
+ /**
+ * Integer random numbers, similar to C++ std::minstd_rand, with the same algorithm
+ * and constants. Allow additional access to internal state, for use by monkey tests,
+ * which need to recreate previous random sequences beginning near a failure point.
+ */
+ class icu_rand {
+ public:
+ icu_rand(uint32_t seed = 1);
+ ~icu_rand();
+ void seed(uint32_t seed);
+ uint32_t operator()();
+ /**
+ * Get a seed corresponding to the current state of the generator.
+ * Seeding any generator with this value will cause it to produce the
+ * same sequence as this one will from this point forward.
+ */
+ uint32_t getSeed();
+ private:
+ uint32_t fLast;
+ };
+
+
+
enum { kMaxProps = 16 };
virtual void setProperty(const char* propline);
UBool actual);
UBool assertEquals(const char* message, int32_t expected, int32_t actual);
UBool assertEquals(const char* message, int64_t expected, int64_t actual);
+ UBool assertEquals(const char* message, double expected, double actual);
#if !UCONFIG_NO_FORMATTING
UBool assertEquals(const char* message, const Formattable& expected,
const Formattable& actual, UBool possibleDataError=FALSE);
int32_t dataErrorCount;
IntlTest* caller;
char* testPath; // specifies subtests
-
+
char basePath[1024];
char currName[1024]; // current test name