/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2012, International Business Machines Corporation and
+ * Copyright (c) 1997-2013, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/********************************************************************************
#include "unicode/putil.h"
#include "cstring.h"
#include "cintltst.h"
-#include "umutex.h"
#include "uassert.h"
#include "cmemory.h"
#include "unicode/uchar.h"
} /* End of loop that repeats the entire test, if requested. (Normally doesn't loop) */
- if (ALLOCATION_COUNT > 0) {
- fprintf(stderr, "There were %d blocks leaked!\n", ALLOCATION_COUNT);
- nerrors++;
- }
endTime = uprv_getRawUTCtime();
diffTime = (int32_t)(endTime - startTime);
printf("Elapsed Time: %02d:%02d:%02d.%03d\n",
#define VERBOSE_ASSERTIONS
-U_CFUNC UBool assertSuccess(const char* msg, UErrorCode* ec) {
+U_CFUNC UBool assertSuccessCheck(const char* msg, UErrorCode* ec, UBool possibleDataError) {
U_ASSERT(ec!=NULL);
if (U_FAILURE(*ec)) {
- log_err_status(*ec, "FAIL: %s (%s)\n", msg, u_errorName(*ec));
+ if (possibleDataError) {
+ log_data_err("FAIL: %s (%s)\n", msg, u_errorName(*ec));
+ } else {
+ log_err_status(*ec, "FAIL: %s (%s)\n", msg, u_errorName(*ec));
+ }
return FALSE;
}
return TRUE;
}
+U_CFUNC UBool assertSuccess(const char* msg, UErrorCode* ec) {
+ U_ASSERT(ec!=NULL);
+ return assertSuccessCheck(msg, ec, FALSE);
+}
+
/* if 'condition' is a UBool, the compiler complains bitterly about
expressions like 'a > 0' which it evaluates as int */
U_CFUNC UBool assertTrue(const char* msg, int /*not UBool*/ condition) {
#endif
return TRUE;
}
-/*--------------------------------------------------------------------
- * Time bomb - allows temporary behavior that expires at a given
- * release
- *--------------------------------------------------------------------
- */
-
-U_CFUNC UBool isICUVersionBefore(int major, int minor, int milli) {
- UVersionInfo iv;
- UVersionInfo ov;
- ov[0] = (uint8_t)major;
- ov[1] = (uint8_t)minor;
- ov[2] = (uint8_t)milli;
- ov[3] = 0;
- u_getVersion(iv);
- return uprv_memcmp(iv, ov, U_MAX_VERSION_LENGTH) < 0;
-}
-
-U_CFUNC UBool isICUVersionAtLeast(int major, int minor, int milli) {
- return !isICUVersionBefore(major, minor, milli);
-}
#endif