/*
* Macro for assert style tests.
*/
-#define TEST_ASSERT(expr) \
-if (!(expr)) { \
- log_err("FAILED Assertion \"" #expr "\" at %s:%d.\n", __FILE__, __LINE__); \
-}
+#define TEST_ASSERT(expr) UPRV_BLOCK_MACRO_BEGIN { \
+ if (!(expr)) { \
+ log_err("FAILED Assertion \"" #expr "\" at %s:%d.\n", __FILE__, __LINE__); \
+ } \
+} UPRV_BLOCK_MACRO_END
/*
char expectedResult[300];
/* check that local buffers are big enough for the test case */
- if (sizeof(buf) <= bufCap) {
+ if ((int32_t)sizeof(buf) <= bufCap) {
log_err("At file:line %s:%d, requested bufCap too large.\n");
return;
}
static UBool gFnFormatError = FALSE;
static void U_CALLCONV testTraceEntry(const void *context, int32_t fnNumber) {
+ (void)context; // suppress compiler warnings about unused variable
const char *fnName;
const char *bogusFnName;
static void U_CALLCONV testTraceExit(const void *context, int32_t fnNumber,
const char *fmt, va_list args) {
+ (void)context; // suppress compiler warnings about unused variable
char buf[1000];
const char *fnName;
const char *bogusFnName;
static void U_CALLCONV testTraceData(const void *context, int32_t fnNumber, int32_t level,
const char *fmt, va_list args) {
+ // suppress compiler warnings about unused variables
+ (void)context;
+ (void)level;
char buf[1000];
const char *fnName;
const char *bogusFnName;
/* printf(" %s() %s\n", fnName, buf); */
}
-static UConverter * psuedo_ucnv_open(const char *name, UErrorCode * err)
+#if !ENABLE_TRACING_ORIG_VAL
+static UConverter * pseudo_ucnv_open(const char *name, UErrorCode * err)
{
UTRACE_ENTRY_OC(UTRACE_UCNV_LOAD);
UTRACE_EXIT_PTR_STATUS(NULL, *err);
return NULL;
}
-static void psuedo_ucnv_close(UConverter * cnv)
+static void pseudo_ucnv_close(UConverter * cnv)
{
UTRACE_ENTRY_OC(UTRACE_UCNV_UNLOAD);
UTRACE_DATA1(UTRACE_OPEN_CLOSE, "unload converter %p", cnv);
UTRACE_EXIT_VALUE((int32_t)TRUE);
}
-
+#endif
/*
* TestTraceAPI
TEST_ASSERT(U_SUCCESS(status));
ucnv_close(cnv);
#else
- cnv = psuedo_ucnv_open(NULL, &status);
+ cnv = pseudo_ucnv_open(NULL, &status);
TEST_ASSERT(U_SUCCESS(status));
- psuedo_ucnv_close(cnv);
+ pseudo_ucnv_close(cnv);
#endif
TEST_ASSERT(gTraceEntryCount > 0);
TEST_ASSERT(gTraceExitCount > 0);