ICU-5445 Fix some compiler warnings.

X-SVN-Rev: 22008
This commit is contained in:
George Rhoten 2007-07-17 05:57:55 +00:00
parent 0abc6413d3
commit d1f7d0ed12
5 changed files with 433 additions and 442 deletions

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
* *
* Copyright (C) 2001-2004, International Business Machines *
* Copyright (C) 2001-2007, International Business Machines *
* Corporation and others. All Rights Reserved. *
* *
******************************************************************************

View File

@ -2278,7 +2278,7 @@ static void TestLocDataErrorCodeChaining(void) {
UErrorCode ec = U_USELESS_COLLATOR_ERROR;
ulocdata_open(NULL, &ec);
ulocdata_getExemplarSet(NULL, NULL, 0, ULOCDATA_ES_STANDARD, &ec);
ulocdata_getDelimiter(NULL, ULOCDATA_ES_STANDARD, NULL, -1, &ec);
ulocdata_getDelimiter(NULL, ULOCDATA_DELIMITER_COUNT, NULL, -1, &ec);
ulocdata_getMeasurementSystem(NULL, &ec);
ulocdata_getPaperSize(NULL, NULL, NULL, &ec);
if (ec != U_USELESS_COLLATOR_ERROR) {

View File

@ -2,15 +2,10 @@
* COPYRIGHT:
* Copyright (c) 1997-2007, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/***********************************************************************
***********************************************************************
* Modification history
* Date Name Description
* 07/09/2007 srl Copied from dadrcoll.cpp
* 02/14/2001 synwee Compare with cintltst and commented away tests
* that are not run.
***********************************************************************/
#include "unicode/utypes.h"
@ -121,8 +116,8 @@ int32_t CalendarFieldsSet::get(UCalendarDateFields field) const {
}
/**
* set the specified fields on this calendar. Doesn't clear first. Returns any errors the caller
*/
* set the specified fields on this calendar. Doesn't clear first. Returns any errors the caller
*/
void CalendarFieldsSet::setOnCalendar(Calendar *cal, UErrorCode& status) const {
for(int i=0;i<UDAT_FIELD_COUNT;i++) {
if(isSet((UCalendarDateFields)i)) {
@ -236,19 +231,15 @@ int32_t CalendarFieldsSet::parseFrom(const UnicodeString& str, CalendarFieldsSet
DataDrivenCalendarTest::DataDrivenCalendarTest()
: // seq(StringCharacterIterator("")),
status(U_ZERO_ERROR)
//sequences(status)
//: status(U_ZERO_ERROR)
{
UErrorCode status = U_ZERO_ERROR;
driver = TestDataModule::getTestDataModule("calendar", *this, status);
//sequences.setDeleter(deleteSeqElement);
//UCA = (RuleBasedCalendar*)Calendar::createInstance("root", status);
}
DataDrivenCalendarTest::~DataDrivenCalendarTest()
{
delete driver;
//delete UCA;
}
void DataDrivenCalendarTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par */)
@ -259,6 +250,7 @@ void DataDrivenCalendarTest::runIndexedTest( int32_t index, UBool exec, const ch
// logln("Begin ");
}
const DataMap *info = NULL;
UErrorCode status = U_ZERO_ERROR;
TestData *testData = driver->createTestData(index, status);
if(U_SUCCESS(status)) {
name = testData->getName();
@ -270,8 +262,7 @@ void DataDrivenCalendarTest::runIndexedTest( int32_t index, UBool exec, const ch
logln("---");
logln("");
processTest(testData);
processTest(testData, status);
}
delete testData;
} else {
@ -281,8 +272,6 @@ void DataDrivenCalendarTest::runIndexedTest( int32_t index, UBool exec, const ch
errln("format/DataDrivenTest data (calendar.res) not initialized!");
name = "";
}
}
// Reads the options string and sets appropriate attributes in Calendar
@ -291,7 +280,8 @@ DataDrivenCalendarTest::processArguments(Calendar *col, const UChar *start, int3
}
void DataDrivenCalendarTest::testConvert(int32_t n, const CalendarFieldsSet &fromSet, Calendar *fromCalendar,
const CalendarFieldsSet &toSet, Calendar *toCalendar, UBool forward) {
const CalendarFieldsSet &toSet, Calendar *toCalendar, UBool forward)
{
UErrorCode status = U_ZERO_ERROR;
UnicodeString thisString = (UnicodeString)"#"+n+" "+(forward?"forward":"reverse")+" "+fromCalendar->getType()+"->"+
toCalendar->getType();
@ -445,21 +435,20 @@ void DataDrivenCalendarTest::testConvert(TestData *testData, const DataMap *sett
}
void
DataDrivenCalendarTest::processTest(TestData *testData) {
DataDrivenCalendarTest::processTest(TestData *testData, UErrorCode status) {
Calendar *cal = NULL;
const UChar *arguments = NULL;
int32_t argLen = 0;
char testType[256];
const DataMap *settings = NULL;
const UChar *type = NULL;
UErrorCode intStatus = U_ZERO_ERROR;
UnicodeString testSetting;
int n = 0;
while(testData->nextSettings(settings, status)) {
intStatus = U_ZERO_ERROR;
status = U_ZERO_ERROR;
// try to get a locale
testSetting = settings->getString("Type", intStatus);
if(U_SUCCESS(intStatus)) {
testSetting = settings->getString("Type", status);
if(U_SUCCESS(status)) {
if((++n)>0) {
logln("---");
}
@ -478,6 +467,9 @@ DataDrivenCalendarTest::processTest(TestData *testData) {
errln("Unknown type: %s", testType);
}
}
if (U_FAILURE(status)) {
errln("Failure: %s", u_errorName(status));
}
}

View File

@ -36,7 +36,7 @@ protected:
void DataDrivenTest(char *par);
void processSequence(Calendar* cal, const UnicodeString &sequence);
void processTest(TestData *testData);
void processTest(TestData *testData, UErrorCode status);
void processArguments(Calendar *cal, const UChar *start, int32_t optLen);
private:
void testConvert(TestData *testData, const DataMap *settings, UBool fwd);
@ -44,11 +44,8 @@ private:
const CalendarFieldsSet &toSet, Calendar *toCal, UBool fwd);
private:
TestDataModule *driver;
UErrorCode status;
};
#endif /* #if !UCONFIG_NO_COLLATION */
#endif

View File

@ -28,6 +28,7 @@ static const UnicodeString& _fieldString(UDebugEnumType type, int32_t field, Un
}
}
U_CDECL_BEGIN
static void udbg_cleanup(void) {
if(strs != NULL) {
for(int t=0;t<=UDBG_ENUM_COUNT;t++) {
@ -47,6 +48,7 @@ static UBool ctestfw_cleanup(void)
static void udbg_register_cleanup(void) {
ucln_registerCleanup(UCLN_CTESTFW, ctestfw_cleanup);
}
U_CDECL_END
static void udbg_setup(void) {
if(strs == NULL) {