errorCode = U_ZERO_ERROR;
currentBundleKey = ures_getKey(currentBundle);
+ (void)currentBundleKey; /* Suppress set but not used warning. */
subBundle = ures_getNextResource(currentBundle, NULL, &errorCode);
if (U_FAILURE(errorCode)) {
log_err("Can't open a resource for lnocale %s. Error: %s\n", locale, u_errorName(errorCode));
locale);
}
}
+ (void)sameArray; /* Suppress set but not used warning. */
/* if (sameArray && strcmp(rootName, "root") == 0) {
log_err("Arrays are the same with key \"%s\" in \"%s\" from root for locale \"%s\"\n",
subBundleKey,
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2012, International Business Machines Corporation and
+ * Copyright (c) 1997-2013, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/********************************************************************************
log_verbose("About to test unum_parseInt64() with out of range number\n");
a = unum_parseInt64(nf, text, size, 0, status);
+ (void)a; /* Suppress set but not used warning. */
if(!U_FAILURE(*status))
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2010, International Business Machines Corporation and
+ * Copyright (c) 1997-2013, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/*******************************************************************************
/* clear it out.. just do some calls to get the gears turning */
junk = ures_getStringByKey(fr_FR, "LocaleID", &resultLen, &status);
+ (void)junk; /* Suppress set but not used warning. */
status = U_ZERO_ERROR;
junk = ures_getStringByKey(fr_FR, "LocaleString", &resultLen, &status);
status = U_ZERO_ERROR;
int32_t len = 0;
int32_t intResult = 0;
const UChar *zeroString;
- const int32_t *zeroIntVect;
+ const int32_t *zeroIntVect = NULL;
strcpy(action, "Construction of testtypes bundle");
testdatapath=loadTestData(&status);
}
else {
zeroIntVect=ures_getIntVector(res, &len, &status);
+ (void)zeroIntVect; /* Suppress set but not used warning. */
if(!U_SUCCESS(status) || resArray != NULL || len != 0) {
log_err("Shouldn't get emptyintv\n");
}
}
else {
binResult=ures_getBinary(res, &len, &status);
+ (void)binResult; /* Suppress set but not used warning. */
if(!U_SUCCESS(status) || len != 0) {
log_err("Couldn't get emptybin, or it's not empty\n");
}
CONFIRM_ErrorCode(status, U_ZERO_ERROR);
CONFIRM_INT_EQ(ures_getType(binColl), URES_BINARY);
binResult=(uint8_t*)ures_getBinary(binColl, &len, &status);
+ (void)binResult; /* Suppress set but not used warning. */
if(U_SUCCESS(status)){
CONFIRM_ErrorCode(status, U_ZERO_ERROR);
CONFIRM_INT_GE(len, 1);
teFillin=ures_getByKey(teRes, "tagged_array_in_te_te_IN", teFillin, &status);
key=ures_getKey(teFillin);
value=(UChar*)ures_getNextString(teFillin, &len, &key, &status);
+ (void)value; /* Suppress set but not used warning. */
ures_resetIterator(NULL);
value=(UChar*)ures_getNextString(teFillin, &len, &key, &status);
if(status !=U_INDEX_OUTOFBOUNDS_ERROR){
status = U_ZERO_ERROR;
junk = tres_getString(fr_FR, -1, "LocaleID", &resultLen, &status);
status = U_ZERO_ERROR;
+ (void)junk; /* Suppress set but not used warning. */
/* OK first one. This should be a Default value. */
subResource = ures_getByKey(fr_FR, "MeasurementSystem", NULL, &status);
len = ures_getFunctionalEquivalent(equivLocale, 255, U_ICUDATA_COLL,
"calendar", "calendar", "ar_EG@calendar=islamic",
&gotAvail, FALSE, &status);
+ (void)len; /* Suppress set but not used warning. */
if(status == U_MISSING_RESOURCE_ERROR) {
log_verbose("PASS: Got expected U_MISSING_RESOURCE_ERROR\n");
status = U_ZERO_ERROR;
length8 = (int32_t)sizeof(buffer8);
s8 = ures_getUTF8StringByKey(res, "string_only_in_Root", buffer8, &length8, FALSE, &status);
+ (void)s8; /* Suppress set but not used warning. */
if(status != U_ZERO_ERROR) {
log_err("ures_getUTF8StringByKey(testdata/root string) malfunctioned - %s\n", u_errorName(status));
}
/*
*******************************************************************************
*
-* Copyright (C) 2002-2009, International Business Machines
+* Copyright (C) 2002-2013, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
lenMixed=u_strlen(mixed);
lenOtherDefault=u_strlen(otherDefault);
+ (void)lenOtherDefault; /* Suppress set but not used warning. */
lenOtherExcludeSpecialI=u_strlen(otherExcludeSpecialI);
lenDifferent=u_strlen(different);
/* if unicodeVersion()>=3.1 then test exclude-special-i cases as well */
u_getUnicodeVersion(unicodeVersion);
isUnicode_3_1= uprv_memcmp(unicodeVersion, unicode_3_1, 4)>=0;
+ (void)isUnicode_3_1; /* Suppress set but not used warning. */
/* test u_strcasecmp() */
result=u_strcasecmp(mixed, otherDefault, U_FOLD_CASE_DEFAULT);
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 2001-2011, International Business Machines Corporation and
+ * Copyright (c) 2001-2013, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/********************************************************************************
err = U_ZERO_ERROR;
wl = (int32_t)uprv_wcslen(wcs);
cp = u_strFromWCS(rts, rtcap, &rtl, wcs, wl, &err);
+ (void)cp; /* Suppress set but not used warning. */
if (U_FAILURE(err)) {
errname = u_errorName(err);
fprintf(stderr, "test_widestrs: ucnv_wcstombs error: %s!\n",errname);
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1999-2006, International Business Machines Corporation and
+ * Copyright (c) 1999-2013, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
#include "unicode/utypes.h"
target,
targetSize,
&err);
+ (void)euroBackSize; /* Suppress set but not used warning. */
if (U_FAILURE(err))
{
log_err("Failure Occured in ucnv_toUChars euro roundtrip test\n");
/*
*******************************************************************************
*
- * Copyright (C) 2003-2010, International Business Machines
+ * Copyright (C) 2003-2013, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
UErrorCode status = U_ZERO_ERROR;
UParseError prsError;
int32_t outLen = uidna_toUnicode(invalid_idn, len, output, 50, UIDNA_DEFAULT, &prsError, &status);
+ (void)outLen; /* Suppress set but not used warning. */
if(U_FAILURE(status)){
log_err_status(status, "uidna_toUnicode failed with error: %s\n", u_errorName(status));
}
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 2004-2012, International Business Machines Corporation and
+ * Copyright (c) 2004-2013, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/********************************************************************************
utext_close(resultText);
result = uregex_getText(re, &textLength, &status); /* flattens UText into buffer */
+ (void)result; /* Suppress set but not used warning. */
TEST_ASSERT(textLength == -1 || textLength == 6);
resultText = uregex_getUText(re, NULL, &status);
TEST_ASSERT_SUCCESS(status);
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 2003-2007, International Business Machines Corporation and
+ * Copyright (c) 2003-2013, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/*
va_start(args, line);
memset(buf, 0, sizeof(buf));
len = utrace_vformat(buf, bufCap, indent, format, args);
+ (void)len; /* Suppress set but not used warning. */
/* Check results. */
if (strcmp(expectedResult, buf) != 0) {
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 2005-2011, International Business Machines Corporation and
+ * Copyright (c) 2005-2013, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/*
static void TestAPI(void) {
UErrorCode status = U_ZERO_ERROR;
UBool gFailed = FALSE;
+ (void)gFailed; /* Suppress set but not used warning. */
/* Open */
{
/*
****************************************************************************
- * Copyright (c) 1997-2010, International Business Machines Corporation and *
+ * Copyright (c) 1997-2013, International Business Machines Corporation and *
* others. All Rights Reserved. *
****************************************************************************
*/
UErrorCode status = U_ZERO_ERROR;
result = utmscale_fromInt64(0, -1, &status);
+ (void)result; /* Suppress set but not used warning. */
if (status != U_ILLEGAL_ARGUMENT_ERROR) {
log_err("utmscale_fromInt64(0, -1, status) did not set status to U_ILLEGAL_ARGUMENT_ERROR.\n");
}
UErrorCode status = U_ZERO_ERROR;
result = utmscale_toInt64(0, -1, &status);
+ (void)result; /* suppress set but not used warning. */
if (status != U_ILLEGAL_ARGUMENT_ERROR) {
log_err("utmscale_toInt64(0, -1, &status) did not generate U_ILLEGAL_ARGUMENT_ERROR.\n");
}
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2012, International Business Machines Corporation
+ * Copyright (c) 1997-2013, International Business Machines Corporation
* and others. All Rights Reserved.
********************************************************************/
}
UErrorCode status = U_ZERO_ERROR;
count = ids->count(status);
+ (void)count; // Suppress set but not used warning.
SimpleTimeZone *pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, *ids->snext(status));
pdt->setStartRule(UCAL_APRIL, 1, UCAL_SUNDAY, 2 * 60 * 60 * 1000, status);
pdt->setEndRule(UCAL_OCTOBER, -1, UCAL_SUNDAY, 2 * 60 * 60 * 1000, status);
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 2002-2012, International Business Machines Corporation and
+ * Copyright (c) 2002-2013, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
lineNum, UnicodeStringPiece(round).data());
}
- const char *typeStr;
+ const char *typeStr = "Unknown";
UnicodeString result;
UnicodeStringPiece spInput(input);
/*
**********************************************************************
- * Copyright (C) 2004-2011, International Business Machines
+ * Copyright (C) 2004-2013, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* file name: filetst.c
static const UChar emptyStr[] = {0};
char readBuf[512] = "";
char testBuf[512] = "";
+ int32_t n = 0;
if (myFile == NULL) {
log_err("Can't write test file.\n");
}
for (num = -STANDARD_TEST_NUM_RANGE; num < STANDARD_TEST_NUM_RANGE; num++) {
- fscanf(myCFile, "%s", readBuf);
+ /* Note: gcc on Ubuntu complains if return value of scanf is ignored. */
+ n += fscanf(myCFile, "%s", readBuf);
sprintf(testBuf, "%x", (int)num);
if (strcmp(readBuf, testBuf) != 0) {
log_err("%%x Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
}
- fscanf(myCFile, "%s", readBuf);
+ n += fscanf(myCFile, "%s", readBuf);
sprintf(testBuf, "%X", (int)num);
if (strcmp(readBuf, testBuf) != 0) {
log_err("%%X Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
}
- fscanf(myCFile, "%s", readBuf);
+ n += fscanf(myCFile, "%s", readBuf);
sprintf(testBuf, "%o", (int)num);
if (strcmp(readBuf, testBuf) != 0) {
log_err("%%o Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
}
/* fprintf is not compatible on all platforms e.g. the iSeries */
- fscanf(myCFile, "%s", readBuf);
+ n += fscanf(myCFile, "%s", readBuf);
sprintf(testBuf, "%d", (int)num);
if (strcmp(readBuf, testBuf) != 0) {
log_err("%%d Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
}
- fscanf(myCFile, "%s", readBuf);
+ n += fscanf(myCFile, "%s", readBuf);
sprintf(testBuf, "%i", (int)num);
if (strcmp(readBuf, testBuf) != 0) {
log_err("%%i Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
}
- fscanf(myCFile, "%s", readBuf);
+ n += fscanf(myCFile, "%s", readBuf);
sprintf(testBuf, "%f", (double)num);
if (strcmp(readBuf, testBuf) != 0) {
log_err("%%f Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
log_err("%%E Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
}*/
- fscanf(myCFile, "%s", readBuf);
+ n += fscanf(myCFile, "%s", readBuf);
sprintf(testBuf, "%g", (double)num);
if (strcmp(readBuf, testBuf) != 0) {
log_err("%%g Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
}
- fscanf(myCFile, "%s", readBuf);
+ n += fscanf(myCFile, "%s", readBuf);
sprintf(testBuf, "%G", (double)num);
if (strcmp(readBuf, testBuf) != 0) {
log_err("%%G Got: \"%s\", Expected: \"%s\"\n", readBuf, testBuf);
/* Properly eat the newlines */
for (num = 0; num < (int32_t)strlen(C_NEW_LINE); num++) {
- fscanf(myCFile, "%c", &cVal);
+ n += fscanf(myCFile, "%c", &cVal);
if (cVal != C_NEW_LINE[num]) {
log_err("OS newline error\n");
}
}
for (num = 0; num < (int32_t)strlen(C_NEW_LINE); num++) {
- fscanf(myCFile, "%c", &cVal);
+ n += fscanf(myCFile, "%c", &cVal);
if (cVal != C_NEW_LINE[num]) {
log_err("ustdio newline error\n");
}
for (num = 0; num < 0x80; num++) {
cVal = -1;
- fscanf(myCFile, "%c", &cVal);
+ n += fscanf(myCFile, "%c", &cVal);
if (num != cVal) {
log_err("%%c Got: 0x%x, Expected: 0x%x\n", cVal, num);
}
}
+ (void)n;
fclose(myCFile);
}
#endif
va_start(ap, format);
count = u_vfprintf(myFile, format, ap);
+ (void)count; /* Suppress set but not used warning. */
va_end(ap);
u_fclose(myFile);
/*
********************************************************************************
*
-* Copyright (C) 1996-2012, International Business Machines
+* Copyright (C) 1996-2013, International Business Machines
* Corporation and others. All Rights Reserved.
*
********************************************************************************
int32_t
T_CTEST_EXPORT2
-ctest_xml_testcase(const char *classname, const char *name, const char *time, const char *failMsg) {
+ctest_xml_testcase(const char *classname, const char *name, const char *timeSeconds, const char *failMsg) {
if(!XML_FILE) return 0;
- fprintf(XML_FILE, "\t<testcase classname=\"%s:%s\" name=\"%s:%s\" time=\"%s\"", XML_PREFIX, classname, XML_PREFIX, name, time);
+ fprintf(XML_FILE, "\t<testcase classname=\"%s:%s\" name=\"%s:%s\" time=\"%s\"", XML_PREFIX, classname, XML_PREFIX, name, timeSeconds);
if(failMsg) {
fprintf(XML_FILE, ">\n\t\t<failure type=\"err\" message=\"%s\"/>\n\t</testcase>\n", failMsg);
} else {
/*
*******************************************************************************
*
-* Copyright (C) 1999-2012, International Business Machines
+* Copyright (C) 1999-2013, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
Item *newItems = (Item*)uprv_malloc(max * sizeof(items[0]));
Item *oldItems = items;
if(newItems == NULL) {
- fprintf(stderr, "icupkg: Out of memory trying to allocate %lu bytes for %d items\n", max*sizeof(items[0]), max);
+ fprintf(stderr, "icupkg: Out of memory trying to allocate %lu bytes for %d items\n",
+ (unsigned long)max*sizeof(items[0]), max);
exit(U_MEMORY_ALLOCATION_ERROR);
}
if(items && itemCount>0) {